This commit is contained in:
xman 2025-06-27 11:20:01 +08:00
parent e1cd94e678
commit 090890f7e2

View File

@ -704,7 +704,7 @@ class Order extends Backend
$result = false; $result = false;
Db::startTrans(); Db::startTrans();
$order = model('order')->get($params['order_id'], ['dispatch']); $order = model('order')->get($params['order_id']);
if (!$order) { if (!$order) {
$this->error('Not Find'); $this->error('Not Find');
} }
@ -717,9 +717,10 @@ class Order extends Backend
$result = $order->allowField(true)->save($params); $result = $order->allowField(true)->save($params);
if (!empty($order->dispatch->id)) { $dispatch = OrderDispatch::where('order_id', $order->id)->where('status','>',0)->find();
if (!empty($dispatch)) {
$orderLogic = new OrderLogic(); $orderLogic = new OrderLogic();
$orderLogic->cancelOrderDispatch($order->dispatch, $this->auth, '订单被取消', false); $orderLogic->cancelOrderDispatch($dispatch, $this->auth, '订单被取消', false);
} }
//日志 //日志
$hookparams['order'] = $order; $hookparams['order'] = $order;