wupengfei 1 year ago
parent
commit
86343f19c6

+ 9 - 8
.idea/workspace.xml

@@ -3,9 +3,10 @@
   <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/mall/view/express_company/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/express_company/index.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/mall/view/freight_template/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/freight_template/index.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/mall/view/store_goods/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/store_goods/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/DatumUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/DatumUrl.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/SeriesDatum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/SeriesDatum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/datum_cate/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/datum_cate/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/series_datum/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/series_datum/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -380,7 +381,7 @@
       <workItem from="1689813742376" duration="13449000" />
       <workItem from="1689900489647" duration="18483000" />
       <workItem from="1690159826319" duration="22343000" />
-      <workItem from="1690246325106" duration="9562000" />
+      <workItem from="1690246325106" duration="9936000" />
     </task>
     <servers />
   </component>
@@ -510,10 +511,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1400@0.0.2560.1400" timestamp="1684374232836" />
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1690255143000">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1690264359954">
       <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="1690255143000" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1690264359954" />
     <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog" timestamp="1689930941409">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
@@ -534,10 +535,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1687246001889" />
-    <state x="830" y="186" width="1407" height="1056" key="find.popup" timestamp="1690254822702">
+    <state x="830" y="186" width="1407" height="1056" key="find.popup" timestamp="1690264098886">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="830" y="186" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1690254822702" />
+    <state x="830" y="186" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1690264098886" />
     <state x="1282" y="549" key="ftp.server.browser" timestamp="1684465678841">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 22 - 0
application/nutrition/controller/DatumUrl.php

@@ -112,6 +112,28 @@ class DatumUrl extends Controller
         $this->success('删除成功!');
     }
 
+    /**
+     * 批量删除
+     * @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()
+    {
+        $ids = input('id');
+        foreach (explode(',',$ids) as $id) {
+            $datum_id = \app\common\model\DatumUrl::where('id',$id)->value('datum_id');
+            DatumIntro::where('id',$datum_id)->setDec('url_num');
+            \app\common\model\DatumUrl::where('id',$id)->update(['is_deleted'=>1]);
+            \app\common\model\DatumUrl::esAdd(input('id'));
+        }
+        $this->success('删除成功!');
+    }
+
 
     /**
      * 表单数据处理

+ 15 - 0
application/nutrition/controller/SeriesDatum.php

@@ -148,6 +148,21 @@ class SeriesDatum 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]);
+    }
+
 
 
     /**

+ 4 - 0
application/nutrition/view/datum_cate/index.html

@@ -1,12 +1,15 @@
 {extend name='admin@main'}
 {block name="button"}
 <button data-modal='{:url("add")}' 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"}
 <div class="think-box-shadow">
     <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 nowrap'>是否VIP</th>
@@ -16,6 +19,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 nowrap'>{$vo.id|default=''}</td>
             <td class='text-left nowrap'>{$vo.title|default=''}</td>
             <td class='text-left nowrap'>{$vo.is_vip ? '是':'否'}</td>

+ 4 - 0
application/nutrition/view/series_datum/index.html

@@ -1,6 +1,8 @@
 {extend name='admin@main'}
 {block name="button"}
 <button data-modal='{:url("add")}?type=2' 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"}
 <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='list-table-sort-td'>
                 <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
             </th>
@@ -21,6 +24,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='list-table-sort-td'>
                 <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
             </td>