Commit 038ffaaa authored by hangjun83's avatar hangjun83

百化产品接口更新

parent 93809fc7
......@@ -162,4 +162,15 @@ class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProduc
}
return null;
}
public function getProductsListByBrandId($brandId, $offset, $limit)
{
$productsModel = $this->join('chemicals', 'chemicals.c_id','products.c_id')->join('raw', 'raw.r_id','products.r_id');
$product = $productsModel->where('products.b_id.b_id',$brandId)->get();
$product = $productsModel->offset($offset)->limit($limit)->get();
if($product){
return $product->toArray();
}
return null;
}
}
......@@ -64,7 +64,7 @@ class BhuaProductsService
'p_status' => 1,
'p_show' => 1
];
$products = $this->bhuaProductService->productRepository->getProductsList($where, $limit, $offset);
$products = $this->bhuaProductService->productRepository->getProductsListByBrandId($where, $limit, $offset);
$total = 0;
if($products){
$products = app(ProductsTransformer::class)->transform($products);
......@@ -79,7 +79,7 @@ class BhuaProductsService
return $dataReturn;
}catch(\Throwable $exception){
SimpleLogs::writeLog($exception->getMessage(),__CLASS__.':getAllBrands','error');
SimpleLogs::writeLog($exception->getMessage(),__CLASS__.':getProductsByBrandId','error');
throw $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