diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index b71ad6b0..ef6f1a0a 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -341,9 +341,7 @@ class Goods extends Controller public function chartsGoodsJing(): Json { $service = new GoodsService; - $storeid = request()->header()['storeid']; - - $goodsList = $service->chartsGoodsJing($storeid); + $goodsList = $service->chartsGoodsJing(); return $this->renderSuccess($goodsList); } diff --git a/app/api/service/Goods.php b/app/api/service/Goods.php index f0a8712a..cf1e6302 100644 --- a/app/api/service/Goods.php +++ b/app/api/service/Goods.php @@ -224,15 +224,13 @@ class Goods extends GoodsService } - public function chartsGoodsJing($storeid): array + public function chartsGoodsJing(): array { $model = new CategoryModel; - $list = $model->where([ 'parent_id' => 0, 'status' => 1, 'is_paihang' => 1, - 'store_id' => $storeid ])->order('category_id desc')->select()->toArray(); $model = new GoodsModel; foreach ($list as &$v) { @@ -240,14 +238,11 @@ class Goods extends GoodsService 'status' => 10, 'is_delete' => 0, 'paihang' => 1, - 'store_id' => $storeid, 'categoryId' => $v['category_id'], ], 3); $list2 = $goodsList->toArray()['data']; - $v['goods_list'] = $this->newFormatGoodsList($list2); } - return $list; }