Example #1
0
 public function findOne($id)
 {
     $qBrandDto = new BrandDto();
     $qBrandDto->setScenario('admin-query');
     $brand = Brand::findOne($id);
     return $brand ? ArrayHelper::toArray($brand) : null;
 }
Example #2
0
 public function actionSearch()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $params = Yii::$app->request->post();
     $brandDto = new BrandDto();
     $brandDto->setScenario('admin-query');
     $brandDto->load(['BrandDto' => $params]);
     $ds = $this->brandService->query($brandDto, ['pageParam' => 'pageCurrent', 'pageSizeParam' => 'pageSize', 'defaultPageSize' => $this->pageParams['pageSize'], 'route' => Yii::$app->requestedRoute, 'params' => $this->pageParams], [$this->sortParams['orderField'] => $this->sortParams['orderDirection']]);
     return $ds;
 }