コード例 #1
0
ファイル: resSearch.php プロジェクト: AntonBeletsky/YiiBones
 public function search($params)
 {
     $query = res::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id_result' => $this->id_result, 'sumBones' => $this->sumBones, 'arrSumBones' => $this->arrSumBones, 'id_exp' => $this->id_exp]);
     $query->andFilterWhere(['like', 'Chance', $this->Chance]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Displays a single exp model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $model = $this->findModel($id);
     $resultsProvider = new ActiveDataProvider(['query' => \app\models\res::find()->where(['id_exp' => $model->id_exp]), 'pagination' => ['pageSize' => 10]]);
     return $this->render('view', ['model' => $this->findModel($id), 'resultsProvider' => $resultsProvider]);
 }