修复错误

This commit is contained in:
mkm 2023-10-02 15:15:43 +08:00
parent b6e95690c0
commit 939842ec1a

View File

@ -663,9 +663,7 @@ class ProductRepository extends BaseRepository
public function getAdminOneProduct(int $id, ?int $activeId, $conType = 0)
{
$with = ['attr', 'attrValue', 'oldAttrValue', 'merCateId.category', 'storeCategory', 'brand', 'temp', 'seckillActive',
'content' => function($query) use($conType){
$query->where('type',$conType);
},
'content',
'merchant'=> function($query){
$query->field('mer_id,mer_avatar,mer_name,is_trader');
},
@ -753,7 +751,16 @@ class ProductRepository extends BaseRepository
$data['attrValue'] = $arr;
$content = $data['content']['content'] ?? '';
if ($conType) $content = json_decode($content);
if (isset($data['content']) &&$data['content']['type']==1){
$arr = json_decode($content);
if($arr){
$content='';
foreach($arr->image as $k=>$v){
$content.='<img src='.$v.'></br>';
}
}
}
unset($data['content']);
$data['content'] = $content;
return $data;