Tree 2 luni în urmă
părinte
comite
6f01d4a43e

+ 3 - 0
app/Game/GlobalUserInfo.php

@@ -179,16 +179,19 @@ class GlobalUserInfo extends Model
             $scoreObj=GameScoreInfo::query()->select(['Score','InsureScore'])->where('UserID', $userID)->first();
             if($scoreObj){
                 self::$userToScoresData[$userID]['Score'] = intval($scoreObj->Score) / NumConfig::NUM_VALUE;
+
                 self::$userToScoresData[$userID]['InsureScore'] = intval($scoreObj->InsureScore) / NumConfig::NUM_VALUE;
                 $user_recharge = DB::table(TableName::QPAccountsDB() . 'YN_VIPAccount')
                     ->where('UserID', $userID)
                     ->value('Recharge') ?: 0;
+                self::$userToScoresData[$userID]['Recharge'] = $user_recharge;
                 if(!$user_recharge){
                     self::$userToScoresData[$userID]['Score'] = 0;
                     self::$userToScoresData[$userID]['InsureScore'] = intval($scoreObj->Score) / NumConfig::NUM_VALUE;
                 }
             }else{
                 self::$userToScoresData[$userID]['Score'] = 0;
+                self::$userToScoresData[$userID]['Recharge'] = 0;
                 self::$userToScoresData[$userID]['InsureScore'] = 0;
             }
         }

+ 27 - 0
app/Http/Controllers/Game/WithDrawInfoController.php

@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Game;
 
 
 use App\Facade\TableName;
+use App\Game\GlobalUserInfo;
 use App\Http\helper\NumConfig;
 use App\Models\AccountsInfo;
 use App\Models\Treasure\GameScoreLocker;
@@ -20,6 +21,32 @@ use Illuminate\Support\Facades\Validator;
 class WithDrawInfoController
 {
 
+
+
+    public function FreeWithDrawInfo(Request $request)
+    {
+        $user = $request->user();
+        $userScoreData = GlobalUserInfo::getScoreDataByUserID($user->UserID);
+        if(!$userScoreData['Recharge']){
+            $totalWithdraw = max($userScoreData['InsureScore'],40);
+            if($userScoreData['InsureScore']<40){
+                //第一种状态,我免费领了10块钱,但是金额不足40,点进去页面填信息后点击提现,提示我去玩游戏
+                return apiReturnSuc(['state' => 1, 'total' => $totalWithdraw,'InsureScore' => $userScoreData['InsureScore']]);
+            }else{
+                //第二种状态,我免费金额足够40,提现按钮会点亮,告知用户点击进去
+                return apiReturnSuc(['state' => 2, 'total' => $totalWithdraw,'InsureScore' => $userScoreData['InsureScore']]);
+            }
+        }else{
+            //第四种状态,VIP状态下,金额不足了,进度条颜色红色,按钮灰色(不可点击),次日整个消失
+            if($userScoreData['InsureScore']<10){
+                return apiReturnSuc(['state' => 4, 'total' => $userScoreData['InsureScore'],'InsureScore' => $userScoreData['InsureScore']]);
+            }else{
+                //第三种状态,进去完成了充值未提现,提现按钮会高光,引导用户完成提现
+                return apiReturnSuc(['state' => 3, 'total' => $userScoreData['InsureScore'],'InsureScore' => $userScoreData['InsureScore']]);
+            }
+        }
+    }
+
     public function WithDrawRecord(Request $request)
     {
 

+ 3 - 0
routes/game.php

@@ -309,6 +309,9 @@ Route::group([
     $route->any('/withDraw/mexWithDrawInfo', 'Game\WithDrawInfoController@MexWithDrawInfo');//提现信息完善
     $route->any('/withDraw/ruWithDrawInfo', 'Game\WithDrawInfoController@RuWithDrawInfo');//提现信息完善
     $route->any('/withDraw/withDrawInfo', 'Game\WithDrawInfoController@withDrawInfo');//提现信息完善
+
+    $route->any('/withDraw/freeWithDrawInfo', 'Game\WithDrawInfoController@FreeWithDrawInfo');//提现信息完善
+
     $route->any('/withDraw/getWithDrawInfo', 'Game\WithDrawInfoController@getWithDrawInfo');//获取提现信息
     $route->any('/withDraw/baseInfo', 'Game\WithDrawInfoController@GetWithDrawBaseInfo');//获取提现信息
     $route->any('/withDraw/payout', 'Game\WithDrawInfoController@GoWithDraw');//获取提现信息