getStatusList(); $order = $response['order']; //订单对象 $role = $response['role']; //1管理员,2师傅 $auth = $response['auth']??null; //角色对象 $remark = $response['remark'] ?? ''; //备注 if($role == 1 && !empty($auth->id)){ $groups = $auth->getGroups($auth->id); $groupName = ''; if(!empty($groups)){ $groupNames = array_column($groups,'name'); $groupName = implode(',',$groupNames); } $auth->nickname = $groupName.':'. $auth->nickname; } $adminUser = $role==1 ? ($auth->nickname ?? '系统') : $auth->name; $data = [ 'order_id' => $order->id, 'order_status' => $order->status, 'order_status_text' => $statusList[$order->status], 'role' => $role, 'remark' => $remark, 'admin_id' => $auth->id ?? 0, 'admin_user' => $adminUser ]; (new \app\admin\model\OrderLog())->save($data); } }