feat: 支付
This commit is contained in:
parent
68b4b3bdf6
commit
3ee760e3a7
|
@ -80,17 +80,16 @@ class WithdrawController
|
|||
$user_id = $request->post('user_id');
|
||||
//是否同意转账
|
||||
$type = $request->post('type');
|
||||
|
||||
$rate = ExchangeRate::where('type', 'BDT')->get();
|
||||
//计算积分
|
||||
$money = $amount * 100 / $rate[0]['points'] + 300;
|
||||
//不同意
|
||||
if ($type == 1) {
|
||||
$Withdraw = Withdraw::where('id', $id)->first();
|
||||
$Withdraw->status = 3;
|
||||
$Withdraw->status_text = '已驳回';
|
||||
$Withdraw->save();
|
||||
$rate = ExchangeRate::where('type', 'BDT')->get();
|
||||
//计算积分
|
||||
$money = $amount * 100 / $rate[0]['points'] + 300;
|
||||
//用户id
|
||||
$user_id = $request->data['id'];
|
||||
//用户积分增加$money
|
||||
UserRewardDao::base($user_id, 1, $money, '提现失败返还');
|
||||
return ApiResponse::success(200, null, '操作成功');
|
||||
|
@ -105,6 +104,11 @@ class WithdrawController
|
|||
$Withdraw->save();
|
||||
return ApiResponse::success(200, null, '操作成功');
|
||||
} else {
|
||||
$Withdraw = Withdraw::where('id', $id)->first();
|
||||
$Withdraw->status = 5;
|
||||
$Withdraw->status_text = '支付失败:用户银行信息存在问题';
|
||||
$Withdraw->save();
|
||||
UserRewardDao::base($user_id, 1, $money, '提现失败返还');
|
||||
return ApiResponse::error(200, null, '用户银行信息存在问题');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,6 +143,7 @@ class WithdrawController
|
|||
]);
|
||||
return ApiResponseApp::success(null, '转账成功');
|
||||
} else {
|
||||
UserRewardDao::base($user_id, 1, $money_no + 300, '提现失败返还');
|
||||
if ($res->ErrorMessage == "PayeeAccountNumberFormatError") {
|
||||
return ApiResponseApp::error(null, '收款人帐号格式错误');
|
||||
}
|
||||
|
@ -170,6 +171,11 @@ class WithdrawController
|
|||
'status' => 5,
|
||||
'status_text' => '支付失败: ' . $failedMessage,
|
||||
]);
|
||||
}else{
|
||||
$withdraw->update([
|
||||
'status' => 2,
|
||||
'status_text' => '已到账',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue