This commit is contained in:
mkm 2023-10-14 16:40:20 +08:00
parent 875f8d019d
commit abca5dd7c7

View File

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