xiaoyu 3 gadi atpakaļ
vecāks
revīzija
63b48cd1bb

+ 1 - 1
admin/control/refill_detail.php

@@ -140,7 +140,7 @@ class refill_detailControl extends SystemControl
         $type = $_GET['type'];
         $condition['detail_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)

+ 3 - 2
admin/control/refill_order.php

@@ -20,7 +20,7 @@ class refill_orderControl extends SystemControl
     {
         $model_refill_order = Model('refill_order');
         $condition['inner_status'] = 0;
-        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d H:i:s", strtotime("-10 minutes"));
 
         if (!empty($_GET['order_sn'])) {
             $condition['refill_order.order_sn'] = $_GET['order_sn'];
@@ -89,7 +89,8 @@ class refill_orderControl extends SystemControl
         } elseif ($end_unixtime > 0) {
             $condition['refill_order.order_time'] = ['lt', $end_unixtime];
         } else {
-            $start = strtotime(date('Y-m-d', time()));
+            $start = time() - 600;
+            $_GET['query_start_time'] = date("Y-m-d H:i:s",$start);
             $condition['refill_order.order_time'] = ['egt', $start];
             $fToday = true;
         }

+ 31 - 12
admin/templates/default/refill.detail.php

@@ -150,7 +150,10 @@
     <table class="table tb-type2 nobdb">
         <thead>
         <tr class="thead">
-            <th class="align-center" id="selectAll">全选</th>
+            <th class="align-center" id="selectAll">
+            <input type="checkbox" name="chbox" value="">
+            </th>
+            <th class="align-center">编号</th>
             <th class="align-center">机构编号</th>
             <th class="align-center">机构名称</th>
             <th class="align-center">商家单号</th>
@@ -169,6 +172,7 @@
                     <td class="align-center">
                     <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $order['detail_id'];?>">
                     </td>
+                    <td class="align-center"><?php echo $key+1;?></td>
                     <td class="align-center"><?php echo $order['mchid']; ?></td>
                     <td class="align-center"><?php echo $order['company_name'];?></td>
                     <td class="align-center"><?php echo $order['mch_order']; ?></td>
@@ -190,13 +194,13 @@
             <?php } ?>
         <?php } else { ?>
             <tr class="no_data">
-                <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
+                <td colspan="10"><?php echo $lang['nc_no_record']; ?></td>
             </tr>
         <?php } ?>
         </tbody>
         <tfoot>
         <tr class="tfoot">
-            <td colspan="8" id="dataFuncs">
+            <td colspan="10" id="dataFuncs">
                 <div class="pagination"> <?php echo $output['show_page']; ?> </div>
             </td>
         </tr>
@@ -236,16 +240,17 @@
         //全选
           //全选
           $('#selectAll' ).click ( function () {
-          if ($(this).text() == '全选') {
+          if ($("input[name='chbox']").is(':checked')) {
               $("input[name='checkbox']").each(function() {
                   this.checked = true;
               })
-              $(this).text("取消全选")
+       
           } else {
+       
               $("input[name='checkbox']").each(function() {
                   this.checked = false;
               })
-              $(this).text("全选")
+ 
 
           }
      
@@ -272,11 +277,18 @@
                 arr[i] = $(this).val();
             })
             let str = arr.join(",");
-            if (str != '') {
+            let strr = str.substring(0, 1);
+            let number = Number(strr);
+            if (isNaN(number)) {
+                let strrr = str.substring(1, str.length);
+            window.location.href =`index.php?act=refill_detail&op=order_dispose&id= ${strrr ? strrr : ''}&type=cancel`
+        
+
+            } else {
             window.location.href =`index.php?act=refill_detail&op=order_dispose&id= ${str ? str : ''}&type=cancel`
-            console.log(str);
-            layer.msg('批量成功', {icon: 1});
 
+            }
+            if (str != '') {
             } else {
                 layer.msg('请还没有任何操作,请先选择');
             }
@@ -300,11 +312,18 @@
                 arr[i] = $(this).val();
             })
             let str = arr.join(",");
