['name', 'is_show'], ]; } /** * @notes 获取首页导航列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author admin * @date 2024/12/27 20:14 */ public function lists(): array { return Cate::where($this->searchWhere) ->field(['id', 'pid', 'name', 'paths', 'sort', 'is_show']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取首页导航数量 * @return int * @author admin * @date 2024/12/27 20:14 */ public function count(): int { return Cate::where($this->searchWhere)->count(); } }