Browse Source

admin update

xiaoyu 3 years ago
parent
commit
816f6919bc
2 changed files with 98 additions and 1 deletions
  1. 31 1
      admin/control/refill_detail.php
  2. 67 0
      admin/templates/default/refill.detail.php

+ 31 - 1
admin/control/refill_detail.php

@@ -1,6 +1,6 @@
 <?php
 
-
+use refill\util;
 class refill_detailControl extends SystemControl
 {
     public function __construct()
@@ -136,4 +136,34 @@ class refill_detailControl extends SystemControl
         $excel_obj->generateXML($excel_obj->charset(L('exp_od_order'), CHARSET) . date('Y-m-d-H', time()));
         exit;
     }
+
+    public function order_disposeOp()
+    {
+        $id = $_GET['id'];
+        $type = $_GET['type'];
+        $condition['id'] = ['in',$id];
+        $condition['order_state'] = ORDER_STATE_QUEUE;
+var_dump($_GET);die;
+        $refill_detail = Model('refill_detail')->where($condition)->select();
+        $mod = Model('refill_order');
+        foreach ($refill_detail as $detail) {
+            $mchid = $detail['mchid'];
+            $mch_order = $detail['mch_order'];
+            $refill_order = $mod->getOrderInfo(['mchid' => $mchid,'mch_order' => $mch_order]);
+            if (empty($refill_order)) {
+                $params = json_decode($detail['params'],true);
+                if ($type == 'cancel') {
+                    //零元订单失败
+//                    util::push_add_zero($params);
+                } elseif ($type == 'anew') {
+                    //重新补充
+//                    util::push_add($params);
+                } else {
+                    continue;
+                }
+            } else {
+//                util::pop_queue_order($mchid,$mch_order);
+            }
+        }
+    }
 }

+ 67 - 0
admin/templates/default/refill.detail.php

@@ -133,6 +133,12 @@
                     <a href="#" class="btns" onclick="hCopyOrder(event)">
                         <span><i class="icon-edit"></i>拷贝客户单号</span>
                     </a>
+                    <a href="#" class="btns"  id="hFail">
+                        <span><i class="icon-edit"></i>批量失败</span>
+                    </a>
+                    <a href="#" class="btns" onclick="hSupplement(event)">
+                        <span><i class="icon-edit"></i>批量补充</span>
+                    </a>
                 </td>
             </tr>
         </table>
@@ -148,6 +154,7 @@
             <th class="align-center">充值额度</th>
             <th class="align-right">下单日期</th>
             <th class="align-center">订单状态</th>
+            <th class="align-center"><?php echo $lang['nc_handle']; ?></th>            
         </tr>
         </thead>
         <tbody id="tbody">
@@ -165,6 +172,17 @@
                     <td class="align-center"><?php echo $order['params']['amount']; ?></td>
                     <td class="align-right"><?php echo date('Y-m-d H:i:s', $order['order_time']) ?? '/'; ?></td>
                     <td class="align-center"><?php echo $order['order_state_text']; ?></td>
+                    <td class="align-center">
+                        <!-- <a href="#">
+                                回调</a>
+                        | -->
+                        <a href="#">
+                        回调失败</a>
+                        |
+                        <a href="#">
+                        回调补充</a>
+
+                    </td>
                 </tr>
             <?php } ?>
         <?php } else { ?>
@@ -210,6 +228,21 @@
             elem: '#endTime',
             type: 'datetime'
         });
+            //批量失败
+    // function hFail(e) {
+    //     layer.confirm('您确定要批量失败', {
+    //     btn: ['确定','取消'],
+    //     title:'批量失败'
+    // }, function(){
+    //     $('#selectAll' ).click ( function () {
+ 
+
+            
+
+    //         })
+    //     }, function(){
+    // });
+    // }
         //全选
         $('#selectAll' ).click ( function () {
             $(":checkbox[name='checkbox']").each(function(){
@@ -225,6 +258,29 @@
             
 
             })
+            //批量
+            $('#hFail').click(function () {
+                layer.confirm('您确定要批量失败', {
+                btn: ['确定','取消'],
+                title:'批量失败'
+            }, function(){
+        if ($('#checkBoxList').attr('checked') == true) {
+             let arr = [];
+            $("input:checkbox:checked").each(function (i) {
+                arr[i] = $(this).val();
+            })
+            let str = arr.join(",");
+            window.location.href =`index.php?act=refill_detail&op=order_dispose&id= ${str ? str : ''}`
+            console.log(str);
+            layer.msg('批量成功', {icon: 1});
+        }  else {
+            layer.msg('您还没有进行任何操作,请先选择');
+        }
+		
+
+            }, function(){
+            });
+            })
 
         // 表格hover时背景
         $('.trFlex').each(function () {
@@ -268,4 +324,15 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
+
+    //批量补充
+    function hSupplement(e) {
+        layer.confirm('您确定要批量补充', {
+        btn: ['确定','取消'],
+        title:'批量补充'
+    }, function(){
+        layer.msg('1', {icon: 1});
+    }, function(){
+    });
+    }
 </script>