public function search($params)
 {
     $query = Payments::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->setSort(['defaultOrder' => ['updatedOn' => SORT_DESC]]);
     $query->andFilterWhere([Payments::tableName() . '.status' => '0']);
     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;
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPayment()
 {
     return $this->hasOne(Payments::className(), ['Id' => 'paymentId']);
 }
Example #3
0
 

    <?php 
// $form->field($model, 'pin')->textInput()
?>

    <?php 
echo $form->field($model, 'cuisines')->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 
echo $form->field($model, 'feature')->widget(Multiselect::className(), ['data' => ArrayHelper::merge([], ArrayHelper::map(\common\models\Features::find()->andWhere(['status' => 1])->All(), 'Id', 'name')), 'options' => ['multiple' => 'multiple', 'size' => 7, 'title' => 'Select Features']]);
?>
     
    <?php 
echo $form->field($model, 'payment')->widget(Multiselect::className(), ['data' => ArrayHelper::merge([], ArrayHelper::map(\common\models\Payments::find()->andWhere(['status' => 1])->All(), 'Id', 'name')), 'options' => ['multiple' => 'multiple', 'size' => 7, 'title' => 'Select Payment']]);
?>
    
    <?php 
// $form->field($model, 'description')->textarea(['rows' => 6])
?>

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



    <?php 
// $form->field($model, 'tollfree')->textInput(['maxlength' => 15])
?>
 /**
  * Finds the Payments model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Payments the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Payments::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPayment()
 {
     return $this->hasMany(Payments::className(), ['Id' => 'paymentId'])->via('resMaps');
     /*/
       $data = [];
       
       foreach($this->resMaps as $model){
           if($model->paymentId){
               $data[]=$model->paymentId;
           }
       }
       
       return $data;
       //*/
 }
Example #6
0
//<?= $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">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>