文件地址:app/controller/api/v1/order/StoreOrder.php
方法名称:pay()
修改代码:
如下图位置
$isChannel = $this->getChennel[$from] ?? ($request->isApp() ? 4 : 1);
$updateData = ['is_channel' => $isChannel];
//只要重新支付就更新订单号
if (in_array($paytype, [PayServices::ALIAPY_PAY, PayServices::WEIXIN_PAY])) {
mt_srand();
$order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
if (sys_config('pay_routine_open', 0)) {
/** @var StoreOrderCreateServices $orderCreateServices */
$orderCreateServices = app()->make(StoreOrderCreateServices::class);
$order['order_id'] = $orderCreateServices->getNewOrderId();
$updateData['unique'] = $order['order_id'];
}
}
$this->services->update($order['id'], $updateData, 'id');