Beispiel #1
0
 /**
  * Lists all Partner models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PartnerSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     // $this->ajaxAssign('tags', Tag::find()->asArray()->publicTags()->all());
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'tags' => [__('Public tags') => Tag::find()->publicTags()->all(), __('Personal tags') => Tag::find()->personalTags()->all()]]);
 }
Beispiel #2
0
 public function find()
 {
     if ($this->ids) {
         return PartnerModel::find()->where(['id' => $this->ids])->orderBy(['created_at' => SORT_DESC]);
     } else {
         $search = new PartnerSearch();
         $dataProvider = $search->search($this->queryParams);
         $dataProvider->pagination = false;
         return $dataProvider->query;
     }
 }