Exemplo n.º 1
0
 /**
  * 获取前台控制菜单列表
  */
 public function menus()
 {
     if ($menus = MenusModel::all()) {
         return Tools::getChild($menus, $pid = 0);
     }
     return [];
 }
Exemplo n.º 2
0
 /**
  *查询方法
  */
 public function query($type, $isshow)
 {
     if ($type && $isshow) {
         $datas = MenusModel::where('type', $type)->where('isshow', $isshow)->orderBy('id', 'desc')->orderBy('sort', 'desc')->paginate($this->limit);
     } elseif (!$type && $isshow) {
         $datas = MenusModel::where('isshow', $isshow)->orderBy('id', 'desc')->orderBy('sort', 'desc')->paginate($this->limit);
     } elseif ($type && !$isshow) {
         $datas = MenusModel::where('type', $type)->orderBy('id', 'desc')->orderBy('sort', 'desc')->paginate($this->limit);
     } elseif (!$type && !$isshow) {
         $datas = MenusModel::orderBy('id', 'desc')->orderBy('sort', 'desc')->paginate($this->limit);
     }
     $datas->limit = $this->limit;
     return $datas;
 }
Exemplo n.º 3
0
 public function getMenus()
 {
     return MenusModel::orderBy('type', 'desc')->get();
 }
Exemplo n.º 4
0
 public static function getMemberMenus()
 {
     return Tools::getChild(MenusModel::MemberMenus(), $pid = 0);
 }
 public static function getCompanyMenus()
 {
     return Tools::getChild(MenusModel::CompanyMenus(), $pid = 0);
 }
Exemplo n.º 6
0
 /**
  * 得到公司后台左侧菜单 type==3
  */
 public static function CompanyMenus()
 {
     return MenusModel::where(['type' => 3, 'isshow' => 2])->orderBy('sort2', 'desc')->get();
 }