This commit is contained in:
xman 2025-06-05 21:47:43 +08:00
parent 8a396cbccc
commit 6ae3d1e163

View File

@ -27,9 +27,9 @@ class AutoDispatchLogic
$order->save(); $order->save();
return false; return false;
} }
//$admin = Admin::where('id',$order->admin_id)->find(); $admin = Admin::where('id',100)->find();
$insert = [ $insert = [
'admin_id' => 1, 'admin_id' => $admin->id,
'admin_user' => '系统', 'admin_user' => '系统',
'order_id' => $order->id, 'order_id' => $order->id,
'type' => 2, 'type' => 2,
@ -45,8 +45,8 @@ class AutoDispatchLogic
$res = $orderDispatch->allowField(true)->save($insert); $res = $orderDispatch->allowField(true)->save($insert);
$order->status = \app\admin\model\Order::STATUS_DISPATCHED; $order->status = \app\admin\model\Order::STATUS_DISPATCHED;
$order->dispatch_time = date('Y-m-d H:i:s'); $order->dispatch_time = date('Y-m-d H:i:s');
$order->dispatch_admin_id = 1; $order->dispatch_admin_id = $admin->id;
$order->dispatch_admin_user = '系统'; $order->dispatch_admin_user =$admin->nickname;
$order->worker_id = $worker_id; $order->worker_id = $worker_id;
$order->save(); $order->save();
@ -54,7 +54,7 @@ class AutoDispatchLogic
//日志 //日志
$hookparams['order'] = $order; $hookparams['order'] = $order;
$hookparams['role'] = 1; $hookparams['role'] = 1;
$hookparams['auth'] = $auth; $hookparams['auth'] = $admin;
$hookparams['remark'] = '系统自动完成派单';//. $worker->name.'('.$worker->tel.')'; $hookparams['remark'] = '系统自动完成派单';//. $worker->name.'('.$worker->tel.')';
Hook::listen('order_change', $hookparams); Hook::listen('order_change', $hookparams);