wupengfei 2 年 前
コミット
be5273b539

+ 3 - 2
.idea/workspace.xml

@@ -3,7 +3,8 @@
   <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/view/recruit/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/recruit/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/Recruit.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Recruit.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/recruit/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/recruit/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -170,7 +171,7 @@
       <workItem from="1666659002848" duration="14268000" />
       <workItem from="1666746114555" duration="18673000" />
       <workItem from="1666833605829" duration="20099000" />
-      <workItem from="1666919224277" duration="12320000" />
+      <workItem from="1666919224277" duration="14025000" />
     </task>
     <servers />
   </component>

+ 32 - 0
application/operate/controller/Recruit.php

@@ -152,4 +152,36 @@ class Recruit extends Controller
         $this->success('操作成功', 'javascript:history.back()');
     }
 
+
+    /**
+     * 上架
+     * @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 up()
+    {
+        $this->_save($this->table, ['status' => '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 down()
+    {
+        $this->_save($this->table, ['status' => '2']);
+    }
+
+
 }

+ 5 - 1
application/operate/view/recruit/index.html

@@ -33,7 +33,11 @@
             <td class='text-left'>{$vo.create_at|default='--'}</td>
             <td class='text-left' style="width: 20%">
                 <a data-title="编辑" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
-
+                {if isset($vo.status) and $vo.status eq 1}
+                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('down')}" data-value="id#{$vo.id};status#2">禁 用</a>
+                {else}
+                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('up')}" data-value="id#{$vo.id};status#1">启 用</a>
+                {/if}
                 <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
             </td>
         </tr>