From de3f43ace850a7fb0f8d00fa1ca18753823c46d7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 14 Oct 2023 16:40:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/product/ProductRepository.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 0a542560..de9f74cb 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -1255,19 +1255,20 @@ class ProductRepository extends BaseRepository if ($res['content'] && $res['content']['type'] == 1) { $content= json_decode($res['content']['content']); if(is_Array($content) && isset($content['image'])){ - $img='

'; - foreach($content['image'] as $k=>$v){ - $img =$img. ''; - } - $res['content']['content']=$img.'

'; + // $img='

'; + $image= $content['image']??[]; + // foreach($content['image'] as $k=>$v){ + // $img =$img. ''; + // } + $res['content']['content']=['image'=>$image]; }elseif(is_object($content)){ $image= $content->image??[]; - $img='

'; - foreach($image as $k=>$v){ - $img =$img. ''; - } - $res['content']['content']=$img.'

'; + // $img='

'; + // foreach($image as $k=>$v){ + // $img =$img. ''; + // } + $res['content']['content']=['image'=>$image]; } else{ $res['content']['content']=$content;