From 37823cc98aa9d8c75d9fed5754cccf3976165507 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 19 Mar 2025 11:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E7=B1=BB=E5=9E=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E7=8A=B6=E6=80=81=E6=96=87=E5=AD=97=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controller/Ticket.php | 10 ++++---- .../src/model/TicketTicket.php | 24 ++++--------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/plugs/think-plugs-ticket/src/controller/Ticket.php b/plugs/think-plugs-ticket/src/controller/Ticket.php index 2d695b6..e567189 100644 --- a/plugs/think-plugs-ticket/src/controller/Ticket.php +++ b/plugs/think-plugs-ticket/src/controller/Ticket.php @@ -41,7 +41,7 @@ class Ticket extends Controller $query->like(['title|content|contact_name|ticket_address|contact_phone#keyword']) ->dateBetween(['create_at']) ->equal(['status', 'type_id']); - $query->append(['imgs_arr', 'source_type_name', 'status_text', 'type_name', 'last_reply'])->with('approval'); + $query->append(['imgs_arr', 'source_type_name', 'type_name', 'last_reply'])->with('approval'); }); } @@ -80,7 +80,7 @@ class Ticket extends Controller { $this->title = '工单详情'; ['id' => $id] = $this->_vali(['id.require' => '请指定工单ID!']); - $this->vo = TicketTicket::mk()->with(['user', 'type', 'reply'])->append(['imgs_arr', 'status_text', 'type_name', 'last_reply'])->find($id); + $this->vo = TicketTicket::mk()->with(['user', 'type', 'reply'])->append(['imgs_arr', 'type_name', 'last_reply'])->find($id); $process = ApprovalProcess::where('type', '=', 'GDSH')->order('id', 'asc')->findOrEmpty(); $instance = ApprovalInstance::query()->with(['steps.approver', 'logs'])->where('process_id', '=', $process->id)->where('oid', '=', $id)->findOrEmpty(); $this->instance = $instance; @@ -130,7 +130,7 @@ class Ticket extends Controller 'ticket_id.require'=>'请指定工单ID!', 'id.require'=>'请指定回复ID!' ]); - $this->vo = TicketTicket::mk()->with(['user', 'type'])->append(['imgs_arr', 'status_text', 'type_name'])->find($ticket_id); + $this->vo = TicketTicket::mk()->with(['user', 'type'])->append(['imgs_arr', 'type_name'])->find($ticket_id); TicketReply::mForm('reply'); } @@ -198,7 +198,7 @@ class Ticket extends Controller ] = $this->_vali([ 'id.require'=>'请指定回复ID!' ]); - $this->vo = TicketTicket::query()->with(['user', 'type'])->append(['imgs_arr', 'status_text', 'type_name'])->find($id); + $this->vo = TicketTicket::query()->with(['user', 'type'])->append(['imgs_arr', 'type_name'])->find($id); $process = ApprovalProcess::where('type', '=', 'GDSH')->order('id', 'asc')->findOrEmpty(); if ($process->isEmpty()) { $this->error('未找到可用的审核流程'); @@ -368,7 +368,7 @@ class Ticket extends Controller ->dateBetween(['create_at']) ->equal(['status', 'type_id']); $query->whereIn("id", ApprovalStep::query()->where(['approver_id' => $this->user_id, 'status' => 0, 'approver_type' => 1, 'instance.status' => 0])->field("oid")->select()) - ->append(['imgs_arr', 'source_type_name', 'status_text', 'type_name', 'last_reply'])->with('approval'); + ->append(['imgs_arr', 'source_type_name', 'type_name', 'last_reply'])->with('approval'); }); } diff --git a/plugs/think-plugs-ticket/src/model/TicketTicket.php b/plugs/think-plugs-ticket/src/model/TicketTicket.php index bbda17b..1f8eb16 100644 --- a/plugs/think-plugs-ticket/src/model/TicketTicket.php +++ b/plugs/think-plugs-ticket/src/model/TicketTicket.php @@ -4,6 +4,7 @@ namespace plugin\ticket\model; use plugin\inspection\model\InspectionStaff; use think\admin\Model; +use think\admin\model\SystemUser; class TicketTicket extends Model { @@ -51,9 +52,9 @@ class TicketTicket extends Model public function getSourceTypeList() { return [ - 0 => '其他', + 0 => '管理人员创建', 1 => '用户随手拍', - 2 => '工单', + 2 => '维修人员上报', ]; } @@ -67,14 +68,6 @@ class TicketTicket extends Model } } - public function getStatusTextAttr($value, $data) - { - if (!empty($this->getStatusList()[$data['status']])) { - return $this->getStatusList()[$data['status']]; - } else { - return '未知'; - } - } public function getDeptNameAttr($value, $data) { @@ -86,15 +79,6 @@ class TicketTicket extends Model } } - private function getStatusList() - { - return [ - -1 => '待审核', - 0 => '待处理', - 1 => '已作处理', - ]; - } - public function scopeAvail($query) { return $query->where('status', '>=', '0'); @@ -112,7 +96,7 @@ class TicketTicket extends Model public function fzUser() { - return $this->belongsTo(InspectionStaff::class, 'fz_user_id'); + return $this->belongsTo(SystemUser::class, 'fz_user_id'); } public function verify()