feat: 异常原因列表接口
This commit is contained in:
parent
fe91ab5365
commit
84343e17e2
18
application/common/model/Abnormal.php
Normal file
18
application/common/model/Abnormal.php
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
class Abnormal extends Model
|
||||||
|
{
|
||||||
|
protected $visible = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
18
application/services/AbnormalService.php
Normal file
18
application/services/AbnormalService.php
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\services;
|
||||||
|
|
||||||
|
class AbnormalService extends BaseService
|
||||||
|
{
|
||||||
|
public function findAll()
|
||||||
|
{
|
||||||
|
return $this->getAbnormalModel()
|
||||||
|
->where('type', 1)
|
||||||
|
->order('sort', 'desc')
|
||||||
|
->field([
|
||||||
|
'id',
|
||||||
|
'title',
|
||||||
|
])
|
||||||
|
->select();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,6 +11,7 @@ use think\Log;
|
||||||
use app\common\model\WorkerVendor;
|
use app\common\model\WorkerVendor;
|
||||||
use app\common\model\OrderDispatch;
|
use app\common\model\OrderDispatch;
|
||||||
use app\common\model\Order;
|
use app\common\model\Order;
|
||||||
|
use app\common\model\Abnormal;
|
||||||
//{%add use model%}
|
//{%add use model%}
|
||||||
|
|
||||||
class BaseService
|
class BaseService
|
||||||
|
|
@ -110,5 +111,21 @@ class BaseService
|
||||||
return app(OrderLogic::class);
|
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%}
|
//{%add function code%}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
application/worker/controller/Abnormal.php
Normal file
16
application/worker/controller/Abnormal.php
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\worker\controller;
|
||||||
|
|
||||||
|
use app\common\controller\WorkerApi;
|
||||||
|
|
||||||
|
class Abnormal extends WorkerApi
|
||||||
|
{
|
||||||
|
protected $noNeedLogin = [];
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$res = $this->getAbnormalService()->findAll();
|
||||||
|
$this->success('操作成功', $res);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user