repository = $repository; } public function getProduct($id){ if(!$this->repository->merExists($id)) return app('json')->fail('店铺不存在'); $cateList = $this->repository->categoryList($id); [$page, $limit] = $this->getPage(); // $where = $this->request->params(['keyword','order','mer_cate_id','price_on', 'price_off','brand_id']); $where['is_gift_bag'] = 0; $where['is_used'] = 1; $where['product_type'] = 0; $productAttrValueRepository = app()->make(ProductAttrValueRepository::class); foreach($cateList as $key => $value){ $where['mer_cate_id'] = $value['store_category_id']; $cateList[$key]['product'] = $this->repository->productList($id,$where, $page, $limit,null); foreach($cateList[$key]['product']['list'] as $key1 => $value1){ $cateList[$key]['product']['list'][$key1]['sku'] = $productAttrValueRepository -> getOptionByProductId($value1['product_id']); } } return app('json')->success($cateList); } public function getProductGood($id){ if(!$this->repository->merExists($id)) return app('json')->fail('店铺不存在'); $res = $this->repository->getProductGoodList($id); return app('json')->success($res); } }