tts
This commit is contained in:
parent
4d2b9074a5
commit
b28deda70e
|
|
@ -620,14 +620,16 @@ class Order extends Backend
|
||||||
'update_time' => now()->format('Y-m-d H:m:s'),
|
'update_time' => now()->format('Y-m-d H:m:s'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$orderDispatch = OrderDispatch::where('order_id',$order->id)->whereBetween('status','>=',0)->find();
|
||||||
|
|
||||||
if ($params['abnormal_id'] == 2 || $params['abnormal_id'] == 3) {
|
if ($params['abnormal_id'] == 2 || $params['abnormal_id'] == 3) {
|
||||||
|
|
||||||
$order->status = \app\admin\model\Order::STATUS_CANCEL;
|
$order->status = \app\admin\model\Order::STATUS_CANCEL;
|
||||||
$order->save();
|
$order->save();
|
||||||
if (!empty($order->dispatch->id)) {
|
|
||||||
|
if (!empty($orderDispatch)) {
|
||||||
$orderLogic = new OrderLogic();
|
$orderLogic = new OrderLogic();
|
||||||
$orderLogic->cancelOrderDispatch($order->dispatch, $this->auth, '订单被取消', false);
|
$orderLogic->cancelOrderDispatch($orderDispatch, $this->auth, '订单被取消', false);
|
||||||
//日志
|
//日志
|
||||||
$hookparams['order'] = $order;
|
$hookparams['order'] = $order;
|
||||||
$hookparams['role'] = 1;
|
$hookparams['role'] = 1;
|
||||||
|
|
@ -647,9 +649,9 @@ class Order extends Backend
|
||||||
|
|
||||||
$order->status = \app\admin\model\Order::STATUS_DISPATCHING;
|
$order->status = \app\admin\model\Order::STATUS_DISPATCHING;
|
||||||
$order->save();
|
$order->save();
|
||||||
if (!empty($order->dispatch->id)) {
|
if (!empty($orderDispatch)) {
|
||||||
$OrderLogic = new OrderLogic();
|
$OrderLogic = new OrderLogic();
|
||||||
$OrderLogic->noWorkerCanGetIt($order->dispatch, '系统取消' . $abnormal_title);
|
$OrderLogic->noWorkerCanGetIt($orderDispatch, '系统取消' . $abnormal_title);
|
||||||
AutoDispatchLogic::autoDispatch($order);
|
AutoDispatchLogic::autoDispatch($order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -672,7 +674,6 @@ class Order extends Backend
|
||||||
$result = \model('order_abnormal')->insert($insert);
|
$result = \model('order_abnormal')->insert($insert);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException|PDOException|Exception $e) {
|
} catch (ValidateException|PDOException|Exception $e) {
|
||||||
throw $e;
|
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user