wupengfei 2 лет назад
Родитель
Сommit
8866702d2a
2 измененных файлов с 17 добавлено и 2 удалено
  1. 13 1
      .idea/workspace.xml
  2. 4 1
      application/api/controller/Forum.php

+ 13 - 1
.idea/workspace.xml

@@ -3,7 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/view/user_video/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/user_video/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Forum.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -325,4 +325,16 @@
     </state>
     <state x="1237" y="367" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1670727204367" />
   </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager>
+      <breakpoints>
+        <line-breakpoint enabled="true" type="javascript">
+          <url>file://$PROJECT_DIR$/application/nutrition/view/user_video/index.html</url>
+          <line>45</line>
+          <properties lambdaOrdinal="-1" />
+          <option name="timeStamp" value="2" />
+        </line-breakpoint>
+      </breakpoints>
+    </breakpoint-manager>
+  </component>
 </project>

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

@@ -180,6 +180,8 @@ class Forum extends Base
      * @return name:name type:string default:-- desc:发布用户
      * @return name:headimg type:string default:-- desc:发布用户头像
      * @return name:browse_num type:int default:-- desc:浏览量
+     * @return name:images type:string default:0 desc:图片【多张|隔开】
+     * @return name:images_arr type:array default:null desc:图片【多张】
      * @return name:is_collect type:int default:-- desc:是否关注【0否1是】
      * @return name:switch_open type:int default:-- desc:开关是否开启【0否1是】
      * @return name:comment_num type:int default:-- desc:评论数量
@@ -192,7 +194,7 @@ class Forum extends Base
         $app_logo = sysconf('app_logo');
         $detail = UserForum::where('f.id',$id)
             ->alias('f')
-            ->field('f.id,f.title,f.is_deleted,f.content,f.label,f.level,f.browse_num,is_read,f.create_at,u.name,u.headimg,IFNULL( (SELECT count(DISTINCT r.user_id) FROM dd_forum_reply as r WHERE f.id=r.forum_id  ),0 ) as reply_num')
+            ->field('f.id,f.title,f.is_deleted,f.content,f.label,f.images,f.level,f.browse_num,is_read,f.create_at,u.name,u.headimg,IFNULL( (SELECT count(DISTINCT r.user_id) FROM dd_forum_reply as r WHERE f.id=r.forum_id  ),0 ) as reply_num')
             ->leftJoin('store_member u','u.id = f.user_id')
             ->find()->toArray();
         if($detail['is_deleted']) $this->error('该问答已删除');
@@ -208,6 +210,7 @@ class Forum extends Base
         $detail['comment_num'] = numTransform($detail['comment_num']);
         $detail['replay_num'] = numTransform($detail['replay_num']);
         $detail['browse_num'] = numTransform($detail['browse_num']);
+        $detail['images_arr'] = $detail['images'] ? explode('|',$detail['images']) : null;
         UserForum::where('id',$id)->setInc('browse_num');// 增加浏览量
         if(!$detail['is_read'])UserForum::where('id',$detail['id'])->update(['is_read'=>1]);
         UserTrack::crateTrack($this->user_id,5,input('get.id'),0);