public function search($params)
 {
     $query = Cuisine::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->setSort(['defaultOrder' => ['Id' => SORT_ASC, 'name' => SORT_ASC]]);
     $query->andFilterWhere([cuisine::tableName() . '.status' => '0']);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['Id' => $this->Id, 'createdOn' => $this->createdOn, 'status' => $this->status, 'updatedOn' => $this->updatedOn, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'desc', $this->desc])->andFilterWhere(['like', 'ip', $this->ip])->andFilterWhere(['like', 'alias', $this->alias])->andFilterWhere(['like', 'searchAlias', $this->searchAlias]);
     return $dataProvider;
 }
Beispiel #2
0
    <?php 
echo $form->field($model, 'pricefortwo')->dropDownList(ArrayHelper::merge(['' => 'Select'], \common\models\Restaurant::priceForTwo()));
?>
 

    <?php 
echo $form->field($modelBrandsCityField, 'pricefortwo')->checkbox(['label' => 'Lock']);
?>
 

    <?php 
/*/?><?= $form->field($model, 'cuisine')->dropDownList(ArrayHelper::merge([],ArrayHelper::map(\common\models\Cuisine::find()->andWhere(['status' => 1])->All(), 'Id', 'name')),['multiple'=>'multiple','size'=>7,'title'=>'Select Cuisines']) ?> <?php //*/
?>

    <?php 
echo $form->field($model, 'cuisine')->widget(Multiselect::className(), ['data' => ArrayHelper::merge([], ArrayHelper::map(\common\models\Cuisine::find()->andWhere(['status' => 1])->All(), 'Id', 'name')), 'options' => ['multiple' => 'multiple', 'size' => 7, 'title' => 'Select Cuisines']]);
?>

    <?php 
// $form->field($model, 'cusinies')->textInput(['maxlength' => 225])
?>

    <?php 
echo $form->field($modelBrandsCityField, 'cusinies')->checkbox(['label' => 'Lock']);
?>

    <?php 
echo $form->field($model, 'specilities')->textInput(['maxlength' => 225]);
?>

    <?php 
 public function getPrimarycuisine()
 {
     if ($this->cusinies) {
         $cuisines = explode(',', $this->cusinies);
         if (!is_array($cuisines)) {
             $cuisines[] = $cuisines;
         }
         $res = Cuisine::find()->where('Id IN (:status)', [':status' => $cuisines])->all();
         return $res[0]->name;
     }
 }
Beispiel #4
0
?>

    <?php 
//<?= $form->field($model, 'email')->textInput(['maxlength' => 100])
?>

    <?php 
//<?= $form->field($model, 'guid')->textInput(['maxlength' => 512])
?>

    <?php 
//<?= $form->field($model, 'old_guid')->textInput(['maxlength' => 512])
?>
    
    <?php 
echo $form->field($model, 'cuisines')->dropDownList(ArrayHelper::map(\common\models\Cuisine::find()->andWhere(['status' => 1])->All(), 'Id', 'name'), ['multiple' => 'multiple', 'size' => 5, 'name' => 'Pivot[cuisineId][]']);
?>
    
    <?php 
echo $form->field($model, 'types')->dropDownList(ArrayHelper::map(\common\models\Types::find()->andWhere(['status' => 1])->All(), 'Id', 'name'), ['multiple' => 'multiple', 'size' => 5, 'name' => 'Pivot[typesId][]']);
?>
    
    <?php 
echo $form->field($model, 'feature')->dropDownList(ArrayHelper::map(\common\models\Features::find()->andWhere(['status' => 1])->All(), 'Id', 'name'), ['multiple' => 'multiple', 'size' => 5, 'name' => 'Pivot[featureId][]']);
?>
    
    <?php 
echo $form->field($model, 'payment')->dropDownList(ArrayHelper::map(\common\models\Payments::find()->andWhere(['status' => 1])->All(), 'Id', 'name'), ['multiple' => 'multiple', 'size' => 5, 'name' => 'Pivot[paymentId][]']);
?>

    <div class="form-group">