更新云仓

This commit is contained in:
shengchanzhe 2023-12-25 11:38:29 +08:00
parent 0df2b61a89
commit 5a9aa8eceb

View File

@ -46,8 +46,13 @@ class CloudWarehouse extends BaseController
public function index($street_code, $page = 1, $category_id = 0, $location = '')
{
$cloud_product_arr = Db::name('cloud_product')
->where('cate_id', $category_id)
->whereOR('street_code', $street_code)->whereOR('mer_labels', ',6,')->where('status', 1)->page($page)->field('product_id,mer_labels')->select();
->where('category_id', $category_id)
->where('street_code', $street_code)
->where(function($query){
$query->whereOr('mer_labels', '')
->whereOr('mer_labels',',6,');
})
->where('status', 1)->page($page)->field('product_id,mer_labels')->select();
$cloud_product = [];
foreach ($cloud_product_arr as $key => $value) {
$cloud_product[] = $value['product_id'];
@ -64,7 +69,13 @@ class CloudWarehouse extends BaseController
if (!$cloud_product && $category_id == 0) {
return app('json')->success(['count' => 0, 'list' => []]);
}
$count = Db::name('cloud_product')->whereOR('street_code', $street_code)->whereOR('mer_labels', ',6,')->where('status', 1)->count();
$count = Db::name('cloud_product')->where('category_id', $category_id)
->where('street_code', $street_code)
->where(function($query){
$query->whereOr('mer_labels', '')
->whereOr('mer_labels',',6,');
})
->where('status', 1)->count();
$products = $this->spuRepository->getApiSearch($where, $page, 10, false, true);
if ($products['list']) {