/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = MHelpdoc::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['helpdoc_id' => $this->helpdoc_id, 'sort' => $this->sort, 'visual' => $this->visual]); $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'content', $this->content])->andFilterWhere(['like', 'relate', $this->relate]); return $dataProvider; }
public function actionHelpdoclist() { $this->layout = false; $gh_id = U::getSessionParam('gh_id'); $openid = U::getSessionParam('openid'); $helpdocs = MHelpdoc::find()->where(['visual' => 1])->orderBy(['sort' => SORT_DESC])->all(); return $this->render('helpdoclist', ['gh_id' => $gh_id, 'openid' => $openid, 'helpdocs' => $helpdocs]); }