コード例 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CriticsUser::find()->where('status=0');
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['Id' => $this->Id, 'createdOn' => $this->createdOn, 'createdBy' => $this->createdBy, 'updatedOn' => $this->updatedOn, 'updatedBy' => $this->updatedBy, 'cityId' => $this->cityId]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'fName', $this->fName])->andFilterWhere(['like', 'lName', $this->lName])->andFilterWhere(['like', 'detail', $this->detail])->andFilterWhere(['like', 'profileImage', $this->profileImage])->andFilterWhere(['like', 'twitterHandle', $this->twitterHandle])->andFilterWhere(['like', 'facebookHandle', $this->facebookHandle]);
     return $dataProvider;
 }
コード例 #2
0
ファイル: _search.php プロジェクト: rajanishtimes/partnerapi
 */
?>

<div class="critics-reviews-search">

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>

    <?php 
//echo $form->field($model, 'Id')
?>

   
     <?php 
echo $form->field($model, 'criticId')->dropDownList(ArrayHelper::merge(['' => 'Select'], ArrayHelper::map(\common\models\CriticsUser::find()->All(), 'Id', 'name')));
?>
  

    <?php 
echo $form->field($model, 'estId');
?>

    <?php 
// echo $form->field($model, 'description')
?>

    <?php 
// echo $form->field($model, 'foodRate')
?>