更新
This commit is contained in:
parent
f9645c9ac5
commit
c00a035370
@ -45,19 +45,21 @@ class CloudWarehouse extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function index($street_code, $page = 1, $category_id = 0, $cate_pid = 0,$cate_id = 0,$location = '')
|
public function index($street_code, $page = 1, $category_id = 0, $cate_pid = 0,$cate_id = 0,$location = '')
|
||||||
{
|
{
|
||||||
$cloud_product_arr = Db::name('cloud_product')
|
|
||||||
->where('street_code', $street_code)
|
$cloud_where['street_code']=$street_code;
|
||||||
->where(function($query)use($cate_pid,$cate_id){
|
$cloud_where['status']=1;
|
||||||
if($cate_pid!=0){
|
if($cate_pid!=0){
|
||||||
$cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id');
|
$cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id');
|
||||||
}
|
}
|
||||||
if($cate_id>0){
|
if($cate_id>0){
|
||||||
$query ->whereIn('cate_id', $cate_id);
|
$cloud_where['cate_id']=$cate_id;
|
||||||
}
|
}
|
||||||
|
$cloud_product_arr = Db::name('cloud_product')
|
||||||
|
->where($cloud_where)
|
||||||
|
->where(function($query){
|
||||||
$query->whereOr('mer_labels', '')
|
$query->whereOr('mer_labels', '')
|
||||||
->whereOr('mer_labels',',5,');
|
->whereOr('mer_labels',',5,');
|
||||||
})
|
})->page($page)->field('product_id,mer_labels')->select();
|
||||||
->where('status', 1)->page($page)->field('product_id,mer_labels')->select();
|
|
||||||
$cloud_product = [];
|
$cloud_product = [];
|
||||||
foreach ($cloud_product_arr as $key => $value) {
|
foreach ($cloud_product_arr as $key => $value) {
|
||||||
$cloud_product[] = $value['product_id'];
|
$cloud_product[] = $value['product_id'];
|
||||||
@ -75,18 +77,11 @@ class CloudWarehouse extends BaseController
|
|||||||
return app('json')->success(['count' => 0, 'list' => []]);
|
return app('json')->success(['count' => 0, 'list' => []]);
|
||||||
}
|
}
|
||||||
$count = Db::name('cloud_product')
|
$count = Db::name('cloud_product')
|
||||||
->where('street_code', $street_code)
|
->where($cloud_where)
|
||||||
->where(function($query) use($cate_pid,$cate_id){
|
->where(function($query){
|
||||||
if($cate_pid!=0){
|
|
||||||
$cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id');
|
|
||||||
}
|
|
||||||
if($cate_id>0){
|
|
||||||
$query ->whereIn('cate_id', $cate_id);
|
|
||||||
}
|
|
||||||
$query->whereOr('mer_labels', '')
|
$query->whereOr('mer_labels', '')
|
||||||
->whereOr('mer_labels',',5,');
|
->whereOr('mer_labels',',5,');
|
||||||
})
|
})->count();
|
||||||
->where('status', 1)->count();
|
|
||||||
|
|
||||||
$products = $this->spuRepository->getApiSearch($where, $page, 10, false, true);
|
$products = $this->spuRepository->getApiSearch($where, $page, 10, false, true);
|
||||||
if ($products['list']) {
|
if ($products['list']) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user