wang hou sheng 11 months ago
parent 56dd086816
commit 04edca09b5
  1. 4
      app/api/controller/Goods.php
  2. 7
      app/api/service/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);
}

@ -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;
}

Loading…
Cancel
Save