|
|
@@ -72,11 +72,11 @@ class WithDrawInfoController
|
|
|
$UserID=$user->UserID;
|
|
|
|
|
|
|
|
|
- $paypass = $request->input('paypass');
|
|
|
-
|
|
|
- if (empty($user->InsurePass)||!Hash::check($paypass,$user->InsurePass)) {
|
|
|
- return apiReturnFail(['web.user.paypass_fail', 'A senha original está errada, digite-a novamente.'], '', 2);
|
|
|
- }
|
|
|
+// $paypass = $request->input('paypass');
|
|
|
+//
|
|
|
+// if (empty($user->InsurePass)||!Hash::check($paypass,$user->InsurePass)) {
|
|
|
+// return apiReturnFail(['web.user.paypass_fail', 'A senha original está errada, digite-a novamente.'], '', 2);
|
|
|
+// }
|
|
|
|
|
|
$dbh = DB::connection()->getPdo();
|
|
|
|
|
|
@@ -101,11 +101,11 @@ class WithDrawInfoController
|
|
|
$UserID=$user->UserID;
|
|
|
|
|
|
|
|
|
- $paypass = $request->input('paypass');
|
|
|
-
|
|
|
- if (empty($user->InsurePass)||!Hash::check($paypass,$user->InsurePass)) {
|
|
|
- return apiReturnFail(['web.user.paypass_fail', 'A senha original está errada, digite-a novamente.'], '', 2);
|
|
|
- }
|
|
|
+// $paypass = $request->input('paypass');
|
|
|
+//
|
|
|
+// if (empty($user->InsurePass)||!Hash::check($paypass,$user->InsurePass)) {
|
|
|
+// return apiReturnFail(['web.user.paypass_fail', 'A senha original está errada, digite-a novamente.'], '', 2);
|
|
|
+// }
|
|
|
|
|
|
$score=$request->input('score',0);
|
|
|
if(!$score||is_float($score)||$score<=0){
|
|
|
@@ -495,38 +495,21 @@ class WithDrawInfoController
|
|
|
|
|
|
$user = $request->user();
|
|
|
$UserID=$user->UserID;
|
|
|
- $paypass = $request->input('paypass');
|
|
|
- if (!empty($user->InsurePass)&&!Hash::check($paypass,$user->InsurePass)) {
|
|
|
- return apiReturnFail(['web.user.paypass_fail', 'A senha original está errada, digite-a novamente.'], '', 2);
|
|
|
- }
|
|
|
|
|
|
// $UserID = (int)$request->globalUser->UserID;//$request->input('UserID');
|
|
|
// $RequestDynamicPass = $request->input('DynamicPass');
|
|
|
$PixType = $request->input('cbPixType');
|
|
|
- $BankNO = $request->input('bank');
|
|
|
- $AccountsBank = urldecode($request->input('account'));
|
|
|
$BankUserName = urldecode($request->input('userName'));
|
|
|
- $BankUserName=Util::filterNickName($BankUserName);
|
|
|
- $PhoneNumber = $request->input('phone');
|
|
|
$EmailAddress = $request->input('email');
|
|
|
- $IFSCNumber = $request->input('IFSC');
|
|
|
- $PANNumber = $request->input('PAN');
|
|
|
- $AdhaarNumber = $request->input('adhaar');
|
|
|
- $BranchBank = $request->input('branceBank');
|
|
|
$PixNum = $request->input('PixNum');
|
|
|
|
|
|
- if(!empty($PhoneNumber))$PhoneNumber=Util::cleanEmptyString($PhoneNumber);
|
|
|
if(!empty($EmailAddress))$EmailAddress=Util::cleanEmptyString($EmailAddress);
|
|
|
if(!empty($PixNum))$PixNum=Util::cleanEmptyString($PixNum);
|
|
|
- if (!empty($PhoneNumber)&&!Util::validatePhone($PhoneNumber)) {
|
|
|
- return apiReturnFail(['web.user.phone_fail','Wrong phone format']);
|
|
|
- }
|
|
|
+
|
|
|
if (!empty($EmailAddress)&&!Util::validateEmail($EmailAddress)) {
|
|
|
return apiReturnFail(['web.user.email_fail','Wrong email format']);
|
|
|
}
|
|
|
- if(!Util::validateCpf($PixNum)){
|
|
|
- return apiReturnFail(['withdraw.account.tip.cpf_error','Cpf error format']);
|
|
|
- }
|
|
|
+
|
|
|
$redisKey = 'withDrawInfo_withDrawInfo_'.$UserID;
|
|
|
if (!SetNXLock::getExclusiveLock($redisKey)) {
|
|
|
Util::WriteLog("withdrawInfo",[1, $request->all()]);
|
|
|
@@ -546,23 +529,22 @@ class WithDrawInfoController
|
|
|
}
|
|
|
|
|
|
// 验证PixNum绑定次数
|
|
|
- if (!empty($PixNum)) {
|
|
|
- $BindCount = DB::table(TableName::QPRecordDB() . 'RecordBankCardBind')
|
|
|
- ->where('BankCard', $PixNum)
|
|
|
- ->lock('WITH(NOLOCK)')
|
|
|
- ->count();
|
|
|
- if ($BindCount >= 6) {
|
|
|
- Util::WriteLog("withdrawInfo",[4, $request->all()]);
|
|
|
- SetNXLock::release($redisKey);
|
|
|
- return apiReturnFail(['web.withdraw.cpf_number_used','O número do CPF foi usado várias vezes e não pode ser salvo'], [], 302);
|
|
|
- }
|
|
|
- }
|
|
|
+// if (!empty($PixNum)) {
|
|
|
+// $BindCount = DB::table(TableName::QPRecordDB() . 'RecordBankCardBind')
|
|
|
+// ->where('BankCard', $PixNum)
|
|
|
+// ->lock('WITH(NOLOCK)')
|
|
|
+// ->count();
|
|
|
+// if ($BindCount >= 6) {
|
|
|
+// Util::WriteLog("withdrawInfo",[4, $request->all()]);
|
|
|
+// SetNXLock::release($redisKey);
|
|
|
+// return apiReturnFail(['web.withdraw.cpf_number_used','O número do CPF foi usado várias vezes e não pode ser salvo'], [], 302);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- if ($PixType < 10) {
|
|
|
- $data = compact('PixType', 'BankUserName', 'PhoneNumber', 'EmailAddress', 'PixNum');
|
|
|
+ if ($PixType==1) {
|
|
|
+ $data = compact('PixType', 'BankUserName', 'PixNum');
|
|
|
} else {
|
|
|
- $data = compact('PixType', 'BankNO', 'AccountsBank', 'IFSCNumber', 'PANNumber', 'AdhaarNumber', 'BranchBank');
|
|
|
- $PixNum = $BankNO;
|
|
|
+ $data = compact('PixType', 'EmailAddress');
|
|
|
}
|
|
|
|
|
|
foreach ($data as $key => &$val) {
|
|
|
@@ -594,26 +576,6 @@ class WithDrawInfoController
|
|
|
->update($data);
|
|
|
}
|
|
|
|
|
|
- // 添加绑定记录
|
|
|
- if (empty($AccountWithDrawInfo->PixNum) || $AccountWithDrawInfo->PixNum != $PixNum) {
|
|
|
- try {
|
|
|
- DB::table(TableName::QPRecordDB() . 'RecordBankCardBind')
|
|
|
- ->insert([
|
|
|
- 'UserID' => $UserID,
|
|
|
- 'BankCard' => $PixNum ?: '',
|
|
|
- 'BindDate' => now()
|
|
|
- ]);
|
|
|
- Util::WriteLog('update_pix',[
|
|
|
- 'UserID' => $UserID,
|
|
|
- 'BankCard' => $PixNum ?: '',
|
|
|
- 'BindDate' => now()
|
|
|
- ]);
|
|
|
- } catch (\Exception $e) {
|
|
|
- Log::error('insert RecordBankCardBind failed', ['data' => $data]);
|
|
|
- Util::WriteLog("withdrawInfo",[7, $request->all(),$data]);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
SetNXLock::release($redisKey);
|
|
|
return apiReturnSuc();
|
|
|
}
|