diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index a554723c..b1a24f07 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -580,27 +580,7 @@ class Community extends BaseController if (!$communityInfo) { return app('json')->fail('转售商品不存在'); } - if (!empty($communityInfo['image'])) { - $communityInfo['image'] = explode(',', $communityInfo['image']); - } - $merInfo = Db::name('StoreService')->alias('ss')->leftJoin('Merchant m','ss.mer_id = M.mer_id')->where('ss.uid', $this->request->uid())->field('m.mer_avatar, m.mer_name')->find(); - $communityInfo['mer_name'] = $merInfo['mer_name'] ?? ''; - $communityInfo['mer_avatar'] = $merInfo['mer_avatar'] ?? ''; - - $resaleList = Db::name('resale')->alias('r')->leftJoin('store_product_attr_value s','r.product_attr_unique = s.unique')->where('r.community_id', $id)->where('r.is_del', 0)->field(['r.product_id', 'r.product_attr_unique', 'r.number', 'r.price', 'r.float_rate', 'r.deliver_method', 'r.resale_type', 's.detail', 's.sku', 's.image'])->select(); - if ($resaleList) $resaleList = $resaleList->toArray(); - foreach($resaleList as $k=>$v) { - $resaleList[$k]['detail'] = json_decode($v['detail'], true); - if (empty($v['image'])) { - $prodImage = Db::name('store_product')->where('product_id', $v['product_id'])->value('image'); - $prodImageList = explode(',', $prodImage); - if (count($prodImageList) > 0) { - $resaleList[$k]['image'] = $prodImageList[0]; - } - } - } - $communityInfo['resale'] = $resaleList; - return app('json')->success($communityInfo); + return app('json')->success($this->repository->show($id, $this->user)); } /**