public function search($params)
 {
     $query = CustomerDetailModel::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id_customer' => $this->id_customer, 'id_distric' => $this->id_distric, 'id_kab' => $this->id_kab, 'id_kec' => $this->id_kec, 'id_kel' => $this->id_kel, 'create_by' => $this->create_by, 'update_by' => $this->update_by]);
     $query->andFilterWhere(['like', 'addr1', $this->addr1])->andFilterWhere(['like', 'addr2', $this->addr2])->andFilterWhere(['like', 'latitude', $this->latitude])->andFilterWhere(['like', 'longtitude', $this->longtitude])->andFilterWhere(['like', 'create_date', $this->create_date])->andFilterWhere(['like', 'update_date', $this->update_date]);
     return $dataProvider;
 }
 /**
  * Finds the CustomerDetail model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return CustomerDetail the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = CustomerDetail::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCustomerDetail()
 {
     return $this->hasOne(CustomerDetail::className(), ['id_customer' => 'id_customer']);
 }