public function actionIndex() { $get = Yii::$app->request->get(); $get['expand'] = 'hotsale,medicine,user'; $res = Yii::$app->client->get('/order', $get); $filterModel = new OrderSearch(); $filterModel->load($get, ''); $dataProvider = new RestDataProvider(['data' => $res, 'key' => 'id', 'sort' => ['attributes' => ['id', 'name', 'medicine_id', 'amount', 'user_id', 'create_time', 'status']]]); return $this->render('index', ['dataProvider' => $dataProvider, 'filterModel' => $filterModel]); }
/** * Lists all Order models. * @return mixed */ public function actionIndex() { $searchModel = new OrderSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }