新增功能
This commit is contained in:
@@ -84,5 +84,23 @@ class PayNotifyLogic extends BaseLogic
|
||||
$order->save();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 订单支付回调
|
||||
* @param $orderSn
|
||||
* @param array $extra
|
||||
*/
|
||||
public static function order($orderSn, array $extra = [])
|
||||
{
|
||||
$order = \app\common\model\Order::where('order_no', $orderSn)->findOrEmpty();
|
||||
if ($order->isEmpty()) {
|
||||
throw new \Exception('订单不存在: ' . $orderSn);
|
||||
}
|
||||
if ($order->status == 2) {
|
||||
return;
|
||||
}
|
||||
$order->status = 2;
|
||||
$order->pay_time = date('Y-m-d H:i:s');
|
||||
$order->transaction_id = $extra['transaction_id'] ?? '';
|
||||
$order->save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user