فهرست منبع

Merge branch 'ralbex' into rtest

xiaoyu 3 سال پیش
والد
کامیت
43000ee94b

+ 3 - 3
admin/control/merchant.php

@@ -486,7 +486,7 @@ class merchantControl extends SystemControl
         $apply_id = intval($_GET['apply_id']);
         if ($apply_id > 0) {
             $model_merchant = Model('merchant');
-            $evidence_info = $model_merchant->getRefillEvidenceInfo(['apply_id' => $apply_id], '*');
+            $evidence_info = $model_merchant->getRefillEvidenceInfo(['apply_id' => $apply_id], '*', true);
             if (empty($evidence_info)) {
                 showMessage('充值申请不存在');
             }
@@ -675,7 +675,7 @@ class merchantControl extends SystemControl
         $apply_id = intval($_POST['apply_id']);
         $model_merchant = Model('merchant');
         $receive_bank = $_POST['receive_bank'] ?? 0;
-        $evidence_info = $model_merchant->getRefillEvidenceInfo(['apply_id' => $apply_id], '*');
+        $evidence_info = $model_merchant->getRefillEvidenceInfo(['apply_id' => $apply_id], '*', true);
         if (!is_array($evidence_info) || count($evidence_info) <= 0) {
             showMessage("无效的充值申请信息", "index.php?act=merchant&op=recharge&apply_id={$apply_id}", '', 'error');
         }
@@ -688,7 +688,7 @@ class merchantControl extends SystemControl
         //查询会员信息
         $obj_member = Model('member');
         $member_id = intval($evidence_info['member_id']);
-        $member_info = $obj_member->getMemberInfo(['member_id' => $member_id]);
+        $member_info = $obj_member->getMemberInfo(['member_id' => $member_id], '*', true);
 
         $available_predeposit = floatval($member_info['available_predeposit']);
         $freeze_predeposit = floatval($member_info['freeze_predeposit']);

+ 7 - 2
admin/control/order_search.php

@@ -13,6 +13,12 @@ class order_searchControl extends SystemControl
         $model_refill_order = Model('refill_order');
         $order_list = [];
         $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
+
+        if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40']))
+        {
+            $condition['vr_order.order_state'] = $_GET['order_state'];
+        }
+
         //批量查询,二者都有,以卡号为主
         if(!empty($_GET['card_nos'])) {
             $card_nos = trim($_GET['card_nos'], ',');
@@ -20,9 +26,8 @@ class order_searchControl extends SystemControl
         } elseif (!empty($_GET['mch_orders'])) {
             $mch_orders = rtrim($_GET['mch_orders'], ',');
             $condition['refill_order.mch_order'] = ['in', $mch_orders];
-        } else {
-            $condition = [];
         }
+
         if(!empty($condition)) {
             $condition['refill_order.inner_status'] = 0;
 

+ 27 - 11
admin/control/refill_detail.php

@@ -13,24 +13,24 @@ class refill_detailControl extends SystemControl
     {
         $mod = Model('refill_detail');
         $condition = [];
-        $_POST['query_start_time'] = $_POST['query_start_time'] ?? date("Y-m-d 00:00:00");
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
         $order_state_send = ORDER_STATE_SEND;
         $order_state_queue = ORDER_STATE_QUEUE;
         $order_state_handled = ORDER_STATE_HANDLED;
         $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue},{$order_state_handled}"];
-        if(!empty($_POST['mchid'])) {
-            $condition['mchid'] = $_POST['mchid'];
+        if(!empty($_GET['mchid'])) {
+            $condition['mchid'] = $_GET['mchid'];
         }
-        if(in_array($_POST['order_state'], [$order_state_send,$order_state_queue,$order_state_handled])) {
-            $condition['order_state'] = $_POST['order_state'];
+        if(in_array($_GET['order_state'], [$order_state_send,$order_state_queue,$order_state_handled])) {
+            $condition['order_state'] = $_GET['order_state'];
         }
-        if (!empty($_POST['mch_orders'])) {
-            $mch_orders = rtrim($_POST['mch_orders'],',');
+        if (!empty($_GET['mch_orders'])) {
+            $mch_orders = rtrim($_GET['mch_orders'],',');
             $condition['mch_order'] = ['in', $mch_orders];
         }
 
-        $start_unixtime = intval(strtotime($_POST['query_start_time']));
-        $end_unixtime = intval(strtotime($_POST['query_end_time']));
+        $start_unixtime = intval(strtotime($_GET['query_start_time']));
+        $end_unixtime = intval(strtotime($_GET['query_end_time']));
         if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
             $condition['order_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
         } elseif ($start_unixtime > 0) {
@@ -48,7 +48,7 @@ class refill_detailControl extends SystemControl
             $merchants[$value['mchid']] = $value;
         }
 
-        if($_POST['export'] == 1) {
+        if($_GET['export'] == 1) {
             $this->RefillDetailExport($condition,$merchants);
             exit;
         }else{
@@ -166,7 +166,8 @@ class refill_detailControl extends SystemControl
                     } elseif ($detail['order_state'] == ORDER_STATE_QUEUE) {
                         util::push_add_zero($params);
                     }
-                } elseif ($type == 'anew') {
+                }
+                elseif ($type == 'anew') {
                     //重新补充
                     Log::record("anew",Log::DEBUG);
                     util::push_add($params);
@@ -180,4 +181,19 @@ class refill_detailControl extends SystemControl
         }
         showMessage('操作成功','index.php?act=refill_detail&op=index');
     }
+
+    public function DelQueueOrderOp()
+    {
+        $id = $_GET['id'];
+        $condition['detail_id'] = ['in',$id];
+        $refill_detail = Model('refill_detail')->where($condition)->select();
+
+        foreach ($refill_detail as $detail)
+        {
+            $mchid = $detail['mchid'];
+            $mch_order = $detail['mch_order'];
+            util::del_queue_order($mchid,$mch_order);
+        }
+        showMessage('操作成功','index.php?act=refill_detail&op=index');
+    }
 }

+ 85 - 84
admin/templates/default/refill.detail.php

@@ -79,7 +79,7 @@
         </div>
     </div>
     <div class="fixed-empty"></div>
-    <form method="post" action="index.php" name="formSearch" id="formSearch">
+    <form method="get" action="index.php" name="formSearch" id="formSearch">
         <input type="hidden" name="act" value="refill_detail"/>
         <input type="hidden" name="op" value="index"/>
         <table class="tb-type1 noborder search">
@@ -90,7 +90,7 @@
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
                         <?php foreach ($output['merchant_list'] as $merchant) { ?>
                             <option value="<?php echo $merchant['mchid'] ?>"
-                                    <?php if ($_POST['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?>
+                                    <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?>
                             </option>
                         <?php } ?>
                     </select>
@@ -98,15 +98,15 @@
 
                 <th><label for="query_start_time">下单时间</label></th>
                 <td>
-                    <input class="txt date" type="text" value="<?php echo $_POST['query_start_time']; ?>"
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
                            id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
                     <label for="query_start_time">~</label>
-                    <input class="txt date" type="text" value="<?php echo $_POST['query_end_time']; ?>"
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
                            id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
 
                 <th><label class="query_ors">商家单号(多行查询)</label></th>
-                <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_POST['mch_orders'];?></textarea></td>
+                <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_GET['mch_orders'];?></textarea></td>
 
                 <th><label>订单状态</label></th>
                 <td>
@@ -114,13 +114,13 @@
                     <select name="order_state" class="querySelect">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
                         <option value="<?php echo ORDER_STATE_SEND;?>"
-                                <?php if ($_POST['order_state'] == ORDER_STATE_SEND){ ?>selected<?php } ?>>待收货
+                                <?php if ($_GET['order_state'] == ORDER_STATE_SEND){ ?>selected<?php } ?>>待收货
                         </option>
                         <option value="<?php echo ORDER_STATE_QUEUE;?>"
-                                <?php if ($_POST['order_state'] == ORDER_STATE_QUEUE){ ?>selected<?php } ?>>队列中
+                                <?php if ($_GET['order_state'] == ORDER_STATE_QUEUE){ ?>selected<?php } ?>>队列中
                         </option>
                         <option value="<?php echo ORDER_STATE_HANDLED;?>"
-                                <?php if ($_POST['order_state'] == ORDER_STATE_HANDLED){ ?>selected<?php } ?>>已处理
+                                <?php if ($_GET['order_state'] == ORDER_STATE_HANDLED){ ?>selected<?php } ?>>已处理
                         </option>
                     </select>
                 </td>
@@ -146,6 +146,9 @@
                     <a href="#" class="btns" id="hSupplement">
                         <span><i class="icon-edit"></i>批量补充</span>
                     </a>
+                    <a href="#" class="btns" id="hdelqueue">
+                        <span><i class="icon-edit"></i>清除queue</span>
+                    </a>
                 </td>
             </tr>
         </table>
@@ -266,77 +269,85 @@
            var result = test_mch.replace(/[\  \r\n\,]+/g, ",");
                 $(this).val(result)
             })
-            
-            //批量
-            $('#hFail').click(function () {
-                layer.confirm('您确定要批量失败', {
-                btn: ['确定','取消'],
-                title:'批量失败'
-            }, function(){
-
-
-             let arr = [];
-            $("input:checkbox:checked").each(function (i) {
-                arr[i] = $(this).val();
-            })
-            let str = arr.join(",");
-            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`
-
-            }
-            if (str != '') {
-            } else {
-                layer.msg('请还没有任何操作,请先选择');
-            }
 
-		
-
-            }, function(){
+        //批量
+        $('#hFail').click(function () {
+            layer.confirm('您确定要批量失败', {
+                btn: ['确定', '取消'],
+                title: '批量失败'
+            }, function () {
+                let arr = [];
+                $("input:checkbox:checked").each(function (i) {
+                    arr[i] = $(this).val();
+                })
+                let str = arr.join(",");
+                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 if(!isNaN(number) && str !== '') {
+                    window.location.href = `index.php?act=refill_detail&op=order_dispose&id= ${str ? str : ''}&type=cancel`
+                } else {
+                    layer.msg('请还没有任何操作,请先选择');
+                }
+            }, function () {
             });
-            })
-
-                        //批量
-                $('#hSupplement').click(function () {
-                layer.confirm('您确定要批量补充', {
-                btn: ['确定','取消'],
-                title:'批量失败'
-            }, function(){
-
-
-             let arr = [];
-            $("input:checkbox:checked").each(function (i) {
-                arr[i] = $(this).val();
-            })
-            let str = arr.join(",");
-            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`
-
-            }
-            if (str != '') {
-            } else {
-                layer.msg('请还没有任何操作,请先选择');
-            }
+        })
 
-		
+        //批量
+        $('#hSupplement').click(function () {
+            layer.confirm('您确定要批量补充', {
+                btn: ['确定', '取消'],
+                title: '批量失败'
+            }, function () {
+                let arr = [];
+                $("input:checkbox:checked").each(function (i) {
+                    arr[i] = $(this).val();
+                })
+                let str = arr.join(",");
+                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 if(!isNaN(number) && str !== '') {
+                    window.location.href = `index.php?act=refill_detail&op=order_dispose&id= ${str ? str : ''}&type=anew`
+                } else {
+                    layer.msg('请还没有任何操作,请先选择');
+                }
+            }, function () {
+            });
+        })
 
-            }, function(){
+        //批量
+        $('#hdelqueue').click(function () {
+            layer.confirm('您确定要清除queue', {
+                btn: ['确定', '取消'],
+                title: '批量失败'
+            }, function () {
+                let arr = [];
+                $("input:checkbox:checked").each(function (i) {
+                    arr[i] = $(this).val();
+                })
+                let str = arr.join(",");
+                let strr = str.substring(0, 1);
+                let number = Number(strr);
+                if (isNaN(number) && str !== '') {
+                    let strrr = str.substring(1, str.length);
+                    console.log(strrr);
+                    window.location.href = `index.php?act=refill_detail&op=DelQueueOrder&id= ${strrr}`
+                } 
+                else if(!isNaN(number) && str !== '') {
+                    console.log(str);
+                    window.location.href = `index.php?act=refill_detail&op=DelQueueOrder&id= ${str}`
+                }
+                 else {
+                    layer.msg('请还没有任何操作,请先选择');
+                }
+            }, function () {
             });
-            })
-      
+        })
 
         // 表格hover时背景
         $('.trFlex').each(function () {
@@ -381,14 +392,4 @@
         oInput.parentNode.removeChild(oInput)
     }
 
-    //批量补充
-    // function hSupplement(e) {
-    //     layer.confirm('您确定要批量补充', {
-    //     btn: ['确定','取消'],
-    //     title:'批量补充'
-    // }, function(){
-    //     layer.msg('1', {icon: 1});
-    // }, function(){
-    // });
-    // }
 </script> 

+ 18 - 0
admin/templates/default/refill.order.search.php

@@ -64,6 +64,24 @@
                 </td>
             </tr>
             <tr>
+                <th><label>订单状态</label></th>
+                <td>
+                    <select name="order_state" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10"
+                                <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
+                        <option value="20"
+                                <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
+                        <option value="30"
+                                <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
+                        <option value="40"
+                                <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
+                        <option value="0"
+                                <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
+                    </select>
+                </td>
+            </tr>
+            <tr>
                 <td></td>
                 <td>
                     <a href="#" class="btns" onclick="hCopyCardNo(event)">

+ 1 - 1
test/TestRefill.php

@@ -942,7 +942,7 @@ class TestRefill extends TestCase
 
     public function testXiaoniu()
     {
-        $providers = new refill\xiaoniu\RefillOil([]);
+        $providers = $this->getProvider('xiaoniu','RefillOil');
 //        $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 500, ['order_sn' => $this->make_sn()]);
 //        $resp = $providers->query(['order_sn' => '39911625819031601073']);
 //        $data = '{"content":"\u3010\u4e2d\u56fd\u77f3\u5316\u3011\u60a8\u5c3e\u53f7\u4e3a211884\u7684\u52a0\u6cb9\u5361\u4e8e07\u670809\u65e5 16\u65f630\u5206\u5145\u503c\u6210\u529f,\u91d1\u989d500\u5143,\u8ba2\u5355\u53f7:2521070916304172","realAmt":"490.0000","status":"1","timestamp":"20210709163042","sign":"110aaae89243c9ed2d6aa4d753597224","orderNo":"XN20210709162351796707722","mOrderNo":"39911625819031601073"}';