示例#1
0
 public function search($params)
 {
     $query = Usp::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['Id' => $this->Id, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'IP', $this->IP]);
     return $dataProvider;
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUsp()
 {
     return $this->hasOne(Usp::className(), ['Id' => 'uspId']);
 }
 /**
  * Finds the Usp model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Usp the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Usp::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUsp()
 {
     return $this->hasMany(Usp::className(), ['Id' => 'uspId'])->via('resMaps');
 }