/** * Displays a single Park model. * @param integer $id * @return mixed */ public function actionView($id) { $query = Land::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $query->andFilterWhere(['park_id' => $id]); return $this->render('view', ['model' => $this->findModel($id), 'dataProvider' => $dataProvider]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Land::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, 'text_slope' => $this->text_slope, 'text_thick' => $this->text_thick, 'text_ripe' => $this->text_ripe, 'slope_thick' => $this->slope_thick, 'slope_ripe' => $this->slope_ripe, 'thick_ripe' => $this->thick_ripe, 'bobot_text' => $this->bobot_text, 'bobot_slope' => $this->bobot_slope, 'bobot_thick' => $this->bobot_thick, 'bobot_ripe' => $this->bobot_ripe, 'cr' => $this->cr, 'validation' => $this->validation, 'id_user' => $this->id_user, 'date' => $this->date]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Land::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, 'pricipal_id' => $this->pricipal_id, 'park_id' => $this->park_id]); $query->andFilterWhere(['like', 'code', $this->code])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'intro', $this->intro])->andFilterWhere(['like', 'scale', $this->scale])->andFilterWhere(['like', 'phone', $this->phone])->andFilterWhere(['like', 'map', $this->map])->andFilterWhere(['like', 'emial', $this->emial])->andFilterWhere(['like', 'comment', $this->comment]); return $dataProvider; }
/** * Finds the Land model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Land the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Land::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }