示例#1
0
 /**
  * Lists all Emiten models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new EmitenSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->getSort()->defaultOrder = ['updated_at' => SORT_DESC, 'created_at' => SORT_DESC];
     $dataProvider->pagination->pageSize = 10;
     $session = Yii::$app->session;
     $session->set('dataProvider', $dataProvider);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * Lists all Emiten models.
  * @return mixed
  */
 public function actionIndex($emitens = '')
 {
     $perpage = 20;
     if (!empty($_GET['per-page'])) {
         $perpage = (int) $_GET['per-page'];
     }
     $parameters = [];
     //$parameters['JMLLOT'] => 0;
     if (!empty($emitens)) {
         $parameters['KODES'] = explode(',', $emitens);
     }
     $searchModel = new EmitenSearch($parameters);
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider2 = clone $dataProvider;
     $session = Yii::$app->session;
     $session->set('dataProvider', $dataProvider2);
     $dataProvider->pagination->pageSize = $perpage;
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'perpage' => $perpage, 'emitens' => $parameters['KODES'], 'lotshare' => $this->getLotshare()]);
 }