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); }