|
|
@@ -84,9 +84,14 @@ class ForumComment extends BaseModel
|
|
|
return [0, '帖子不存在或已被禁用'];
|
|
|
}
|
|
|
|
|
|
+ // 获取用户昵称,如果为空则取手机号
|
|
|
+ $user = Db::name('user')->where('uid', $uid)->find();
|
|
|
+ $userName = !empty($user['nickname']) ? $user['nickname'] : ($user['mobile'] ?? '匿名用户');
|
|
|
+
|
|
|
$insertData = [
|
|
|
'post_id' => $postId,
|
|
|
'uid' => $uid,
|
|
|
+ 'user_name' => $userName,
|
|
|
'content' => trim($content),
|
|
|
'status' => 1,
|
|
|
'create_time' => time(),
|