修复后台评论图片不显示

This commit is contained in:
sugar1569 2019-01-26 11:39:50 +08:00
parent dd13334923
commit 0ed87c0baa
2 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,10 @@ class StoreProductReply extends ModelBasic
{
use ModelTrait;
protected function getPicsAttr($value)
{
return json_decode($value,true);
}
/**
* @param $where
* @return array
@ -38,6 +42,7 @@ class StoreProductReply extends ModelBasic
$model = $model->join('__STORE_PRODUCT__ p','p.id=r.product_id');
$model = $model->where('r.is_del',0);
$model = $model->field('r.*,u.nickname,u.headimgurl,p.store_name');
$model = $model->order('r.add_time desc,r.is_reply asc');
return self::page($model,function($itme){
},$where);

View File

@ -53,7 +53,8 @@
</div>
<div class="social-body">
<p>{$vo.comment}
<?php $image = json_decode($vo['pics'],true);?>
<br/>
<?php $image = isset($vo['pics'][0])?explode(",",$vo['pics'][0]):'';?>
{if condition="$image"}
{volist name="image" id="v"}
<img src="{$v}" alt="{$vo.store_name}" class="open_image" data-image="{$v}" style="width: 50px;height: 50px;cursor: pointer;">