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;