field('id,content,user_id,reply_user_id')->select(); foreach ($comment as &$commentValue) { $friend = Friend::getFriendName($uid, $commentValue['user_id']); $commentValue['nickname'] = $friend['nickname']; $commentValue['reply_user_name'] = ''; if ($commentValue['reply_user_id']) { $friend = Friend::getFriendName($uid, $commentValue['reply_user_id']); $commentValue['reply_user_name'] = $friend['nickname']; } unset($commentValue['reply_user_id']); } return $comment; } }