From 1efe3cc58850f553c62cb5068f8d46ddedf458a5 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 30 Jan 2024 18:49:35 +0800 Subject: [PATCH] yh --- app/libs/services/Goods/GoodsShortService.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/libs/services/Goods/GoodsShortService.php b/app/libs/services/Goods/GoodsShortService.php index d14ed83..36665fd 100644 --- a/app/libs/services/Goods/GoodsShortService.php +++ b/app/libs/services/Goods/GoodsShortService.php @@ -8,6 +8,7 @@ use Dao\Goods\GoodsDao; use Dao\Goods\OpGoodsShortDao; use Dao\Goods\OpSkuShortDao; use Dao\Mall\MallAppSDao; +use Dao\Mall\MallSDao; use Dao\Order\OpOrderGoodsDao; use DbTool; use ExcelTool; @@ -24,6 +25,7 @@ use ZcNumberHelper; class GoodsShortService extends AbstractService { private $goodsDao; + private $mallSDao; private $opGoodsShortDao; private $opSkuShortDao; private $opOrderGoodsDao; @@ -34,6 +36,7 @@ class GoodsShortService extends AbstractService { protected function __construct() { $this->mallAppSDao = MallAppSDao::instance(); + $this->mallSDao = MallSDao::instance(); $this->goodsDao = GoodsDao::instance(); $this->opGoodsShortDao = OpGoodsShortDao::instance(); $this->opSkuShortDao = OpSkuShortDao::instance(); @@ -53,7 +56,11 @@ class GoodsShortService extends AbstractService { $goodsShorts = $this->opGoodsShortDao->getListByGoodsIds($goodsIds); $goodsShorts = ZcArrayHelper::changeKey($rows, 'goodsId'); + $mallIds = array_column($goodsList, 'mallId'); + $mallIdAndMallNameMap = $this->mallSDao->getMallIdAndMallNameMap($mallIds); + foreach ($goodsList as $goodsId => &$goods) { + $goods['mallName'] = $mallIdAndMallNameMap[$goods['mallId']]; $goods['shortTitle'] = $goodsShorts[$goodsId]['shortTitle']; $weight = $goodsShorts[$goodsId]['weight']; $goods['shortWeight'] = $weight > 0 ? $weight : null;