/** * 商城商品分类action * @return string */ public function actionList() { $searchModel = new ShopProductSearch(); $dataProvider = $searchModel->search(\Yii::$app->request->queryParams); $dataProvider->sort = ['defaultOrder' => ['created_at' => SORT_DESC]]; $dataProvider->pagination = ['pageSize' => 15]; return $this->render('list', ['dataProvider' => $dataProvider]); }
/** * Lists all ShopProduct models. * @return mixed */ public function actionIndex() { $searchModel = new ShopProductSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }