|
|
@@ -31,22 +31,30 @@ class WithDrawInfoController
|
|
|
{
|
|
|
$user = $request->user();
|
|
|
$userScoreData = GlobalUserInfo::getScoreDataByUserID($user->UserID);
|
|
|
+
|
|
|
+ // 获取用户已提现的总金额(State = 2 表示成功)
|
|
|
+ $withdrawnAmount = DB::table('QPAccountsDB.dbo.OrderWithDraw')
|
|
|
+ ->where('UserID', $user->UserID)
|
|
|
+ ->where('State', 2)
|
|
|
+ ->lock('WITH(NOLOCK)')
|
|
|
+ ->sum('WithDraw') ?? 0;
|
|
|
+
|
|
|
if(!$userScoreData['Recharge']){
|
|
|
$totalWithdraw = max($userScoreData['InsureScore'],40);
|
|
|
if($userScoreData['InsureScore']<40){
|
|
|
//第一种状态,我免费领了10块钱,但是金额不足40,点进去页面填信息后点击提现,提示我去玩游戏
|
|
|
- return apiReturnSuc(['state' => 1, 'total' => $totalWithdraw,'InsureScore' => $userScoreData['InsureScore']]);
|
|
|
+ return apiReturnSuc(['state' => 1, 'total' => $totalWithdraw,'InsureScore' => $userScoreData['InsureScore'], 'withdrawn' => $withdrawnAmount]);
|
|
|
}else{
|
|
|
//第二种状态,我免费金额足够40,提现按钮会点亮,告知用户点击进去
|
|
|
- return apiReturnSuc(['state' => 2, 'total' => $totalWithdraw,'InsureScore' => $userScoreData['InsureScore']]);
|
|
|
+ return apiReturnSuc(['state' => 2, 'total' => $totalWithdraw,'InsureScore' => $userScoreData['InsureScore'], 'withdrawn' => $withdrawnAmount]);
|
|
|
}
|
|
|
}else{
|
|
|
//第四种状态,VIP状态下,金额不足了,进度条颜色红色,按钮灰色(不可点击),次日整个消失
|
|
|
if($userScoreData['InsureScore']<10){
|
|
|
- return apiReturnSuc(['state' => 4, 'total' => max($userScoreData['InsureScore'],40),'InsureScore' => max($userScoreData['InsureScore'],40)]);
|
|
|
+ return apiReturnSuc(['state' => 4, 'total' => max($userScoreData['InsureScore'],40),'InsureScore' => max($userScoreData['InsureScore'],40), 'withdrawn' => $withdrawnAmount]);
|
|
|
}else{
|
|
|
//第三种状态,进去完成了充值未提现,提现按钮会高光,引导用户完成提现
|
|
|
- return apiReturnSuc(['state' => 3, 'total' => max($userScoreData['InsureScore'],40),'InsureScore' => max($userScoreData['InsureScore'],40)]);
|
|
|
+ return apiReturnSuc(['state' => 3, 'total' => max($userScoreData['InsureScore'],40),'InsureScore' => max($userScoreData['InsureScore'],40), 'withdrawn' => $withdrawnAmount]);
|
|
|
}
|
|
|
}
|
|
|
}
|