public function actionIndex($fraid)
 {
     $query = Fragment2Data::find()->where(['fragment_id' => $fraid]);
     $locals = LuLu::getPagedRows($query, ['order' => 'id desc']);
     $locals['currentFragment'] = Fragment::findOne($fraid);
     return $this->render('index', $locals);
 }
예제 #2
0
 public function actionIndex($catid = 0)
 {
     $view = LuLu::getView();
     $category = null;
     $query = Page::find()->where(['status' => 1]);
     if (intval($catid) > 0) {
         $query->andWhere(['category_id' => $catid]);
         $category = PageCategory::findOne($catid);
         if ($category !== null) {
             $view->setTitle(empty($category['seo_title']) ? $category['name'] : $category['seo_title']);
             $view->setMetaTag('keywords', $category['seo_keywords']);
             $view->setMetaTag('description', $category['seo_description']);
             $view->addBreadcrumb('页面', ['page/index']);
             $view->addBreadcrumb($category['name']);
         }
     }
     if ($category == null) {
         $view->setTitle('页面');
         $view->addBreadcrumb('页面');
     }
     $locals = LuLu::getPagedRows($query);
     $locals['catid'] = $catid;
     $locals['currentCategory'] = $category;
     return $this->render('index', $locals);
 }
 public function actionIndex($type)
 {
     $query = FragmentCategory::find()->where(['type' => $type]);
     $locals = LuLu::getPagedRows($query, ['order' => 'id desc']);
     $locals['type'] = $type;
     return $this->render('index', $locals);
 }
예제 #4
0
 public function actionIndex($type, $catid = 0)
 {
     $query = Fragment::find()->where(['type' => $type]);
     if ($catid > 0) {
         $query->andWhere(['category_id' => $catid]);
     }
     $locals = LuLu::getPagedRows($query, ['order' => 'id desc']);
     $locals['type'] = $type;
     return $this->render('index', $locals);
 }
예제 #5
0
 public function actionIndex($catid, $pid = 0)
 {
     $query = Dict::find()->where(['parent_id' => $pid, 'category_id' => $catid]);
     $locals = LuLu::getPagedRows($query, ['order' => 'sort_num asc']);
     $locals['pid'] = $pid;
     $locals['parent'] = $this->findModel($pid);
     $locals['parents'] = Dict::getParents($pid);
     $locals['category'] = DictCategory::findOne($catid);
     return $this->render('index', $locals);
 }
예제 #6
0
 public function run($chnid)
 {
     $currentChannel = $this->getChannel($chnid);
     $query = DataSource::buildContentQuery($currentChannel['table'], [], 'channel_id=' . $chnid);
     $locals = LuLu::getPagedRows($query);
     $locals['chnid'] = $chnid;
     $locals['currentChannel'] = $currentChannel;
     $locals['currentModel'] = $currentChannel['table'];
     $view = LuLu::getView();
     $view->setTitle(empty($currentChannel['seo_title']) ? $currentChannel['name'] : $currentChannel['seo_title']);
     $view->setMetaTag('keywords', $currentChannel['seo_keywords']);
     $view->setMetaTag('description', $currentChannel['seo_description']);
     $listTpl = $this->getTpl($chnid, 'list_tpl');
     return $this->render($listTpl, $locals);
 }
예제 #7
0
 public function run($chnid = 0)
 {
     if ($chnid === 0) {
         $currentChannel = new Channel();
         $rows = [];
     } else {
         $currentChannel = Channel::findOne($chnid);
         $rows = DataSource::getContentByChannel($chnid);
     }
     $query = new Query();
     $query->select('*')->from($currentChannel['table'])->where(['channel_id' => $chnid]);
     $locals = LuLu::getPagedRows($query, ['order' => 'publish_time desc']);
     //$locals['rows']=$rows;
     $locals['chnid'] = $chnid;
     $locals['channelArrayTree'] = Channel::getChannelArrayTree();
     $locals['currentChannel'] = $currentChannel;
     $tplName = $this->getTpl($chnid, 'index');
     return $this->render($tplName, $locals);
 }
 public function actionIndex($fraid)
 {
     $query = Fragment3Data::find()->where(['fragment_id' => $fraid]);
     $locals = LuLu::getPagedRows($query, ['order' => 'id desc']);
     $ret = [];
     foreach ($locals['rows'] as $row) {
         $id = $row['id'];
         $ret[$id] = ['id' => $row['id'], 'channel_id' => $row['channel_id'], 'content_id' => $row['content_id'], 'sort_num' => $row['sort_num']];
         $item = DataSource::getContentByChannel($row['channel_id'], ['where' => 'id=' . $row['content_id']]);
         if ($item == null || empty($item)) {
             $ret[$id]['title'] = '没有此数据';
         } else {
             $ret[$id]['title'] = $item[0]['title'];
         }
     }
     $locals['rows'] = $ret;
     $locals['currentFragment'] = Fragment::findOne($fraid);
     return $this->render('index', $locals);
 }
예제 #9
0
 public function actionIndex()
 {
     $query = Variable::find();
     $locals = LuLu::getPagedRows($query);
     return $this->render('index', $locals);
 }
예제 #10
0
 public function actionIndex()
 {
     $query = PageCategory::find();
     $locals = LuLu::getPagedRows($query, ['order' => 'id desc']);
     return $this->render('index', $locals);
 }
예제 #11
0
 public function actionIndex()
 {
     $query = ContentFlag::find();
     $locals = LuLu::getPagedRows($query, ['order' => 'value asc']);
     return $this->render('index', $locals);
 }