diff --git a/application/admin/behavior/OrderLog.php b/application/admin/behavior/OrderLog.php index 8b9f224..0aea59d 100644 --- a/application/admin/behavior/OrderLog.php +++ b/application/admin/behavior/OrderLog.php @@ -20,7 +20,7 @@ class OrderLog $remark = $response['remark'] ?? ''; //备注 - if($role == 1 && !empty($auth->id)){ + if($role == 1 && !empty($auth)){ $groups = $auth->getGroups($auth->id); $groupName = ''; if(!empty($groups)){ diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index e521b5b..8dda2ee 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -266,6 +266,14 @@ class Order extends Backend $params['update_time'] = date('Y-m-d H:i:s'); $result = $this->model->allowField(true)->save($params); + $auth = clone $this->auth; + //日志 + $hookparams['order'] = \app\admin\model\Order::get($this->model->id); + $hookparams['role'] = 1; + $hookparams['auth'] = $auth; + $hookparams['remark'] = '录入订单'; + Hook::listen('order_change', $hookparams); + if ($params['dispatch_type'] == 2) { AutoDispatchLogic::autoDispatch($this->model, $this->auth); } diff --git a/application/admin/controller/orders/Dispatch.php b/application/admin/controller/orders/Dispatch.php index ba7697f..cbd3bd6 100644 --- a/application/admin/controller/orders/Dispatch.php +++ b/application/admin/controller/orders/Dispatch.php @@ -163,14 +163,16 @@ class Dispatch extends Backend $order->worker_id = $worker->id; $order->save(); + $auth = clone $this->auth; //order log $hookparams['order'] = $order; $hookparams['role'] = 1; - $hookparams['auth'] = $this->auth; + $hookparams['auth'] = $auth; $hookparams['remark'] = '手动完成派单'; Hook::listen('order_change', $hookparams); $dispatch = $this->model->get($this->model->id); + $groups = $this->auth->getGroups($this->auth->id); $groupName = ''; if(!empty($groups)){ diff --git a/application/admin/view/orders/dispatchlog/index.html b/application/admin/view/orders/dispatchlog/index.html index 7c3b01e..9a52a61 100644 --- a/application/admin/view/orders/dispatchlog/index.html +++ b/application/admin/view/orders/dispatchlog/index.html @@ -102,8 +102,6 @@ const logs = {$logs}; // 后端传入的数据,格式保持和你的一致 function getRoleLabel(role) { - if (role === 1) return '管理员:'; - if (role === 2) return '师傅:'; return ''; }