feat: 新增订单号
This commit is contained in:
parent
ebb195aacb
commit
e21ca4d47c
|
@ -54,7 +54,7 @@ class PaymentNew
|
||||||
/**
|
/**
|
||||||
* 转账
|
* 转账
|
||||||
*/
|
*/
|
||||||
public static function pushMoney($money, $payeeAccountName, $payeeAccountNumber, $payeeBankName)
|
public static function pushMoney($money, $payeeAccountName, $payeeAccountNumber, $payeeBankName,$orderId)
|
||||||
{
|
{
|
||||||
$secret_key = "sZ2wAfh1lMkxBVrlY4uZY8Fj92E4scFf";
|
$secret_key = "sZ2wAfh1lMkxBVrlY4uZY8Fj92E4scFf";
|
||||||
$url = "https://mdf.hr5688.com/api/createPaymentOrder";
|
$url = "https://mdf.hr5688.com/api/createPaymentOrder";
|
||||||
|
@ -79,7 +79,7 @@ class PaymentNew
|
||||||
"PayeeIFSCCode" => "",
|
"PayeeIFSCCode" => "",
|
||||||
"PaymentChannelId" => $PaymentChannelId,
|
"PaymentChannelId" => $PaymentChannelId,
|
||||||
"ShopInformUrl" => "http://149.129.107.38/",
|
"ShopInformUrl" => "http://149.129.107.38/",
|
||||||
"ShopOrderId" => "11",
|
"ShopOrderId" => $orderId,
|
||||||
"ShopUserLongId" => "776ae472-d4fc-435c-9639-be5763138d95"
|
"ShopUserLongId" => "776ae472-d4fc-435c-9639-be5763138d95"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -117,13 +117,20 @@ class WithdrawController
|
||||||
return ApiResponseApp::success(null, '等待管理员审核');
|
return ApiResponseApp::success(null, '等待管理员审核');
|
||||||
}
|
}
|
||||||
//用户积分减少$money
|
//用户积分减少$money
|
||||||
// UserRewardDao::base($user_id, 1, - ($money_no + 300), '提现');
|
UserRewardDao::base($user_id, 1, - ($money_no + 300), '提现');
|
||||||
$userbank = Userbank::where('id', $bank_id)->first();
|
$userbank = Userbank::where('id', $bank_id)->first();\
|
||||||
var_dump($money);
|
//存入数据库
|
||||||
var_dump($userbank->bank_username);
|
Withdraw::create([
|
||||||
var_dump($userbank->account);
|
'user_id' => $user_id,
|
||||||
var_dump($userbank->bank_name);
|
'amount' => $money,
|
||||||
$res = PaymentNew::pushMoney($money, $userbank->bank_username, $userbank->account, $userbank->bank_name);
|
'status' => 2,
|
||||||
|
'createtime2' => date('Y-m-d H:i:s'),
|
||||||
|
'username' => $user->username,
|
||||||
|
'status_text' => '已到账',
|
||||||
|
]);
|
||||||
|
//获取刚刚存入数据库的id(订单号)
|
||||||
|
$orderId = $withdraw->id;
|
||||||
|
PaymentNew::pushMoney($money, $userbank->bank_username, $userbank->account, $userbank->bank_name,$orderId);
|
||||||
// var_dump($res);
|
// var_dump($res);
|
||||||
// //逻辑错误需要修改
|
// //逻辑错误需要修改
|
||||||
// if ($res['Success'] == 200) {
|
// if ($res['Success'] == 200) {
|
||||||
|
@ -163,17 +170,17 @@ class WithdrawController
|
||||||
$type = $request->post('type');
|
$type = $request->post('type');
|
||||||
|
|
||||||
if ($type == 1) {
|
if ($type == 1) {
|
||||||
$res = PaymentNew::pushMoney($amount, $bank_username, $account, $bank_name);
|
$res = PaymentNew::pushMoney($amount, $bank_username, $account, $bank_name,$id);
|
||||||
var_dump($res);
|
// var_dump($res);
|
||||||
if ($res['Success'] == 200) {
|
// if ($res['Success'] == 200) {
|
||||||
$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->save();
|
// $Withdraw->save();
|
||||||
return ApiResponseApp::success(null, '转账成功');
|
// return ApiResponseApp::success(null, '转账成功');
|
||||||
} else {
|
// } else {
|
||||||
return ApiResponseApp::error(null, '转账失败');
|
// return ApiResponseApp::error(null, '转账失败');
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
$Withdraw = Withdraw::where('id', $id)->first();
|
$Withdraw = Withdraw::where('id', $id)->first();
|
||||||
$Withdraw->status = 3;
|
$Withdraw->status = 3;
|
||||||
|
|
Loading…
Reference in New Issue