修改支付记录

This commit is contained in:
Anyon 2020-12-14 14:07:12 +08:00
parent d1e645568f
commit 54e8a74fbc
2 changed files with 10 additions and 8 deletions

View File

@ -140,13 +140,14 @@ class JoinPaymentService extends PaymentService
}
if (isset($notify['r6_Status']) && intval($notify['r6_Status']) === 100) {
// 更新支付记录
$map = ['order_no' => $notify['r2_OrderNo'], 'payment_type' => static::$type];
$this->app->db->name('DataPaymentItem')->where($map)->update([
data_save('DataPaymentItem', [
'order_no' => $notify['r2_OrderNo'],
'payment_type' => static::$type,
'payment_code' => $notify['r9_BankTrxNo'],
'payment_amount' => $notify['r3_Amount'],
'payment_status' => 1,
'payment_datatime' => date('Y-m-d H:i:s'),
]);
], 'order_no', ['payment_type' => static::$type, 'payment_status' => 0]);
// 更新记录状态
if ($this->updateOrder($notify['r2_OrderNo'], $notify['r9_BankTrxNo'], $notify['r3_Amount'], 'joinpay')) {
return 'success';

View File

@ -104,13 +104,14 @@ class WechatPaymentService extends PaymentService
$notify = $this->payment->getNotify();
if ($notify['result_code'] == 'SUCCESS' && $notify['return_code'] == 'SUCCESS') {
// 更新支付记录
$map = ['order_no' => $notify['out_trade_no'], 'payment_type' => static::$type];
$this->app->db->name('DataPaymentItem')->where($map)->update([
'payment_code' => $notify['r9_BankTrxNo'],
'payment_amount' => $notify['r3_Amount'],
data_save('DataPaymentItem', [
'order_no' => $notify['out_trade_no'],
'payment_type' => static::$type,
'payment_code' => $notify['transaction_id'],
'payment_amount' => $notify['cash_fee'] / 100,
'payment_status' => 1,
'payment_datatime' => date('Y-m-d H:i:s'),
]);
], 'order_no', ['payment_type' => static::$type, 'payment_status' => 0]);
// 更新记录状态
if ($this->updateOrder($notify['out_trade_no'], $notify['transaction_id'], $notify['cash_fee'] / 100, 'wechat')) {
return $this->payment->getNotifySuccessReply();