From 84343e17e2efce0100dcb291856d5825ad840bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=9F=E5=B7=9D=E4=B8=9C?= Date: Sun, 20 Apr 2025 09:37:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=82=E5=B8=B8=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/model/Abnormal.php | 18 ++++++++++++++++++ application/services/AbnormalService.php | 18 ++++++++++++++++++ application/services/BaseService.php | 17 +++++++++++++++++ application/worker/controller/Abnormal.php | 16 ++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 application/common/model/Abnormal.php create mode 100644 application/services/AbnormalService.php create mode 100644 application/worker/controller/Abnormal.php diff --git a/application/common/model/Abnormal.php b/application/common/model/Abnormal.php new file mode 100644 index 0000000..af459df --- /dev/null +++ b/application/common/model/Abnormal.php @@ -0,0 +1,18 @@ +getAbnormalModel() + ->where('type', 1) + ->order('sort', 'desc') + ->field([ + 'id', + 'title', + ]) + ->select(); + } +} diff --git a/application/services/BaseService.php b/application/services/BaseService.php index 7e8801f..1752016 100644 --- a/application/services/BaseService.php +++ b/application/services/BaseService.php @@ -11,6 +11,7 @@ use think\Log; use app\common\model\WorkerVendor; use app\common\model\OrderDispatch; use app\common\model\Order; +use app\common\model\Abnormal; //{%add use model%} class BaseService @@ -110,5 +111,21 @@ class BaseService return app(OrderLogic::class); } + /** + * @return AbnormalService + */ + protected function getAbnormalService() + { + return app(AbnormalService::class); + } + + /** + * @return Abnormal + */ + protected function getAbnormalModel() + { + return app(Abnormal::class, true); + } + //{%add function code%} } diff --git a/application/worker/controller/Abnormal.php b/application/worker/controller/Abnormal.php new file mode 100644 index 0000000..3409469 --- /dev/null +++ b/application/worker/controller/Abnormal.php @@ -0,0 +1,16 @@ +getAbnormalService()->findAll(); + $this->success('操作成功', $res); + } +}