/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = RequestDic::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(['req_id' => $this->req_id, 'request_status' => $this->request_status, 'req_type_id' => $this->req_type_id, 'assg_to' => $this->assg_to, 'req_by' => $this->req_by, 'quantity' => $this->quantity]); $query->andFilterWhere(['like', 'date_log', $this->date_log])->andFilterWhere(['like', 'date_done', $this->date_done])->andFilterWhere(['like', 'detail_request', $this->detail_request])->andFilterWhere(['like', 'date_due', $this->date_due])->andFilterWhere(['like', 'special_request', $this->special_request])->andFilterWhere(['like', 'other', $this->other]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getRequestDics0() { return $this->hasMany(RequestDic::className(), ['req_by' => 'staff_id']); }
/** * Finds the RequestDic model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return RequestDic the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = RequestDic::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getRequestDics() { return $this->hasMany(RequestDic::className(), ['req_type_id' => 'type_id']); }