diff --git a/app/adminapi/lists/material/MaterialClassifyLists.php b/app/adminapi/lists/material/MaterialClassifyLists.php index 9702fe9a7..8509041e4 100644 --- a/app/adminapi/lists/material/MaterialClassifyLists.php +++ b/app/adminapi/lists/material/MaterialClassifyLists.php @@ -11,68 +11,68 @@ // +---------------------------------------------------------------------- // | author: likeadminTeam // +---------------------------------------------------------------------- - -namespace app\adminapi\lists\material; - - -use app\adminapi\lists\BaseAdminDataLists; -use app\common\model\material\MaterialClassify; -use app\common\lists\ListsSearchInterface; - - -/** - * 材料分类列表 - * Class MaterialClassifyLists - * @package app\adminapi\listsmaterial - */ -class MaterialClassifyLists extends BaseAdminDataLists implements ListsSearchInterface -{ - - - /** - * @notes 设置搜索条件 - * @return \string[][] - * @author likeadmin - * @date 2024/01/04 09:47 - */ - public function setSearch(): array - { - return [ - '%like%' => ['name'], - ]; - } - - - /** - * @notes 获取材料分类列表 - * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - * @author likeadmin - * @date 2024/01/04 09:47 - */ - public function lists(): array - { - $data = MaterialClassify::where($this->searchWhere) - ->field(['id', 'pid', 'name']) - ->limit($this->limitOffset, $this->limitLength) - ->order(['id' => 'asc']) - ->select() - ->toArray(); - return buildTree($data,'pid'); - } - - - /** - * @notes 获取材料分类数量 - * @return int - * @author likeadmin - * @date 2024/01/04 09:47 - */ - public function count(): int - { - return MaterialClassify::where($this->searchWhere)->count(); - } - -} \ No newline at end of file + + namespace app\adminapi\lists\material; + + + use app\adminapi\lists\BaseAdminDataLists; + use app\common\lists\ListsSearchInterface; + use app\common\model\material\MaterialClassify; + + + /** + * 材料分类列表 + * Class MaterialClassifyLists + * @package app\adminapi\listsmaterial + */ + class MaterialClassifyLists extends BaseAdminDataLists implements ListsSearchInterface + { + + + /** + * @notes 设置搜索条件 + * @return \string[][] + * @author likeadmin + * @date 2024/01/04 09:47 + */ + public function setSearch(): array + { + return [ + '%like%' => ['name'], + ]; + } + + + /** + * @notes 获取材料分类列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/01/04 09:47 + */ + public function lists(): array + { + $data = MaterialClassify::where($this->searchWhere) + ->field(['id', 'pid', 'name']) +// ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'asc']) + ->select() + ->toArray(); + return buildTree($data, 'pid'); + } + + + /** + * @notes 获取材料分类数量 + * @return int + * @author likeadmin + * @date 2024/01/04 09:47 + */ + public function count(): int + { + return MaterialClassify::where($this->searchWhere)->count(); + } + + } \ No newline at end of file