Ver código fonte

修复后台评论图片不显示

sugar1569 7 anos atrás
pai
commit
0ed87c0baa

+ 5 - 0
application/admin/model/store/StoreProductReply.php

@@ -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);

+ 2 - 1
application/admin/view/store/store_product_reply/index.php

@@ -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;">