-            if (str != '') {
+            let strr = str.substring(0, 1);
+            let number = Number(strr);
+            if (isNaN(number)) {
+                let strrr = str.substring(1, str.length);
+            window.location.href =`index.php?act=refill_detail&op=order_dispose&id= ${strrr ? strrr : ''}&type=anew`
+        
+
+            } else {
             window.location.href =`index.php?act=refill_detail&op=order_dispose&id= ${str ? str : ''}&type=anew`
-            console.log(str);
-            layer.msg('批量成功', {icon: 1});
 
+            }
+            if (str != '') {
             } else {
                 layer.msg('请还没有任何操作,请先选择');
             }

+ 30 - 8
admin/templates/default/refill.order.batch.php

@@ -1,3 +1,13 @@
+<style>
+        .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+</style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 
 <div class="page">
@@ -29,13 +39,13 @@
             <tfoot>
             <tr class="tfoot">
                 <td colspan="15">
-                    <a href="JavaScript:void(0);" class="submitBtn" data-type="success">
+                    <a href="JavaScript:void(0);" class="submitBtn btns" data-type="success">
                         <span>全部手动成功</span>
                     </a>
-                    <a href="JavaScript:void(0);" class="submitBtn" data-type="cancel">
+                    <a href="JavaScript:void(0);" class="submitBtn btns" data-type="cancel">
                         <span>全部手动失败</span>
                     </a>
-                    <a href="JavaScript:void(0);" class="submitBtn" data-type="notify">
+                    <a href="JavaScript:void(0);" class="submitBtn btns" data-type="notify">
                         <span>全部回调</span>
                     </a>
                 </td>
@@ -49,18 +59,30 @@
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
 <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
       id="cssfile2"/>
 <script type="text/javascript">
     $(function () {
         //按钮先执行验证再提交表单
         $(".submitBtn").click(function () {
-            if ($("#user_form").valid()) {
-                const type = $(this).attr('data-type');
-                $("input[name='type']").val(type)
-                $("#user_form").submit();
-            }
+            const txt = $(this).text();
+            const type = $(this).attr('data-type');
+
+            layer.confirm('您确定要'+txt+'吗?', {
+                btn: ['确定', '取消'],
+                title: txt
+            }, function () {
+                if ($("#user_form").valid()) {
+                    console.log(type);
+                    $("input[name='type']").val(type)
+                    $("#user_form").submit();
+                }
+            }, function () {
+            });
         });
+
         $('#user_form').validate({
             errorPlacement: function (error, element) {
                 error.appendTo(element.parent().parent().prev().find('td:first'));

+ 19 - 0
admin/templates/default/refill.order.index.php

@@ -277,6 +277,9 @@
                     <a href="#" class="btns" onclick="hCopyCardNo(event)">
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
                     </a>
+                    <a href="#" class="btns" onclick="hCopyOrderSn(event)">
+                        <span><i class="icon-edit"></i>拷贝订单号码</span>
+                    </a>
                     <a href="#" class="btns" id="10_rder">
                         <span><i class="icon-edit"></i>10分钟订单</span>
                     </a>
@@ -838,4 +841,20 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
+
+    function hCopyOrderSn(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(1).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
 </script> 

+ 8 - 8
test/TestRefill.php

@@ -1755,13 +1755,13 @@ class TestRefill extends TestCase
 
     public function testCtSign()
     {
-        $params['act'] = 'refill';
-        $params['amount'] = 1;
-        $params['cardno'] = 18888888888;
-        $params['mchid'] = 1101;
-        $params['op'] = 'add';
-        $params['notifyurl'] = '';
-        $params['order_sn'] = '1231212';
+        $params['amount'] = '10.00';
+        $params['message'] = '余额不足支付订单';
+        $params['cardno'] = 18345531094;
+        $params['mchid'] = 10197;
+        $params['trade_no'] = '2068550683809271439468';
+        $params['state'] = 'CANCEL';
+        $params['order_sn'] = '20210901110059907C414UF7GCIG9491';
         $sign = $this->md5_sign($params);
     }
 
@@ -1782,7 +1782,7 @@ class TestRefill extends TestCase
             }
         }
 
-        $body .= "&key=E63AFB19FA130AC0E35C5BD1C42470A5";
+        $body .= "&key=bac87b788087457e92a5319413c603a3";
 
         return md5($body);
     }