/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = CuentasIp::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, 'user_id' => $this->user_id, 'freunion' => $this->freunion, 'i2010' => $this->i2010, 'i2011' => $this->i2011, 'i2012' => $this->i2012, 'i2013' => $this->i2013, 'i2014' => $this->i2014, 'i2015' => $this->i2015, 'monto_propuesta' => $this->monto_propuesta, 'fcampana' => $this->fcampana]); $query->andFilterWhere(['like', 'status', $this->status])->andFilterWhere(['like', 'cuenta', $this->cuenta])->andFilterWhere(['like', 'categoria', $this->categoria])->andFilterWhere(['like', 'subcuenta', $this->subcuenta])->andFilterWhere(['like', 'campana', $this->campana])->andFilterWhere(['like', 'sector', $this->sector])->andFilterWhere(['like', 'puesto', $this->puesto])->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'tel', $this->tel])->andFilterWhere(['like', 'mail', $this->mail])->andFilterWhere(['like', 'direccion', $this->direccion])->andFilterWhere(['like', 'temporalidad', $this->temporalidad])->andFilterWhere(['like', 'productos', $this->productos])->andFilterWhere(['like', 'comentario', $this->comentario])->andFilterWhere(['like', 'docto_propuesta', $this->docto_propuesta]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getCuentasIp() { return $this->hasOne(CuentasIp::className(), ['id' => 'cuentas_ip_id']); }
/** * Finds the CuentasIp model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return CuentasIp the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = CuentasIp::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }