hrjy 3 gadi atpakaļ
vecāks
revīzija
eb6eb2d3a1

+ 4 - 3
.idea/workspace.xml

@@ -6,9 +6,9 @@
   <component name="ChangeListManager">
     <list default="true" id="9df7b838-09db-466a-bed4-3e1ac8c3624d" name="变更" comment="commit">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/app/admin/controller/order/StoreOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/controller/order/StoreOrder.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/runtime/cache/48/e345b986ae9584f9686dac64ea2c6a.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/cache/48/e345b986ae9584f9686dac64ea2c6a.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/runtime/cache/a9/939d920c0fa6b4fe0b897fb019672a.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/cache/a9/939d920c0fa6b4fe0b897fb019672a.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/admin/controller/auction/AuctionOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/controller/auction/AuctionOrder.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/admin/controller/auction/AuctionProduct.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/controller/auction/AuctionProduct.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/admin/view/auction/auction_product/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/view/auction/auction_product/index.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -112,6 +112,7 @@
       <workItem from="1655962099358" duration="11768000" />
       <workItem from="1656030361664" duration="3313000" />
       <workItem from="1656118040246" duration="9992000" />
+      <workItem from="1656290997390" duration="2888000" />
     </task>
     <task id="LOCAL-00001" summary="commit">
       <created>1655962607195</created>

+ 1 - 1
app/admin/controller/auction/AuctionOrder.php

@@ -105,7 +105,7 @@ class AuctionOrder extends AuthController
      * @return void
      */
     public function save($id)
-    {
+    { 
         $data = Util::postMore([
             'name',
             'is_show',

+ 14 - 0
app/admin/controller/auction/AuctionProduct.php

@@ -144,6 +144,20 @@ class AuctionProduct extends AuthController
         }
     }
 
+    public function set_frozen($id, $status)
+    {
+
+        if (empty($id))return Json::fail('修改失败');
+
+        $res = model::update(['frozen' => $status, 'id' => $id]);
+        if ($res){
+            return Json::success('修改成功!');
+        }else{
+            return Json::fail(\app\admin\model\auction\Auction::getErrorInfo());
+        }
+    }
+
+
     public function edit($id)
     {
         if (!$id) Json::fail('数据不存在');

+ 19 - 10
app/admin/view/auction/auction_product/index.php

@@ -87,7 +87,7 @@
                 <div class="layui-card-body">
                     <div class="layui-btn-container" id="container-action">
                         <a class="layui-btn layui-btn-sm" href="{:Url('create')}">添加商品</a>
-<!--                        <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
+                        <!--                        <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
                     </div>
                     <table class="layui-hide" id="List" lay-filter="List"></table>
 
@@ -99,15 +99,7 @@
                         <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='上架|下架'  {{ d.is_show  == 1 ? 'checked' : '' }}>
                     </script>
                     <script type="text/html" id="frozen">
-                        {{#  if(d.frozen  <  1){ }}
-                        <button type="button" name="status" class="layui-btn layui-btn-xs" id="">
-                            正常
-                        </button>
-                        {{#  } else { }}
-                        <button type="button" name="status" class="layui-btn layui-btn-xs" id=""style="background: red;">
-                            冻结
-                        </button>
-                        {{#  } }}
+                        <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='frozen' lay-text='冻结|解冻'  {{ d.frozen  == 1 ? 'checked' : '' }}>
                     </script>
                     <script type="text/html" id="act">
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('修改所属人','{:Url('belonging')}?id={{d.id}}',{h:500,w:500})">
@@ -211,5 +203,22 @@
             });
         }
     });
+
+    //改状态
+    layList.switch('frozen',function (odj,value) {
+        if(odj.elem.checked==true){
+            layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_frozen',p:{status:1,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }else{
+            layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_frozen',p:{status:0,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }
+    });
 </script>
 {/block}