修复商品详情

This commit is contained in:
mkm 2023-10-14 15:56:26 +08:00
parent 941ad98960
commit fb7c9d832f

View File

@ -1255,12 +1255,26 @@ class ProductRepository extends BaseRepository
if ($res['content'] && $res['content']['type'] == 1) {
$content= json_decode($res['content']['content']);
if(is_Array($content) && isset($content['image'])){
$res['content']['content'] =$content;
$img='';
foreach($content['image'] as $k=>$v){
$img=$img.'<img src='.$v.'</img>';
}
$res['content']['content']=$img;
}elseif(is_object($content)){
$res['content']['content'] =$content->image??'';
$image= $content->image??[];
$img='';
foreach($image as $k=>$v){
$img =$img. '<img src='.$v.'</img>';
}
$res['content']['content']=$img;
}
else{
$res['content']['content'] =['image'=>$content];
$img='';
foreach($content as $k=>$v){
$img =$img. '<img src='.$v.'</img>';
}
$res['content']['content']=$img;
}
}