27 lines
563 B
PHP
27 lines
563 B
PHP
<?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']);
|
|
}
|
|
|
|
} |