fix: 修复问题
This commit is contained in:
parent
5eb66a1c75
commit
2573c53446
@ -84,9 +84,13 @@ class WithdrawController
|
|||||||
$rate = ExchangeRate::where('type', 'BDT')->get();
|
$rate = ExchangeRate::where('type', 'BDT')->get();
|
||||||
//计算积分
|
//计算积分
|
||||||
$money = $amount * 100 / $rate[0]['points'] + 300;
|
$money = $amount * 100 / $rate[0]['points'] + 300;
|
||||||
|
$Withdraw = Withdraw::where('id', $id)->first();
|
||||||
|
if($Withdraw->status != 1){
|
||||||
|
return ApiResponse::error(400,[],'请勿重复点击');
|
||||||
|
}
|
||||||
//不同意
|
//不同意
|
||||||
if ($type == 1) {
|
if ($type == 1) {
|
||||||
$Withdraw = Withdraw::where('id', $id)->first();
|
// $Withdraw = Withdraw::where('id', $id)->first();
|
||||||
$Withdraw->status = 3;
|
$Withdraw->status = 3;
|
||||||
$Withdraw->status_text = '已驳回';
|
$Withdraw->status_text = '已驳回';
|
||||||
$Withdraw->save();
|
$Withdraw->save();
|
||||||
@ -99,21 +103,21 @@ class WithdrawController
|
|||||||
if ($userbank) {
|
if ($userbank) {
|
||||||
$res = PaymentNew::pushMoney($amount, $userbank->bank_username, $userbank->account, $userbank->bank_name, $id);
|
$res = PaymentNew::pushMoney($amount, $userbank->bank_username, $userbank->account, $userbank->bank_name, $id);
|
||||||
if(!$res->Success){
|
if(!$res->Success){
|
||||||
$Withdraw = Withdraw::where('id', $id)->first();
|
// $Withdraw = Withdraw::where('id', $id)->first();
|
||||||
$Withdraw->status = 5;
|
$Withdraw->status = 5;
|
||||||
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
|
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
|
||||||
$Withdraw->save();
|
$Withdraw->save();
|
||||||
UserRewardDao::base($user_id, 1, $money, '提现失败返还');
|
UserRewardDao::base($user_id, 1, $money, '提现失败返还');
|
||||||
return ApiResponse::error(400,[],'用户银行信息存在问题');
|
return ApiResponse::error(400,[],'用户银行信息存在问题');
|
||||||
}
|
}
|
||||||
$Withdraw = Withdraw::where('id', $id)->first();
|
// $Withdraw = Withdraw::where('id', $id)->first();
|
||||||
$Withdraw->status = 2;
|
$Withdraw->status = 2;
|
||||||
$Withdraw->status_text = '已到账';
|
$Withdraw->status_text = '已到账';
|
||||||
$Withdraw->order_number = $res->TrackingNumber ?? null;
|
$Withdraw->order_number = $res->TrackingNumber ?? null;
|
||||||
$Withdraw->save();
|
$Withdraw->save();
|
||||||
return ApiResponse::success(200, null, '操作成功');
|
return ApiResponse::success(200, null, '操作成功');
|
||||||
} else {
|
} else {
|
||||||
$Withdraw = Withdraw::where('id', $id)->first();
|
// $Withdraw = Withdraw::where('id', $id)->first();
|
||||||
$Withdraw->status = 5;
|
$Withdraw->status = 5;
|
||||||
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
|
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
|
||||||
$Withdraw->save();
|
$Withdraw->save();
|
||||||
|
@ -170,9 +170,12 @@ class WithdrawController
|
|||||||
if($res->ErrorMessage == "PayeeAccountNumberFormatError"){
|
if($res->ErrorMessage == "PayeeAccountNumberFormatError"){
|
||||||
$errorMsg = '收款人卡号格式错误';
|
$errorMsg = '收款人卡号格式错误';
|
||||||
}
|
}
|
||||||
|
if($errorMsg == ''){
|
||||||
|
$errorMsg = '未知错误';
|
||||||
|
}
|
||||||
$withdraw->update([
|
$withdraw->update([
|
||||||
'status' => 5, //
|
'status' => 5, //
|
||||||
'status_text' => '支付错误:'.$errorMsg
|
'status_text' => '支付错误:'.$res->ErrorMessage
|
||||||
]);
|
]);
|
||||||
UserRewardDao::base($user_id, 1, $money_no + 300, '提现失败返还');
|
UserRewardDao::base($user_id, 1, $money_no + 300, '提现失败返还');
|
||||||
// if ($res->ErrorMessage == "PayeeAccountNameFormatError") {
|
// if ($res->ErrorMessage == "PayeeAccountNameFormatError") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user