下拉接口
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\logic;
|
||||
|
||||
use app\common\traits\crud\CrudLogicTrait;
|
||||
use app\common\model\SysDict;
|
||||
|
||||
class SysDictLogic
|
||||
{
|
||||
use CrudLogicTrait;
|
||||
|
||||
/**
|
||||
* 指定当前要操作的模型
|
||||
*/
|
||||
protected string $modelClass = SysDict::class;
|
||||
|
||||
public function getDictByCode($code)
|
||||
{
|
||||
return SysDict::where('status', 1)->where('code', $code)->orderBy('sort','desc')->first(['id']);
|
||||
}
|
||||
|
||||
public function getList()
|
||||
{
|
||||
return SysDict::where('status', 1)->get(['id', 'dict_name', 'dict_code', 'description']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user