From ac5da60d715e01f7d5a2eb7e7d033a91d3a95431 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 9 Sep 2023 09:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96=E5=A7=94?= =?UTF-8?q?=E6=89=98=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/community/Community.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index ecf31dda..c3b44158 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -812,6 +812,11 @@ class Community extends BaseController } $entrustDay = Db::name('entrust')->where('community_id', $id)->where('is_del', 0)->value('entrust_day'); $communityInfo['entrust_day'] = $entrustDay; + $communityInfo['product_list'] = Db::name('entrust')->alias('e')->leftJoin('store_product sp','e.product_id = sp.product_id')->leftJoin('store_product_attr_value spav','spav.unique = e.product_attr_unique')->where('e.community_id', $id)->where('sp.is_del', 0)->setOption('field', [])->field(['e.product_id, e.product_attr_unique, e.number, e.price, e.status, spav.price as old_price, sp.store_name, sp.image'])->select(); + if ($communityInfo['product_list']) $communityInfo['product_list'] = $communityInfo['product_list']->toArray(); + foreach($communityInfo['product_list'] as $k => $v) { + $communityInfo['product_list'][$k]['image'] = explode(',', $v['image']);; + } return app('json')->success($communityInfo); }