wupengfei 1 year ago
parent
commit
fb7f9d429c

+ 12 - 6
.idea/workspace.xml

@@ -3,7 +3,13 @@
   <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/article_report/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/article_report/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/SeriesManage.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/SeriesManage.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" 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" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/series_manage/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/series_manage/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_classify/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_classify/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_classify/second.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_classify/second.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_url/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_url/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -378,7 +384,7 @@
       <workItem from="1689813742376" duration="13449000" />
       <workItem from="1689900489647" duration="18483000" />
       <workItem from="1690159826319" duration="22343000" />
-      <workItem from="1690246325106" duration="11360000" />
+      <workItem from="1690246325106" duration="11842000" />
     </task>
     <servers />
   </component>
@@ -508,10 +514,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="1690265476246">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1690266317304">
       <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="1690265476246" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1690266317304" />
     <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog" timestamp="1689930941409">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
@@ -532,10 +538,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="1690265146403">
+    <state x="830" y="186" width="1407" height="1056" key="find.popup" timestamp="1690266025053">
       <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="1690265146403" />
+    <state x="830" y="186" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1690266025053" />
     <state x="1282" y="549" key="ftp.server.browser" timestamp="1684465678841">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 14 - 0
application/nutrition/controller/SeriesManage.php

@@ -149,6 +149,20 @@ class SeriesManage 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]);
+    }
 
     /**
      * 表单数据处理

+ 21 - 0
application/nutrition/controller/VideoUrl.php

@@ -114,6 +114,27 @@ class VideoUrl 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) {
+            $video_id = \app\common\model\VideoUrl::where('id',$id)->value('video_id');
+            VideoIntro::where('id',$video_id)->setDec('url_num');
+            \app\common\model\VideoUrl::where('id',input('id'))->update(['is_deleted'=>1]);
+            \app\common\model\VideoUrl::esAdd($id);
+        }
+        $this->success('删除成功!');
+    }
 
     /**
      * 表单数据处理

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

@@ -1,6 +1,7 @@
 {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-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>
 

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

@@ -2,6 +2,8 @@
 
 {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("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"}
@@ -10,6 +12,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>
@@ -26,6 +29,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>

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

@@ -2,6 +2,8 @@
 
 {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"}

+ 2 - 0
application/nutrition/view/video_classify/second.html

@@ -2,6 +2,8 @@
 
 {block name="button"}
 <button data-modal='{:url("add")}?pid={$Think.get.pid|default="0"}' 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"}

+ 5 - 0
application/nutrition/view/video_url/index.html

@@ -1,12 +1,16 @@
 {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-open='{:url("add")}?video_id={$video_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"}
 <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'>视频</th>
@@ -18,6 +22,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'>