예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Regulasi::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, 'TGL' => $this->TGL, 'SET_ACTIVE' => $this->SET_ACTIVE, 'GF_ID' => $this->GF_ID, 'SEQ_ID' => $this->SEQ_ID, 'UPDATED_TIME' => $this->UPDATED_TIME, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'RGTR_TITEL', $this->RGTR_TITEL])->andFilterWhere(['like', 'RGTR_ISI', $this->RGTR_ISI])->andFilterWhere(['like', 'RGTR_DCRPT', $this->RGTR_DCRPT])->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;
 }
예제 #2
0
 /**
  * Deletes an existing Regulasi model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param string $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     //        $this->findModel($id)->delete();
     $data = \lukisongroup\hrd\models\Regulasi::find()->where(['ID' => $id])->one();
     $data->STATUS = 3;
     $data->save();
     return $this->redirect(['index']);
 }