Browse Source

fix:默认头像问题

super-yimizi 1 month ago
parent
commit
8576815859
1 changed files with 3 additions and 1 deletions
  1. 3 1
      application/common/Service/Goods/CommentService.php

+ 3 - 1
application/common/Service/Goods/CommentService.php

@@ -123,7 +123,9 @@ class CommentService
             ->order('id desc')
             ->find();
         if (!empty($comment)) {
-            $comment->user->avatar = cdnurl($comment->user->avatar, true);
+            if(!empty($comment->user->avatar)){
+                $comment->user->avatar = cdnurl($comment->user->avatar, true);
+            }
         }
         return [
             'total' => $total,