This commit is contained in:
lingling 2025-03-02 18:02:29 +08:00
commit 621cbcd48d
2 changed files with 11 additions and 4 deletions

View File

@ -84,9 +84,13 @@ class WithdrawController
$rate = ExchangeRate::where('type', 'BDT')->get();
//计算积分
$money = $amount * 100 / $rate[0]['points'] + 300;
$Withdraw = Withdraw::where('id', $id)->first();
if($Withdraw->status != 1){
return ApiResponse::error(400,[],'请勿重复点击');
}
//不同意
if ($type == 1) {
$Withdraw = Withdraw::where('id', $id)->first();
// $Withdraw = Withdraw::where('id', $id)->first();
$Withdraw->status = 3;
$Withdraw->status_text = '已驳回';
$Withdraw->save();
@ -99,21 +103,21 @@ class WithdrawController
if ($userbank) {
$res = PaymentNew::pushMoney($amount, $userbank->bank_username, $userbank->account, $userbank->bank_name, $id);
if(!$res->Success){
$Withdraw = Withdraw::where('id', $id)->first();
// $Withdraw = Withdraw::where('id', $id)->first();
$Withdraw->status = 5;
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
$Withdraw->save();
UserRewardDao::base($user_id, 1, $money, '提现失败返还');
return ApiResponse::error(400,[],'用户银行信息存在问题');
}
$Withdraw = Withdraw::where('id', $id)->first();
// $Withdraw = Withdraw::where('id', $id)->first();
$Withdraw->status = 2;
$Withdraw->status_text = '已到账';
$Withdraw->order_number = $res->TrackingNumber ?? null;
$Withdraw->save();
return ApiResponse::success(200, null, '操作成功');
} else {
$Withdraw = Withdraw::where('id', $id)->first();
// $Withdraw = Withdraw::where('id', $id)->first();
$Withdraw->status = 5;
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
$Withdraw->save();

View File

@ -176,6 +176,9 @@ class WithdrawController
if($res->ErrorMessage == "PayeeAccountNumberFormatError"){
$errorMsg = '收款人卡号格式错误';
}
if($errorMsg == ''){
$errorMsg = '未知错误';
}
$withdraw->update([
'status' => 5, //
'status_text' => '支付错误:'.$res->ErrorMessage