wupengfei 2 years ago
parent
commit
2877242348

+ 4 - 3
.idea/workspace.xml

@@ -3,6 +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/api/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Forum.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/operate/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Forum.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -202,7 +203,7 @@
       <workItem from="1670547445908" duration="12147000" />
       <workItem from="1670633686675" duration="15717000" />
       <workItem from="1670719843429" duration="8446000" />
-      <workItem from="1670807412269" duration="4630000" />
+      <workItem from="1670807412269" duration="4807000" />
     </task>
     <servers />
   </component>
@@ -272,10 +273,10 @@
     </option>
   </component>
   <component name="WindowStateProjectService">
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1670812943746">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1670813365117">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1670812943746" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1670813365117" />
     <state x="283" y="145" width="1942" height="1088" key="DiffContextDialog" timestamp="1670291222413">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

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

@@ -263,7 +263,7 @@ class Forum extends Base
     {
         $id = input('post.id');
         $content = input('post.content');
-        if(!$content) $this->error('请上传内容');
+        if(!$content) $this->error('请输入内容');
         $issue_user  = UserForum::where('id',$id)->value('user_id');
         $res = ForumReply::create(['user_id'=>$this->user_id,'content'=>$content,'issue_user'=>$issue_user,'forum_id'=>$id]);
         $detail  = ForumReply::where('c.id',$res->id)

+ 8 - 2
application/operate/controller/Forum.php

@@ -1,7 +1,9 @@
 <?php
 namespace app\operate\controller;
+use app\common\model\ForumReply;
 use app\common\model\UserForum;
 use app\common\model\UserLevel;
+use app\common\model\UserMessage;
 use library\Controller;
 use think\Db;
 /**
@@ -159,10 +161,14 @@ class Forum extends Controller
         if($this->request->isGet()) {
             $forum_info = UserForum::where('id',input('forum_id'))->find()->toArray();
             $this->assign('forum_info',$forum_info);
-
             $this->_form($this->table,'reply_forum');
         }else if ($this->request->isPost()){
-
+            $id = input('post.id');
+            $content = input('post.content');
+            if(!$content) $this->error('请输入内容');
+            $issue_user  = UserForum::where('id',$id)->value('user_id');
+            $res = ForumReply::create(['user_id'=>$this->user_id,'content'=>$content,'issue_user'=>$issue_user,'forum_id'=>$id]);
+            if($issue_user)UserMessage:: sendUserMessage($issue_user,'forum',5,0,0,$id,'平台回复了您的提问');
         }
     }