diff --git a/app/staff/controller/Index.php b/app/api/controller/Index.php similarity index 50% rename from app/staff/controller/Index.php rename to app/api/controller/Index.php index 1630b12..0e38b1a 100644 --- a/app/staff/controller/Index.php +++ b/app/api/controller/Index.php @@ -1,12 +1,12 @@ type) { - 'admin' => null, + 'client' => null, 'staff' => $query->where(fn($q) => $q ->where('status', Tickets::STATUS_UNASSIGNED) ->where('user_id', $scope->staffId)), @@ -141,6 +141,8 @@ class TicketService throw new \Exception('工单不存在'); } + + // 提取 $allowFields 允许修改的字段 $updateData = []; foreach ($allowFields as $field) { diff --git a/app/index/controller/Ticket.php b/app/index/controller/Ticket.php index 7f7ea61..ab4940b 100644 --- a/app/index/controller/Ticket.php +++ b/app/index/controller/Ticket.php @@ -15,10 +15,13 @@ class Ticket extends BaseController { $isUser = Session::get('user_info.role') === 'user'; // 获取当前登录ID - $data = $this->request->post(); + $post = $this->request->post(); - $allowFields = ['datanum', 'progress', 'status', 'remark', 'lock_time', 'user_id']; + $data = [ + 'datanum' => $post['datanum'] + ] + try { $result = $ticketService->updateTicket($id, $data, $allowFields, $isUser, false); return $this->success('更新成功', $result); diff --git a/app/client/controller/Index.php b/app/index/controller/client/Index.php similarity index 100% rename from app/client/controller/Index.php rename to app/index/controller/client/Index.php diff --git a/app/staff/controller/Ticket.php b/app/index/controller/staff/Ticket.php similarity index 100% rename from app/staff/controller/Ticket.php rename to app/index/controller/staff/Ticket.php diff --git a/app/staff/common.php b/app/staff/common.php deleted file mode 100644 index 1243615..0000000 --- a/app/staff/common.php +++ /dev/null @@ -1,2 +0,0 @@ -