Commit 5c91562b authored by hangjun83's avatar hangjun83

百化产品接口更新

parent c7e8ac1d
......@@ -40,4 +40,24 @@ class ProductsController extends Controller
}
}
public function getProductsByBrand(Request $request)
{
$brandId = $request->get('brandId');
if(!$brandId){
return Response::ok('品牌id不存在!');
}
$requestParams = $this->formatKeysfromArray($request->all(),'toUnderScore');
try{
$productsList = $this->bhuaProdcutService->getProductsByBrandId($requestParams);
if($productsList){
$productsList = $this->formatKeysfromArray($productsList,'toCamelCase');
}
return Response::success($productsList,'操作成功');
}catch(\Throwable $exception){
return $this->returnErrorExecptionResponse($exception,'获取品牌产品列表失败');
}
}
}
......@@ -95,24 +95,4 @@ class ProductsController extends Controller
}
}
public function getProductsByBrand(Request $request)
{
$brandId = $request->get('brandId');
if(!$brandId){
return Response::ok('品牌id不存在!');
}
$requestParams = $this->formatKeysfromArray($request->all(),'toUnderScore');
try{
$productsList = $this->bhuaProdcutService->getProductsByBrandId($requestParams);
if($productsList){
$productsList = $this->formatKeysfromArray($productsList,'toCamelCase');
}
return Response::success($productsList,'操作成功');
}catch(\Throwable $exception){
return $this->returnErrorExecptionResponse($exception,'获取品牌产品列表失败');
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment