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); + } +}