瀏覽代碼

抽奖修改

lizhen_gitee 1 年之前
父節點
當前提交
95209885c7
共有 1 個文件被更改,包括 14 次插入6 次删除
  1. 14 6
      application/api/controller/Eggnew.php

+ 14 - 6
application/api/controller/Eggnew.php

@@ -101,21 +101,23 @@ class Eggnew extends Api
                 // 更新礼物抽取状态
                 $giftids = array_column($giftArr1,"id");
                 $res1 = \app\common\model\EggGift::update(["is_use"=>1],["id"=>["in",$giftids]]);
-                $res1Info = \app\common\model\EggGift::where(["id"=>["in",$giftids]])->select();
+//                $res1Info = \app\common\model\EggGift::where(["id"=>["in",$giftids]])->select();
 
 
                 // 更新奖池
-                $res2 = \app\common\model\EggJackpot::update(["status"=>0],["tes"=>1]);
+                $res2 = \app\common\model\EggJackpot::update(["status"=>0],["id"=>$jackpot_id]);
                 $res3 = \app\common\model\EggJackpot::update(["status"=>1],["id"=>$next_jackpot_id]);
 
                 // 下个奖池所有礼物改为未使用
-                $res4 = \app\common\model\EggGift::update(["is_use"=>0],["Jackpot_id"=>$next_jackpot_id]);
+//                $res4 = \app\common\model\EggGift::update(["is_use"=>0],["Jackpot_id"=>$next_jackpot_id]);
+                $res4 = true;
                 // 获取下个奖池礼物
                 $nextjackpotGift = \app\common\model\EggGift::where(["Jackpot_id"=>$next_jackpot_id])->select();
 
                 $newnum = $num-$giftCount;
 
-                if($newnum <= 0) {
+                if($newnum == 0) {
+                    /*
                     $giftArr = [];
                     foreach($nextjackpotGift as $k => $v) $giftArr[$v["id"]] = $v;
 
@@ -127,7 +129,8 @@ class Eggnew extends Api
                     \app\common\model\EggGift::where(["id"=>["in",$giftids]])->select();
 
                     $res5 = \app\common\model\EggGift::update(["updatetime"=>time()],["id"=>["in",$giftids]]);
-
+                    */
+                    $res5 = true;
                     $giftdata = $giftArr1;
                 } else {
                     $giftArr = [];
@@ -155,7 +158,7 @@ class Eggnew extends Api
                 $res1 = \app\common\model\EggGift::update(["is_use"=>1],["id"=>["in",$giftids]]);
                 $res1Info = \app\common\model\EggGift::where(["id"=>["in",$giftids]])->select();
 
-
+/*
                 // ------------------ 附加逻辑开始 ---------------------//
                 // 更新奖池
                 $res2 = \app\common\model\EggJackpot::update(["updatetime"=>time()],["tes"=>1]);
@@ -179,6 +182,11 @@ class Eggnew extends Api
                 $res5 = \app\common\model\EggGift::update(["updatetime"=>time()],["id"=>["in",$giftids]]);
 
                 // ------------------ 附加逻辑结束 ---------------------//
+*/
+                $res2 = true;
+                $res3 = true;
+                $res4 = true;
+                $res5 = true;
 
                 $giftdata = $res1Info;
             }