From 04edca09b573e2134fbde0e14ec58dc219a09c06 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Tue, 7 May 2024 17:38:49 +0800 Subject: [PATCH] 1 --- app/api/controller/Goods.php | 4 +--- app/api/service/Goods.php | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) 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; }