/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = UserLogin::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(['like', 'user_name', $this->user_name])->andFilterWhere(['like', 'user_password', $this->user_password])->andFilterWhere(['like', 'user_type', $this->user_type])->andFilterWhere(['like', 'user_status', $this->user_status]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getDesignerUserName() { return $this->hasOne(UserLogin::className(), ['user_name' => 'designer_user_name']); }
/** * Finds the UserLogin model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return UserLogin the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = UserLogin::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getCustomerUserName() { return $this->hasOne(UserLogin::className(), ['user_name' => 'customer_user_name']); }
/** * @return \yii\db\ActiveQuery */ public function getInvestorUserName() { return $this->hasOne(UserLogin::className(), ['user_name' => 'investor_user_name']); }