Browse Source

评论信息优化

master
wanghongjun 7 months ago
parent
commit
87429d2a7d
  1. 14
      app/enterprise/model/Comment.php

14
app/enterprise/model/Comment.php

@ -11,13 +11,13 @@ class Comment extends Model
{ {
$reply_user = $userIdArr; $reply_user = $userIdArr;
$reply_user[] = 0; $reply_user[] = 0;
$playWhere = [ $playWhere = " type = 1 and delete_time = 0 and relevance_id = {$relevance_id}";
['type', '=', 1], $playWhere .= " and ( ";
['relevance_id', '=', $relevance_id], $playWhere .= " reply_user_id in (".implode(",", $reply_user).")";
['user_id', 'in', $userIdArr], if (!empty($userIdArr)) {
['reply_user_id', 'in', $reply_user] $playWhere .= " or user_id in (".implode(",",$userIdArr).")";
]; }
$playWhere .= " )";
$comment = self::where($playWhere)->field('id,content,user_id,reply_user_id')->select(); $comment = self::where($playWhere)->field('id,content,user_id,reply_user_id')->select();
foreach ($comment as &$commentValue) { foreach ($comment as &$commentValue) {
$commentValue = self::dataOption($commentValue,$uid); $commentValue = self::dataOption($commentValue,$uid);

Loading…
Cancel
Save