['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 { return UserMenu::where($this->searchWhere) ->field(['id', 'pid', 'type', 'name', 'icon', 'sort', 'paths', 'params', 'is_show', 'is_disable']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取用户菜单数量 * @return int * @author likeadmin * @date 2023/08/23 09:38 */ public function count(): int { return UserMenu::where($this->searchWhere)->count(); } }