Example #1
0
 /**
  * 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;
 }
Example #2
0
 public function getGeoTbl()
 {
     return $this->hasOne(DraftGeo::className(), ['GEO_ID' => 'GEO_ID']);
 }
 public function ary_subgeo($id)
 {
     $geo_id = DraftGeo::find()->where(['GEO_ID' => $id])->one();
     return $geo_id;
 }