public function actionInterview() { $query = Interview::find()->where('reply is null')->orWhere("reply=''"); $pagination_noreply = new Pagination(['defaultPageSize' => 20, 'totalCount' => $query->count()]); $query->orderBy('updated_at desc')->offset($pagination_noreply->offset)->limit($pagination_noreply->limit); $query2 = Interview::find()->where('reply is not null')->andWhere("reply != ''"); $pagination_replied = new Pagination(['defaultPageSize' => 20, 'totalCount' => $query2->count()]); $query2->orderBy('updated_at desc')->offset($pagination_replied->offset)->limit($pagination_replied->limit); return $this->render('interview', ['noreply_interviews' => $query->all(), 'noreply_page' => $pagination_noreply, 'replied_interviews' => $query2->all(), 'replied_page' => $pagination_replied]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Interview::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'start_time' => $this->start_time, 'stop_time' => $this->stop_time, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'unit', $this->unit])->andFilterWhere(['like', 'place', $this->place])->andFilterWhere(['like', 'contact', $this->contact])->andFilterWhere(['like', 'contact_method', $this->contact_method])->andFilterWhere(['like', 'summary', $this->summary])->andFilterWhere(['like', 'reply', $this->reply])->andFilterWhere(['like', 'service', $this->service])->andFilterWhere(['like', 'others', $this->others]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Interview::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['interview_id' => $this->interview_id, 'user_id' => $this->user_id, 'interview_date' => $this->interview_date, 'interview_time' => $this->interview_time, 'create_time' => $this->create_time, 'export_time' => $this->export_time, 'notified' => $this->notified, 'status' => $this->status]); $query->andFilterWhere(['like', 'interview_city', $this->interview_city]); return $dataProvider; }