chuweiqiang 1 year ago
parent
commit
8b018eb570
2 changed files with 8 additions and 2 deletions
  1. 1 1
      .idea/workspace.xml
  2. 7 1
      application/api/controller/Forum.php

+ 1 - 1
.idea/workspace.xml

@@ -569,7 +569,7 @@
       <workItem from="1710722050864" duration="8908000" />
       <workItem from="1710722050864" duration="8908000" />
       <workItem from="1710808231575" duration="7017000" />
       <workItem from="1710808231575" duration="7017000" />
       <workItem from="1710817453185" duration="16334000" />
       <workItem from="1710817453185" duration="16334000" />
-      <workItem from="1710896140284" duration="11518000" />
+      <workItem from="1710896140284" duration="12219000" />
     </task>
     </task>
     <servers />
     <servers />
   </component>
   </component>

+ 7 - 1
application/api/controller/Forum.php

@@ -780,7 +780,12 @@ class Forum extends Base
         $where[] = ['c.pid', '=', 0];
         $where[] = ['c.pid', '=', 0];
         $where[] = ['c.reply_id',$type == 1 ? '=' :'>',0];
         $where[] = ['c.reply_id',$type == 1 ? '=' :'>',0];
         $where[] = ['c.is_deleted', '=', 0];
         $where[] = ['c.is_deleted', '=', 0];
-        $list = ForumReplyComment::field('c.*,m.name,m.headimg,f.title,r.content reply_content,f.level,r.user_id reply_user')->alias('c')
+        if($type == 1){
+            $field = 'c.*,m.name,m.headimg,f.content title,r.content reply_content,f.level,r.user_id reply_user';
+        }else{
+            $field = 'c.*,m.name,m.headimg,f.title,r.content reply_content,f.level,r.user_id reply_user';
+        }
+        $list = ForumReplyComment::field($field)->alias('c')
             ->where($where)
             ->where($where)
             ->leftJoin('forum_reply r', 'c.reply_id = r.id')
             ->leftJoin('forum_reply r', 'c.reply_id = r.id')
             ->leftJoin('store_member m', 'm.id = r.user_id')
             ->leftJoin('store_member m', 'm.id = r.user_id')
@@ -792,6 +797,7 @@ class Forum extends Base
         array_walk($list, function (&$v)use ($user_info) {
         array_walk($list, function (&$v)use ($user_info) {
             $v['name']    = $user_info['name'];
             $v['name']    = $user_info['name'];
             $v['headimg'] = $user_info['headimg'];
             $v['headimg'] = $user_info['headimg'];
+            $v['title'] = strip_tags($v['title']);
             if($v['reply_id']) {
             if($v['reply_id']) {
                 $v['show_title'] = $v['reply_content'];
                 $v['show_title'] = $v['reply_content'];
                 unset($v['reply_content']);
                 unset($v['reply_content']);