wupengfei 1 年之前
父节点
当前提交
66aa4253d9

+ 4 - 3
.idea/workspace.xml

@@ -3,8 +3,9 @@
   <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/operate/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Forum.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/forum/reply.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/forum/reply.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/ForumComment.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/ForumComment.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/forum_comment/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/forum_comment/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/forum_comment/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/forum_comment/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -379,7 +380,7 @@
       <workItem from="1689813742376" duration="13449000" />
       <workItem from="1689900489647" duration="18483000" />
       <workItem from="1690159826319" duration="22343000" />
-      <workItem from="1690246325106" duration="3473000" />
+      <workItem from="1690246325106" duration="3815000" />
     </task>
     <servers />
   </component>

+ 15 - 0
application/operate/controller/ForumComment.php

@@ -77,6 +77,21 @@ class ForumComment extends Controller
         $this->_save($this->table, ['is_deleted' => 1]);
     }
 
+    /**
+     * 删除
+     * @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 remove()
+    {
+        $this->_save($this->table, ['is_deleted' => 1]);
+    }
+
 
     /**
      * 表单数据处理

+ 1 - 0
application/operate/view/forum_comment/form.html

@@ -11,6 +11,7 @@
         <input type="hidden" name="first_id" value="{$vo.first_id|default=0}">
         <input type="hidden" name="lev" value="{$vo.lev + 1}">
         <input type="hidden" name="pid" value="{$vo.id}">
+        <input type="hidden" name="forum_id" value="{$vo.forum_id}">
         <input type="hidden" name="source_id" value="{$source_id}">
     </div>
 

+ 4 - 0
application/operate/view/forum_comment/index.html

@@ -1,6 +1,8 @@
 {extend name='admin@main'}
 {block name="button"}
 <a href="javascript:history.go(-1);"  data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
+<button data-action='{:url("remove")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
+
 {/block}
 {block name="content"}
 <div class="think-box-shadow">
@@ -8,6 +10,7 @@
     <table class="layui-table margin-top-20" lay-skin="line">
         <thead>
         <tr>
+            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
             <th class='text-left nowrap' >ID</th>
             <th class='text-left nowrap' >用户</th>
             <th class='text-left ' style="width: 60%">评论内容</th>
@@ -18,6 +21,7 @@
         <tbody>
         {foreach $list as $key=>$vo}
         <tr>
+            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
             <td class='text-left '>{$vo.id|default=''}</td>
             <td class='text-left nowrap'>
                 <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">