From 865a6b872b37384f433cbca80800117e492bce4d Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 18 Aug 2023 10:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=BD=AC=E5=94=AE=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/community/Community.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index bbc136eb..7b042139 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -573,4 +573,26 @@ class Community extends BaseController return app('json')->fail('审核操作成功'); } + /** + * 转售商品详情 + * @return mixed + */ + public function resaleDetail($id) + { + $communityInfo = Db::name('community')->where('uid', $this->request->uid())->where('community_id', $id)->where('is_del', 0)->find(); + if (!$communityInfo) { + app('json')->fail('转售商品不存在'); + } + if (!empty($communityInfo['image'])) { + $communityInfo['image'] = explode(',', $communityInfo['image']); + } + $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); + } + $communityInfo['resale'] = $resaleList; + return app('json')->fail($communityInfo); + } + }