Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Jobdesc::find()->where('STATUS <>3');
     $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, 'JOBGRADE_STS' => $this->JOBGRADE_STS, 'SORT' => $this->SORT, 'GF_ID' => $this->GF_ID, 'SEQ_ID' => $this->SEQ_ID, 'UPDATED_TIME' => $this->UPDATED_TIME, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'JOBSDESK_TITLE', $this->JOBSDESK_TITLE])->andFilterWhere(['like', 'JOBGRADE_NM', $this->JOBGRADE_NM])->andFilterWhere(['like', 'JOBGRADE_DCRP', $this->JOBGRADE_DCRP])->andFilterWhere(['like', 'JOBSDESK_IMG', $this->JOBSDESK_IMG])->andFilterWhere(['like', 'JOBSDESK_PATH', $this->JOBSDESK_PATH])->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])->andFilterWhere(['like', 'DEP_ID', $this->DEP_ID])->andFilterWhere(['like', 'DEP_SUB_ID', $this->DEP_SUB_ID])->andFilterWhere(['like', 'JOBGRADE_ID', $this->JOBGRADE_ID])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]);
     return $dataProvider;
 }
Exemplo n.º 2
0
 /**
  * Deletes an existing Jobdesc model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $data = \lukisongroup\hrd\models\Jobdesc::find()->where(['ID' => $id])->one();
     $data->STATUS = 3;
     $data->UPDATED_BY = Yii::$app->user->identity->username;
     $data->save();
     return $this->redirect(['index']);
 }