登录
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\admin\validate\SysDictItemValidate;
|
||||
use app\common\logic\SysDictItemLogic;
|
||||
use app\common\logic\SysDictLogic;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\model\SysDictItem;
|
||||
use support\exception\BusinessException;
|
||||
use support\Request;
|
||||
|
||||
class SysDictItemService
|
||||
{
|
||||
|
||||
protected $logic;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->logic = (new SysDictItemLogic());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统list
|
||||
*/
|
||||
public function getList($params)
|
||||
{
|
||||
if (empty($params['dict_id']) && empty($params['dict_code']))
|
||||
throw new BusinessException('未明确要查询的字典组');
|
||||
$where = [];
|
||||
if(isset($params['dict_id']) && $params['dict_id'])
|
||||
$where[] = ['dict_id', '=', $params['dict_id']];
|
||||
if(isset($params['dict_code']) && $params['dict_code']){
|
||||
$dict = (new SysDictLogic)->getDictByCode($params['dict_code']);
|
||||
if (empty($dict['id']))
|
||||
throw new BusinessException('字典组code错误');
|
||||
$where[] = ['dict_id', '=', $dict['id']];
|
||||
}
|
||||
|
||||
return $this->logic->getList($where);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user