Esempio n. 1
0
File: Visit.php Progetto: vsguts/crm
 public function find()
 {
     if ($this->ids) {
         return VisitModel::find()->where(['id' => $this->ids])->orderBy(['created_at' => SORT_DESC]);
     } else {
         $search = new VisitSearch();
         $dataProvider = $search->search($this->queryParams);
         $dataProvider->pagination = false;
         return $dataProvider->query;
     }
 }
Esempio n. 2
0
 /**
  * Lists all Visit models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new VisitSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }