From f5bb41988ccab681f4549fbcd16f83c5a87da7c8 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sun, 24 Oct 2021 23:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=84=E5=88=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=AF=BC=E8=87=B4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/GoodsCommentsService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/service/GoodsCommentsService.php b/app/service/GoodsCommentsService.php index 5956f0148..5bc9dc451 100644 --- a/app/service/GoodsCommentsService.php +++ b/app/service/GoodsCommentsService.php @@ -255,8 +255,8 @@ class GoodsCommentsService if(!isset($params['is_public']) || $params['is_public'] == 1) { $v['user'] = [ - 'avatar' => $user['avatar'], - 'user_name_view' => (!isset($v['is_anonymous']) || $v['is_anonymous'] == 1) ? '匿名' : mb_substr($user['user_name_view'], 0, 1, 'utf-8').'***'.mb_substr($user['user_name_view'], -1, null, 'utf-8'), + 'avatar' => isset($user['avatar']) ? $user['avatar'] : '', + 'user_name_view' => (!isset($v['is_anonymous']) || $v['is_anonymous'] == 1 || empty($user['user_name_view'])) ? '匿名' : mb_substr($user['user_name_view'], 0, 1, 'utf-8').'***'.mb_substr($user['user_name_view'], -1, null, 'utf-8'), ]; } else { $v['user'] = $user; -- GitLab