Files
fdesk/app/common/service/SysDictItemService.php
T
mzl92 b3d8029e6d Merge branch 'develop_bm' into feature/mzl_dev
# Conflicts:
#	app/controller/IndexController.php
#	config/route.php
2025-09-01 14:06:34 +08:00

42 lines
1.2 KiB
PHP

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