diff --git a/plugs/think-plugs-inspection/src/controller/api/auth/Ticket.php b/plugs/think-plugs-inspection/src/controller/api/auth/Ticket.php index 37c8b6d..0e5a0d7 100644 --- a/plugs/think-plugs-inspection/src/controller/api/auth/Ticket.php +++ b/plugs/think-plugs-inspection/src/controller/api/auth/Ticket.php @@ -63,11 +63,15 @@ class Ticket extends Auth public function list() { + $query = TicketTicket::query()->scope(['avail'])->where(['fz_user_id'=>$this->staff->id]); $status = $this->request->get('status', null); - $query = TicketTicket::query(); // ->where(['fz_user_id'=>$this->staff->id]) if ($status) { $query->where('staff_status', $status); } + $keyword = $this->request->get('keyword', null); + if ($keyword) { + $query->where('title', 'like', "%{$keyword}%"); + } $pageData = $query->paginate(); $this->success('获取工单列表', $pageData); } diff --git a/plugs/think-plugs-inspection/src/model/InspectionStaffToken.php b/plugs/think-plugs-inspection/src/model/InspectionStaffToken.php index 1ecbd3d..a0c2505 100644 --- a/plugs/think-plugs-inspection/src/model/InspectionStaffToken.php +++ b/plugs/think-plugs-inspection/src/model/InspectionStaffToken.php @@ -8,6 +8,6 @@ class InspectionStaffToken extends Model { public function staff() { - return $this->belongsTo(InspectionStaff::class, 'staff_id'); + return $this->belongsTo(InspectionStaff::class, 'staff_id', "id"); } } \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/model/TicketTicket.php b/plugs/think-plugs-ticket/src/model/TicketTicket.php index b7251f2..ce24030 100644 --- a/plugs/think-plugs-ticket/src/model/TicketTicket.php +++ b/plugs/think-plugs-ticket/src/model/TicketTicket.php @@ -8,7 +8,6 @@ use think\admin\Model; class TicketTicket extends Model { protected $append = ['status_text', 'type_name', 'dept_name', 'imgs_arr']; - protected $globalScope = ['unConf']; protected $table = 'ticket_ticket'; public function type() { @@ -90,7 +89,7 @@ class TicketTicket extends Model private function getStatusList() { return [ - -1 => '已关闭', + -1 => '待审核', 0 => '待处理', 1 => '已作处理', ];