['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(); } }