['pid', 'type', 'name', 'icon', 'sort', 'paths', 'params', 'is_show', 'is_disable'], ]; } /** * @notes 获取用户菜单列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/08/23 09:38 */ public function lists(): array { $lists = UserMenu::where($this->searchWhere) ->field(['id', 'pid', 'type', 'name', 'icon', 'sort', 'paths', 'params', 'is_show', 'is_disable','notes']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); return linear_to_tree($lists, 'children'); } /** * @notes 获取用户菜单数量 * @return int * @author likeadmin * @date 2023/08/23 09:38 */ public function count(): int { return UserMenu::where($this->searchWhere)->count(); } }