/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = DraftGeo::find(); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['GEO_ID' => $this->GEO_ID, 'CUST_MAX_NORMAL' => $this->CUST_MAX_NORMAL, 'CUST_MAX_LAYER' => $this->CUST_MAX_LAYER, 'STATUS' => $this->STATUS, 'CREATE_AT' => $this->CREATE_AT, 'UPDATE_AT' => $this->UPDATE_AT]); $query->andFilterWhere(['like', 'GEO_NM', $this->GEO_NM])->andFilterWhere(['like', 'GEO_DCRIP', $this->GEO_DCRIP])->andFilterWhere(['like', 'START_LAT', $this->START_LAT])->andFilterWhere(['like', 'START_LONG', $this->START_LONG])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]); return $dataProvider; }
public function getGeoTbl() { return $this->hasOne(DraftGeo::className(), ['GEO_ID' => 'GEO']); }
public function aryData_Geo() { return ArrayHelper::map(DraftGeo::find()->Where("GEO_ID<>1")->all(), 'GEO_ID', 'GEO_NM'); }
public function ary_subgeo($id) { $geo_id = DraftGeo::find()->where(['GEO_ID' => $id])->one(); return $geo_id; }
/** * Finds the DraftGeo model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return DraftGeo the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = DraftGeo::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function actionCreateGeo() { $model = new DraftGeo(); if ($model->load(Yii::$app->request->post())) { $model->save(); return $this->redirect(['esm-index-geo']); } else { return $this->renderAjax('form_create_geo', ['model' => $model]); } }