예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Issueproject::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, 'PARENT' => $this->PARENT, 'PRIORITY' => $this->PRIORITY, 'CLOSE_DATETIME' => $this->CLOSE_DATETIME, 'USER_CREATED' => $this->USER_CREATED, 'STATUS' => $this->STATUS, 'OPEN_DATETIME' => $this->OPEN_DATETIME]);
     $query->andFilterWhere(['like', 'ISSUE_NM', $this->ISSUE_NM])->andFilterWhere(['like', 'ISSUE_DESC', $this->ISSUE_DESC])->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])->andFilterWhere(['like', 'DEP_ID', $this->DEP_ID]);
     return $dataProvider;
 }
예제 #2
0
 /**
  * Finds the Issueproject model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Issueproject the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Issueproject::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }