示例#1
0
文件: Module.php 项目: ahb360/cms
 public function feedMenuModule()
 {
     $list = [];
     $pages = Page::find()->andWhere('isActive = 1')->orderBy(['root' => SORT_DESC, 'lft' => SORT_ASC])->all();
     foreach ($pages as $page) {
         $list[] = ['label' => $page->nestedTitle, 'route' => 'page/front/view', 'params' => ['id' => $page->id]];
     }
     return $list;
 }
示例#2
0
文件: PageSearch.php 项目: ahb360/cms
 public function search($params)
 {
     $query = Page::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['root' => SORT_DESC, 'lft' => SORT_ASC]]]);
     $this->load($params);
     if (!$this->validate()) {
         $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'isActive' => $this->isActive]);
     $query->andFilterWhere(['like', 'title', $this->title]);
     $query->andFilterWhere(['like', 'language', $this->language]);
     return $dataProvider;
 }