|  | @@ -84,6 +84,10 @@ class Eggnew extends Api
 | 
											
												
													
														|  |                  $jackpot_id = $jackpot["id"];
 |  |                  $jackpot_id = $jackpot["id"];
 | 
											
												
													
														|  |              } else { // 没有开放的奖池
 |  |              } else { // 没有开放的奖池
 | 
											
												
													
														|  |                  $jackpotInfo = \app\common\model\EggJackpot::where('type',$type)->order('weigh asc,id asc')->find();
 |  |                  $jackpotInfo = \app\common\model\EggJackpot::where('type',$type)->order('weigh asc,id asc')->find();
 | 
											
												
													
														|  | 
 |  | +                if(!empty($jackpotInfo)){
 | 
											
												
													
														|  | 
 |  | +                    Db::rollback();
 | 
											
												
													
														|  | 
 |  | +                    $this->error('暂时还没有奖池');
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  |                  $jackpot_id = $jackpotInfo["id"];
 |  |                  $jackpot_id = $jackpotInfo["id"];
 | 
											
												
													
														|  |                  \app\common\model\EggJackpot::update(["status"=>1],["id"=>$jackpot_id]);//打开
 |  |                  \app\common\model\EggJackpot::update(["status"=>1],["id"=>$jackpot_id]);//打开
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
										
											
												
													
														|  | @@ -134,13 +138,17 @@ class Eggnew extends Api
 | 
											
												
													
														|  |                      $giftdata = $giftArr1;
 |  |                      $giftdata = $giftArr1;
 | 
											
												
													
														|  |                  } else {
 |  |                  } else {
 | 
											
												
													
														|  |                      if($newnum > count($nextjackpotGift)){
 |  |                      if($newnum > count($nextjackpotGift)){
 | 
											
												
													
														|  | 
 |  | +                        Db::rollback();
 | 
											
												
													
														|  |                          $this->error("奖池礼物待更新,请耐心等待!");
 |  |                          $this->error("奖池礼物待更新,请耐心等待!");
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                      $giftArr = [];
 |  |                      $giftArr = [];
 | 
											
												
													
														|  |                      foreach($nextjackpotGift as $k => $v) $giftArr[$v["id"]] = $v;
 |  |                      foreach($nextjackpotGift as $k => $v) $giftArr[$v["id"]] = $v;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -                    if(!$giftArr) $this->error("奖池礼物待更新,请耐心等待!");
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    if(!$giftArr){
 | 
											
												
													
														|  | 
 |  | +                        Db::rollback();
 | 
											
												
													
														|  | 
 |  | +                        $this->error("奖池礼物待更新,请耐心等待!");
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                      $giftids = array_rand($giftArr,$newnum);
 |  |                      $giftids = array_rand($giftArr,$newnum);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -195,7 +203,10 @@ class Eggnew extends Api
 | 
											
												
													
														|  |                  $giftdata = $res1Info;
 |  |                  $giftdata = $res1Info;
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -            if(!$giftdata) $this->error("系统错误!");
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if(!$giftdata) {
 | 
											
												
													
														|  | 
 |  | +                Db::rollback();
 | 
											
												
													
														|  | 
 |  | +                $this->error('礼物为空');
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |              $data = [];
 |  |              $data = [];
 | 
											
												
													
														|  |              foreach($giftdata as $k => $v) {
 |  |              foreach($giftdata as $k => $v) {
 | 
											
										
											
												
													
														|  | @@ -235,9 +246,9 @@ class Eggnew extends Api
 | 
											
												
													
														|  |              $backdata && $res7 = \app\common\model\GiftBack::insertAll($backdata);
 |  |              $backdata && $res7 = \app\common\model\GiftBack::insertAll($backdata);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -            if($res1 !== false && $res2 && $res3 && $res4 && $res5 && $res6 && $res7) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if($res1 !== false && $res2 !== false && $res3 !== false && $res4 !== false && $res5 !== false && $res6 && $res7) {
 | 
											
												
													
														|  |                  Db::commit();
 |  |                  Db::commit();
 | 
											
												
													
														|  | -                $eggStrikeNotice = config("site.eggStrikeNotice");
 |  | 
 | 
											
												
													
														|  | 
 |  | +                /*$eggStrikeNotice = config("site.eggStrikeNotice");
 | 
											
												
													
														|  |                  if($party_id){
 |  |                  if($party_id){
 | 
											
												
													
														|  |                      $partyInfo = \app\common\model\Party::field("id,room_type,party_name")->where(["id"=>$party_id])->find();
 |  |                      $partyInfo = \app\common\model\Party::field("id,room_type,party_name")->where(["id"=>$party_id])->find();
 | 
											
												
													
														|  |                      foreach ($backdata as $backdatum) {
 |  |                      foreach ($backdata as $backdatum) {
 | 
											
										
											
												
													
														|  | @@ -247,13 +258,10 @@ class Eggnew extends Api
 | 
											
												
													
														|  |                              QueueApi::sendGroupMessage(73, '', $this->auth->nickname, $partyInfo, $giftUserParty);
 |  |                              QueueApi::sendGroupMessage(73, '', $this->auth->nickname, $partyInfo, $giftUserParty);
 | 
											
												
													
														|  |                          }
 |  |                          }
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | 
 |  | +                }*/
 | 
											
												
													
														|  |              } else {
 |  |              } else {
 | 
											
												
													
														|  | -                // 返还锤子
 |  | 
 | 
											
												
													
														|  | -                for($i=1;$i<=$num;$i++) {
 |  | 
 | 
											
												
													
														|  | -                    $val = date("YmdHis").$i;
 |  | 
 | 
											
												
													
														|  | -                    $redis->lpush("hammer_num_".$user_id,$val);
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | 
 |  | +                Db::rollback();
 | 
											
												
													
														|  | 
 |  | +                $this->error('开奖失败');
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          }catch (ValidateException $e) {
 |  |          }catch (ValidateException $e) {
 |