From f9adabf5d83d906f5d7e1a7148c60566a158d573 Mon Sep 17 00:00:00 2001 From: GiveMePast <1248298477@qq.com> Date: Wed, 26 Aug 2026 17:50:41 +0800 Subject: [PATCH] wip --- app/{staff => api}/controller/Index.php | 4 ++-- app/client/common.php | 2 -- app/client/event.php | 5 ----- app/client/middleware.php | 5 ----- app/{ => common}/middleware/CheckLogin.php | 0 app/common/service/TicketService.php | 4 +++- app/index/controller/Ticket.php | 7 +++++-- .../controller => index/controller/client}/Index.php | 0 .../controller => index/controller/staff}/Ticket.php | 0 app/staff/common.php | 2 -- app/staff/event.php | 5 ----- app/staff/middleware.php | 5 ----- {app/command => command}/SyncData.php | 0 13 files changed, 10 insertions(+), 29 deletions(-) rename app/{staff => api}/controller/Index.php (50%) delete mode 100644 app/client/common.php delete mode 100644 app/client/event.php delete mode 100644 app/client/middleware.php rename app/{ => common}/middleware/CheckLogin.php (100%) rename app/{client/controller => index/controller/client}/Index.php (100%) rename app/{staff/controller => index/controller/staff}/Ticket.php (100%) delete mode 100644 app/staff/common.php delete mode 100644 app/staff/event.php delete mode 100644 app/staff/middleware.php rename {app/command => command}/SyncData.php (100%) 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 @@ -