diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index 1bbd0676..a2425d5f 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -281,8 +281,9 @@ class StoreProduct extends BaseController public function cloud_product_list(){ [$page, $limit] = $this->getPage(); $merchant = app()->make(MerchantRepository::class)->search(['mer_id' => $this->merId,])->find(); - $select=Db::name('cloud_product')->where('mer_id',$merchant['mer_id']) - ->page($page)->limit($limit)->select()->toArray(); + $product_ids=Db::name('cloud_product')->where('mer_id',$this->merId()) + ->page($page)->limit($limit)->column('product_id'); + $select = Db::name('store_product')->where('mer_id', $this->merId())->whereIn('product_id',$product_ids)->select()->toArray(); $count = Db::name('cloud_product')->where('mer_id',$merchant['mer_id'])->count(); return app('json')->success(['list'=>$select,'count'=>$count]); } diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index 925218ba..f2cd09af 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -454,8 +454,9 @@ class Product extends BaseController public function cloud_product_list(){ [$page, $limit] = $this->getPage(); - $select=Db::name('cloud_product')->where('mer_id',$this->request->merId()) - ->page($page)->limit($limit)->select()->toArray(); + $product_ids=Db::name('cloud_product')->where('mer_id',$this->request->merId()) + ->page($page)->limit($limit)->column('product_id'); + $select = Db::name('store_product')->where('mer_id', $this->request->merId())->whereIn('product_id',$product_ids)->select()->toArray(); $count = Db::name('cloud_product')->where('mer_id',$this->request->merId())->count(); return app('json')->success(['list'=>$select,'count'=>$count]); }