| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\extra\dao\system;
- use app\extra\basic\Dao;
- use app\model\system\SystemMenu;
- class SystemMenuDao extends Dao
- {
- /**
- * 设置模型
- * @return string
- */
- protected function setModel(): string
- {
- return SystemMenu::class;
- }
- // public function getList(array $where,string $field = '*',int $page = 0, int $limit = 0,string $order='id desc')
- // {
- // return $this->getModel()->where($where)->field($field)->when($page&&$limit,function($query)use($page,$limit){
- // $query->page($page,$limit);
- // })->select();
- // }
- /**
- * 获取权限菜单列表
- * @param array $where
- * @param array|null $field
- * @return array|\crmeb\basic\BaseModel[]|\think\Collection
- * @throws \ReflectionException
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function getMenusRoule(array $where, ?array $field = [])
- {
- if (!$field) {
- $field = ['id', 'title', 'icon', 'pid', 'sort', 'path', 'status'];
- }
- return $this->getModel()->where($where)->field($field)->order('sort DESC,id DESC')->failException(false)->select();
- }
- }
|