wupengfei 1 rok pred
rodič
commit
7daf63b1c5

+ 4 - 2
.idea/workspace.xml

@@ -3,7 +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/nutrition/view/datum_url/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/datum_url/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/Learn.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/Learn.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/datum_comment/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/datum_comment/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/learn/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/learn/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -378,7 +380,7 @@
       <workItem from="1689813742376" duration="13449000" />
       <workItem from="1689900489647" duration="18483000" />
       <workItem from="1690159826319" duration="22343000" />
-      <workItem from="1690246325106" duration="10074000" />
+      <workItem from="1690246325106" duration="10274000" />
     </task>
     <servers />
   </component>

+ 11 - 0
application/nutrition/controller/Learn.php

@@ -143,6 +143,17 @@ class Learn extends Controller
         $this->_save($this->table, ['is_deleted' => 2]);
     }
 
+    /**
+     * 批量删除
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function remove()
+    {
+        $this->_save($this->table, ['is_deleted' => 2]);
+    }
 
 
     /**

+ 6 - 0
application/nutrition/view/datum_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("del")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('del')}" 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,8 @@
     <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>
             <th class='text-left nowrap' >时间</th>
@@ -18,6 +22,8 @@
         <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">
                 <div class="inline-block">

+ 2 - 0
application/nutrition/view/learn/index.html

@@ -2,6 +2,8 @@
 
 {block name="button"}
 <button data-modal='{:url("add")}?type={$Think.get.type}&first_id={$Think.get.first_id}&second_id={$Think.get.second_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
+<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"}