wupengfei 2 年之前
父節點
當前提交
95bb012cda
共有 3 個文件被更改,包括 60 次插入7 次删除
  1. 8 7
      .idea/workspace.xml
  2. 22 0
      application/operate/controller/Forum.php
  3. 30 0
      application/operate/view/forum/reply_forum.html

+ 8 - 7
.idea/workspace.xml

@@ -2,6 +2,7 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/operate/view/forum/reply_forum.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/operate/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Forum.php" afterDir="false" />
     </list>
@@ -121,7 +122,7 @@
   <component name="PropertiesComponent">
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../xiang_admin" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/operate/view/forum" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -131,14 +132,14 @@
     <property name="settings.editor.selected.configurable" value="reference.idesettings.emmet" />
   </component>
   <component name="RecentsManager">
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\application\api\controller" />
-    </key>
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\application\operate\view\forum" />
       <recent name="D:\zs\gaoyixia\application\common\service" />
       <recent name="D:\zs\gaoyixia\application\common\model" />
       <recent name="D:\zs\gaoyixia\application\user\view\tag" />
       <recent name="D:\zs\gaoyixia\public" />
+    </key>
+    <key name="MoveFile.RECENT_KEYS">
       <recent name="D:\zs\gaoyixia\application\api\controller" />
     </key>
   </component>
@@ -202,7 +203,7 @@
       <workItem from="1670547445908" duration="12147000" />
       <workItem from="1670633686675" duration="15717000" />
       <workItem from="1670719843429" duration="8446000" />
-      <workItem from="1670807412269" duration="3942000" />
+      <workItem from="1670807412269" duration="4513000" />
     </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="1670812298380">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1670812943746">
       <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="1670812298380" />
+    <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="283" y="145" width="1942" height="1088" key="DiffContextDialog" timestamp="1670291222413">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 22 - 0
application/operate/controller/Forum.php

@@ -1,5 +1,6 @@
 <?php
 namespace app\operate\controller;
+use app\common\model\UserForum;
 use app\common\model\UserLevel;
 use library\Controller;
 use think\Db;
@@ -142,4 +143,25 @@ class Forum extends Controller
         $this->level_arr = UserLevel::column('name','id');
     }
 
+
+    /**
+     * 回答问题
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function reply_forum()
+    {
+        if($this->request->isGet()) {
+            $forum_info = UserForum::where('id',input('forum_id'))->find()->toArray();
+            $this->assign('forum_info',$forum_info);
+        }else if ($this->request->isPost()){
+
+        }
+    }
+
 }

+ 30 - 0
application/operate/view/forum/reply_forum.html

@@ -0,0 +1,30 @@
+<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
+
+    <div class="layui-card-body">
+
+        <div class="layui-row margin-bottom-15">
+            <label class="layui-col-xs2 think-form-label">问答标题:</label>
+            <label class="layui-col-xs10">
+                <input value="{$forum_info.title}" class="layui-input" />
+            </label>
+        </div>
+
+        <div class="layui-row margin-bottom-15">
+            <label class="layui-col-xs2 think-form-label">回答内容:</label>
+            <label class="layui-col-xs10">
+                <textarea name="content" rows="10" cols="102">{$vo.content|default=''}</textarea>
+            </label>
+        </div>
+
+    </div>
+
+    <div class="hr-line-dashed"></div>
+    <div class="layui-form-item text-center">
+        {notempty name='forum_info.id'}<input type='hidden' value='{$forum_info.id}' name='id'>{/notempty}
+        <button class="layui-btn" type='submit'>提交</button>
+        <button class="layui-btn layui-btn-danger" type='button' data-close>取消</button>
+    </div>
+</form>
+<script>
+    window.form.render();
+</script>