|
|
@@ -31,6 +31,7 @@ use App\Services\PayConfig;
|
|
|
use App\Services\SmartFastPay;
|
|
|
use App\Services\StoredProcedure;
|
|
|
use App\Util;
|
|
|
+use App\Utility\SetNXLock;
|
|
|
use Illuminate\Http\Request;
|
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
@@ -179,6 +180,7 @@ class ActivityController extends Controller
|
|
|
case 5:
|
|
|
return apiReturnFail(['web.checkin.recharge_required', 'Recharge is required to sign in'],[],777);
|
|
|
case 0:
|
|
|
+ $this->triggerSignIn($UserID);
|
|
|
return apiReturnSuc($result);
|
|
|
default:
|
|
|
return apiReturnFail(['web.checkin.unknown_error', 'Unknown error']);
|
|
|
@@ -693,7 +695,53 @@ class ActivityController extends Controller
|
|
|
|
|
|
// 添加提现额度到用户账户
|
|
|
if ($rewardAmount > 0) {
|
|
|
- OuroGameService::AddScore($userId, $rewardAmount * NumConfig::NUM_VALUE, 91, true);
|
|
|
+
|
|
|
+ $dbh = DB::connection()->getPdo();
|
|
|
+
|
|
|
+ $score=$rewardAmount*NumConfig::NUM_VALUE;
|
|
|
+
|
|
|
+ $sql="DECLARE @return_value int
|
|
|
+ set nocount on use QPAccountsDB
|
|
|
+ EXEC @return_value = GSP_GR_GetFreeWithDraw '$userId','$score'
|
|
|
+ SELECT 'ReturnValue' = @return_value";
|
|
|
+ $stmt = $dbh->prepare($sql);
|
|
|
+ $stmt->execute();
|
|
|
+ $retval = $stmt->fetch(\PDO::FETCH_ASSOC);
|
|
|
+ try {
|
|
|
+// set @ret = 1 --可提额度不足
|
|
|
+// set @ret = 2 --低于最低可提现金额
|
|
|
+// set @ret = 3 --高于最高可提现金额
|
|
|
+// set @ret = 4 --超过每天提现次数上限
|
|
|
+// set @ret = 5 --身上钱不够
|
|
|
+// set @ret = 6 --开在游戏里面
|
|
|
+// set @ret = 7 --未充值的用户TX额度
|
|
|
+ if (isset($retval['ReturnValue'])) {
|
|
|
+ $ReturnValue = $retval['ReturnValue'];
|
|
|
+ // set @ret = 1 -- Insufficient withdrawal amount
|
|
|
+// set @ret = 2 -- Lower than the minimum withdrawal amount
|
|
|
+// set @ret = 3 -- Higher than the maximum withdrawal amount
|
|
|
+// set @ret = 4 -- Exceeded the daily withdrawal limit
|
|
|
+// set @ret = 5 -- Not enough money on hand
|
|
|
+// set @ret = 6 -- Opened in the game
|
|
|
+// set @ret = 7 -- Undeposited user TX amount
|
|
|
+ $errors = [
|
|
|
+ [],
|
|
|
+ ['web.withdraw.no_withdraw_value', "The withdrawable amount is not enough"],
|
|
|
+ ['web.withdraw.too_low', 'Lower than the minimum withdrawal amount'],
|
|
|
+ ['web.withdraw.too_high', 'Higher than the maximum withdrawal amount'],
|
|
|
+ ['web.withdraw.day_max', 'Exceeded the daily withdrawal limit'],
|
|
|
+ ['web.withdraw.no_enouth_score', 'Not enough money on hand'],
|
|
|
+ ['web.withdraw.in_game', 'Sorry, You\'re in game for now'],
|
|
|
+ ['web.withdraw.no_deposit', ' You need deposit first!'],
|
|
|
+ ];
|
|
|
+ return apiReturnFail($errors[$ReturnValue], [], $ReturnValue == 7 ? 777 : 301);
|
|
|
+ }else{
|
|
|
+ //return apiReturnSuc($retval);
|
|
|
+ }
|
|
|
+ }catch (\Exception $e){
|
|
|
+ // TelegramBot::getDefault()->sendProgramNotify("WithDraw Error:", var_export($retval,true).':'.$e->getTraceAsString());
|
|
|
+ //return apiReturnSuc($retval);
|
|
|
+ }
|
|
|
|
|
|
// 记录日志
|
|
|
\Log::info('VIP提现任务奖励', [
|