This commit is contained in:
xman 2025-06-12 21:51:37 +08:00
parent 70ca003e1b
commit 6050417c47
4 changed files with 12 additions and 4 deletions

View File

@ -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)){

View File

@ -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);
}

View File

@ -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)){

View File

@ -102,8 +102,6 @@
const logs = {$logs}; // 后端传入的数据,格式保持和你的一致
function getRoleLabel(role) {
if (role === 1) return '管理员:';
if (role === 2) return '师傅:';
return '';
}