Browse Source

Merge branch 'raccount' into rchannel

xiaoyu 3 years ago
parent
commit
1ca66ce9fd

+ 1 - 1
admin/control/ordersendlist.php

@@ -322,7 +322,7 @@ class ordersendlistControl extends SystemControl
         }else{
             $order_count = $special_stat[$_GET['store_id']]['order_count'];
         }
-        $order_list = $model_refill_order->getMerchantTimeOut($orders_cond, 200, $order_count, $fields, $order_by);
+        $order_list = $model_refill_order->getMerchantOrderList($orders_cond, 200, $order_count, $fields, $order_by);
         if(!empty($order_list)) {
             $order_list = $this->orderFormat($order_list, $merchant_list);
         }

+ 1 - 1
admin/control/refill_order.php

@@ -275,7 +275,7 @@ class refill_orderControl extends SystemControl
         $title = $input['task_title'] ?? '';
         $manager = new task\manager();
 
-        $cond = ['normal' => $normal_cond,'time_scope' => $time_scope];
+        $cond = ['normal' => $normal_cond,'time_scope' => $time_scope,'export_type'=> $input['export_type']];
 
         $task = $manager->add_task('refill_order_export',$cond,1,-1,$title);
         if ($task->completed() && $task->success()) {

+ 16 - 0
admin/control/refill_order_manual.php

@@ -394,6 +394,13 @@ class refill_order_manualControl extends SystemControl
     public function refill_buybackOp()
     {
         $model_refill_order = Model('refill_order');
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
+        if (!empty($_GET['mchid'])) {
+            $condition['refill_order.mchid'] = $_GET['mchid'];
+        }
+        if (!empty($_GET['store_id'])) {
+            $condition['vr_order.store_id'] = $_GET['store_id'];
+        }
         if(!empty($_GET['card_nos'])) {
             $card_nos = trim($_GET['card_nos'], ',');
             $condition['refill_order.card_no'] = ['in', $card_nos];
@@ -406,6 +413,12 @@ class refill_order_manualControl extends SystemControl
         {
             $condition['manual_type'] = $_GET['manual_type'];
         }
+        $start = intval(strtotime($_GET['query_start_time']));
+        $end = intval(strtotime($_GET['query_end_time']));
+        if ($end <= 0) {
+            $end = time();
+        }
+        $condition['refill_buyback.act_time'] = [['egt', $start], ['lt', $end], 'and'];
         $condition['inner_status'] = 0;
         if(!empty($_GET['export']))
         {
@@ -416,6 +429,9 @@ class refill_order_manualControl extends SystemControl
         $order_list = $model_refill_order->getBuyBackList($condition, 200, 'refill_buyback.*,refill_order.*,vr_order.order_state', 'refill_buyback.act_time desc','',true);
         $order_list = $this->OrderDataFormat($order_list, $merchant_list);
 
+        $provider_list = $this->providers();
+        Tpl::output('provider_list', $provider_list);
+        Tpl::output('merchant_list', $merchant_list);
         Tpl::output('order_list', $order_list);
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage('refill.buyback.order');

+ 209 - 35
admin/templates/default/refill.buyback.order.php

@@ -1,28 +1,146 @@
 <style>
-    th label { display: inline-block;width: 60px; }
+    th label {
+        display: inline-block;
+        width: 60px;
+        margin-left: 10px;
+    }
+
+    .db-right {
+        padding-right: 134px !important;
+        border-bottom: 1px solid #ccc;
+    }
+
+    .db-center {
+        padding: 9px 0;
+        border-bottom: 1px solid #ccc;
+    }
+
+    .db-top {
+        padding: 0 30px;
+    }
+
+    .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;
+    }
+
+    .query_ors {
+        width: 125px;
+    }
+
+    th label {
+        display: inline-block;
+        width: 60px;
+    }
+
     .lineLi {
         min-width: 150px;
         font-size: 12px;
-        color:#000;
+        color: #000;
     }
+
     #prompt ul .noLineLi {
-        background:none; 
+        background: none;
     }
+
     #prompt div {
-        display:inline-block;
-        background:none
+        display: inline-block;
+        background: none
     }
+
     #prompt ul .lineLi {
-        color:#000;
+        color: #000;
     }
+
     #selest_nc {
-        width:220px
+        width: 220px
+    }
+
+    tbody {
+        font-size: 12px;
+    }
+
+    .layui-form-select .layui-input {
+        padding: 13px 5px;
+    }
+
+    .layui-form-selected dl {
+        display: flex !important;
+        flex-wrap: wrap !important;
+    }
+
+    .layui-form-select dl {
+
+        top: 29px !important;
+        min-width: 883% !important;
+        max-height: 280px !important;
+        padding: 14px 0 !important;
+        left: -599px !important;
+    }
+
+    .layui-form-select {
+        width: 45%;
+    }
+
+    .layui-select-title {
+        width: 104%;
+    }
+
+    .layui-form-select .layui-input {
+
+        padding-left: 11px;
     }
-    th {
-        width: 10px;
+
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
     }
-    .txt2 {
-        position: relative;
+
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+
+    .layui-form-select .layui-input {
+        height: 26px;
+    }
+
+    input::placeholder {
+        color: #333;
+    }
+
+    .xm-tips {
+        color: #333 !important;
+        font-size: 12px;
+    }
+
+    .layui-form-select dl dd.layui-this {
+        display: none;
+    }
+
+    .layui-form-select dl dd {
+        cursor: pointer;
+        width: 130px;
+    }
+
+    .tb-type1 td select {
+        width: 201px;
+    }
+
+    .tb-type1 td input[type="text"],
+    .tb-type1 td select {
+        margin-right: 4px;
+        margin-left: 0;
+        width: 195px;
+    }
+
+    .layui-form-select .layui-edge {
+        right: -91px !important;
     }
 </style>
 
@@ -44,19 +162,49 @@
         <input type="hidden" name="act" value="refill_order_manual"/>
         <input type="hidden" name="op" value="refill_buyback"/>
         <input type="hidden" name="export" value=""/>
-        <table class="tb-type1 noborder search" style="min-width:1400px">
-            <tbody>
+        <table class="tb-type1 noborder search">
             <tr>
-                <th><label style="width:122px">订单号(多行查询)</label></th>
-                <td style="width: 227px;">
-                    <textarea name="order_sns" id="order_sns" cols="30" rows="10"><?php echo $_GET['order_sns']; ?></textarea>
+                <th><label for="query_start_time">操作日期</label></th>
+                <td style="width: 327px">
+                    <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 $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px"/>
                 </td>
-                <th><label style="width:122px">充值卡号(多行查询)</label></th>
-                <td style="width: 227px;">
-                    <textarea name="card_nos" id="card_nos" cols="30" rows="10"><?php echo $_GET['card_nos']; ?></textarea>
+                <th><label class="query_ors">供方名称</label></th>
+                <td>
+                    <select name="store_id" class="">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach ($output['provider_list'] as $provider) { ?>
+                            <option value="<?php echo $provider['store_id'] ?>"
+                                    <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>
+                                    data-color="<?php echo $provider['opened'] ?>"
+                                    class="textColor"><?php echo $provider['store_name'] ?>
+                            </option>
+                        <?php } ?>
+                    </select>
                 </td>
+                <th><label class="">客户名称</label></th>
+                <td class="layui-form td_time" style="width: 110px;">
+                    <select name="mchid" class="querySelect" lay-verify="" lay-search>
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach ($output['merchant_list'] as $merchant) { ?>
+                            <option value="<?php echo $merchant['mchid'] ?>"<?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?></option>
+                        <?php } ?>
+                    </select>
+                </td>
+
+            </tr>
+            <tr>
+                <th><label class="query_ors">订单号(多行查询)</label></th>
+                <td><textarea style="width: 324px;" name="order_sns" id="order_sns" cols="30"
+                              rows="10"><?php echo $_GET['order_sns']; ?></textarea></td>
+                <th><label class="query_ors">充值卡号(多行查询)</label></th>
+                <td><textarea name="card_nos" id="card_nos" cols="30"
+                              rows="10"><?php echo $_GET['card_nos']; ?></textarea></td>
                 <th><label>操作类型</label></th>
-                <td style="width:122px">
+                <td>
                     <select name="manual_type">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
                         <option value="buyback"
@@ -68,7 +216,9 @@
                     </select>
                 </td>
                 <td>
-                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
                 </td>
                 <td>
                     <a href="javascript:void(0);" id="ncexport" class="btn">
@@ -76,11 +226,10 @@
                     </a>
                 </td>
             </tr>
-
-            </tbody>
         </table>
     </form>
-    <table class="table tb-type2 nobdb" style="min-width:1400px">
+
+    <table class="table tb-type2 nobdb">
         <thead>
         <tr class="thead">
             <th class="align-center">编号</th>
@@ -101,7 +250,7 @@
             <th class="align-left">操作人</th>
             <th class="align-center">备注</th>
             <!--            <th class="align-center">扣款金额</th>-->
-<!--            <th class="align-center">--><?php //echo $lang['nc_handle']; ?><!--</th>-->
+            <!--            <th class="align-center">--><?php //echo $lang['nc_handle']; ?><!--</th>-->
         </tr>
         </thead>
         <tbody id="tbody">
@@ -150,8 +299,8 @@
         charset="utf-8"></script>
 <link rel="stylesheet" type="text/css"
       href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
-<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.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"/>
 <script type="text/javascript">
     $(function () {
         $('#ncsubmit').click(function () {
@@ -163,13 +312,16 @@
             $('#formSearch').submit();
             $('input[name="export"]').val('');
         })
-        // 表格hover时背景
-        $('.trFlex').each(function () {
-            $(this).hover(function () {
-                $(this)[0].style.backgroundColor = '#cbe9f3'
-            },function() {
-                $(this)[0].style.backgroundColor = '#fff'
-            })
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
         });
         //过滤
         $("#card_nos").blur(function () {
@@ -177,10 +329,32 @@
             let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
             $(this).val(result)
         })
+        $("#mch_orders").blur(function () {
+            let test_mch = $("#mch_orders").val();
+            let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
+            $(this).val(result)
+        })
         $("#order_sns").blur(function () {
             let test_mch = $("#order_sns").val();
             let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
             $(this).val(result)
         })
-    })
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        // 供方名称颜色
+        $('.textColor').each(function () {
+            let color = $(this).attr('data-color')
+            if (color == '1') {
+                $(this).css('color', 'green')
+            } else {
+                $(this).css('color', 'red')
+            }
+        })
+    });
 </script> 

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

@@ -204,6 +204,13 @@
                     <option value="notify_time"
                             <?php if ($_GET['time_type'] == 'notify_time'){ ?>selected<?php } ?>>回调时间</option>
                 </select>
+                    <label>导出对象</label>
+                    <select name="export_type" class="export_type">
+                        <option value="merchant"
+                                <?php if ($_GET['export_type'] == 'merchant'){ ?>selected<?php } ?>>机构</option>
+                        <option value="provider"
+                                <?php if ($_GET['export_type'] == 'provider'){ ?>selected<?php } ?>>上游</option>
+                    </select>
                 </td>
             </tr>
             <tr>

+ 4 - 4
data/config/win/refill.ini.php

@@ -3791,8 +3791,8 @@ $yamiao_high_phone = ['name' => 'yamiao_high', 'store_id' => 171, 'qualitys' =>
             ['goods_id' => 7460, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7460, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [['goods_id' => 7461, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 7462, 'price' => 483, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 7461, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7462, 'price' => 483, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -3820,8 +3820,8 @@ $yamiao_normal_phone = ['name' => 'yamiao_normal', 'store_id' => 172, 'qualitys'
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 4 - 4
data/config/xyz/refill.ini.php

@@ -3791,8 +3791,8 @@ $yamiao_high_phone = ['name' => 'yamiao_high', 'store_id' => 171, 'qualitys' =>
             ['goods_id' => 7460, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7460, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [['goods_id' => 7461, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 7462, 'price' => 483, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 7461, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7462, 'price' => 483, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -3820,8 +3820,8 @@ $yamiao_normal_phone = ['name' => 'yamiao_normal', 'store_id' => 172, 'qualitys'
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 4 - 4
data/config/xyzadm/refill.ini.php

@@ -3791,8 +3791,8 @@ $yamiao_high_phone = ['name' => 'yamiao_high', 'store_id' => 171, 'qualitys' =>
             ['goods_id' => 7460, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7460, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [['goods_id' => 7461, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 7462, 'price' => 483, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 7461, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7462, 'price' => 483, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -3820,8 +3820,8 @@ $yamiao_normal_phone = ['name' => 'yamiao_normal', 'store_id' => 172, 'qualitys'
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

BIN
helper/refill/api/xyz/guochuang/20211230辽宁移动调价函.jpg


+ 1 - 1
helper/refill/api/xyz/guochuang/config.php

@@ -64,7 +64,7 @@ class config
     const Price = [
         //移动
         "4-10-2" => 10.005, "4-20-2" => 20.01, "4-30-2" => 29.91, "4-50-2" => 49.85, "4-100-2" => 99.7, "4-200-2" => 199.4, "4-300-2" => 299.1, "4-500-2" => 498.5,//天津 2
-        "4-10-6" => 9.725, "4-20-6" => 19.45, "4-30-6" => 29.175, "4-50-6" => 48.625, "4-100-6" => 97.25, "4-200-6" => 194.5, "4-300-6" => 291.75, "4-500-6" => 486.25,//辽宁 6
+        "4-10-6" => 9.75, "4-20-6" => 19.5, "4-30-6" => 29.25, "4-50-6" => 48.75, "4-100-6" => 97.5, "4-200-6" => 195, "4-300-6" => 292.5, "4-500-6" => 487.5,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 10.01, "4-20-8" => 20.02, "4-30-8" => 30.03, "4-50-8" => 50.05, "4-100-8" => 100.1, "4-200-8" => 200.2, "4-300-8" => 300.3, "4-500-8" => 500.5,//黑龙江 8
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29

+ 6 - 0
helper/refill/api/xyz/yamiao_high/config.php

@@ -18,16 +18,22 @@ class config
             50  => 100017,
             100 => 100018,
             200 => 100019,
+            300 => 100027,
+            500 => 100028
         ],
         mtopcard\ChinaUnicomCard => [
             50  => 100013,
             100 => 100014,
             200 => 100015,
+            300 => 100029,
+            500 => 100030
         ],
         mtopcard\ChinaTelecomCard => [
             50  => 100021,
             100 => 100022,
             200 => 100023,
+            300 => 100031,
+            500 => 100032
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 9 - 1
helper/refill/api/xyz/yamiao_high/开户信息.txt

@@ -17,9 +17,17 @@ appSecret:hKrUYACaqlTAsMFR
 100017   移动50
 100018   移动100
 100019   移动200
+100027   移动300
+100028   移动500
+
 100013   联通50
 100014   联通100
 100015   联通200
+100029  联通300
+100030  联通500
+
 100021   电信50
 100022   电信100
-100023   电信200
+100023   电信200
+100031  电信300
+100032  电信500

+ 6 - 0
helper/refill/api/xyz/yamiao_normal/config.php

@@ -18,16 +18,22 @@ class config
             50  => 100017,
             100 => 100018,
             200 => 100019,
+            300 => 100027,
+            500 => 100028
         ],
         mtopcard\ChinaUnicomCard => [
             50  => 100013,
             100 => 100014,
             200 => 100015,
+            300 => 100029,
+            500 => 100030
         ],
         mtopcard\ChinaTelecomCard => [
             50  => 100021,
             100 => 100022,
             200 => 100023,
+            300 => 100031,
+            500 => 100032
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 9 - 1
helper/refill/api/xyz/yamiao_normal/开户信息.txt

@@ -17,9 +17,17 @@ appSecret:YQzkPPONeQBuoyFH
 100017   移动50
 100018   移动100
 100019   移动200
+100027   移动300
+100028   移动500
+
 100013   联通50
 100014   联通100
 100015   联通200
+100029  联通300
+100030  联通500
+
 100021   电信50
 100022   电信100
-100023   电信200
+100023   电信200
+100031  电信300
+100032  电信500

+ 11 - 3
helper/task/handler.php

@@ -82,6 +82,7 @@ class handler
 
         $normal_cond = $cond['normal'];
         $time_scope = $cond['time_scope'];
+        $export_type = $cond['export_type'];
 
         $order_reader = function ($normal_cond,$time_scope) use ($tmcond_gen)
         {
@@ -112,7 +113,7 @@ class handler
                 {
                     $start = $i * $len;
                     $items = $mod->table('refill_order,vr_order')
-                        ->field('refill_order.*,vr_order.order_state')
+                        ->field('refill_order.*,vr_order.order_state,vr_order.store_name')
                         ->join('inner')
                         ->on('refill_order.order_id=vr_order.order_id')
                         ->where($cond)
@@ -130,8 +131,15 @@ class handler
         };
 
         $merchants = [];
-        $column_values = ['商户号', '商户订单号', '平台单号','面额', '充值卡号', '充值卡类型', '是否转网', '下单日期', '完成日期', '订单状态', '扣款金额'];
-        $data_keys = ['mchid', 'mch_order', 'order_sn', 'refill_amount', 'card_no', 'card_type_text', 'is_transfer_text', 'order_time_text', 'notify_time_text','order_state_text', 'mch_amount'];
+        $column_values = ['平台单号','面额', '充值卡号', '充值卡类型', '是否转网', '下单日期', '完成日期', '订单状态'];
+        $data_keys = ['order_sn', 'refill_amount', 'card_no', 'card_type_text', 'is_transfer_text', 'order_time_text', 'notify_time_text','order_state_text'];
+        if($export_type === 'merchant') {
+            $column_values = array_merge(['商户号', '商户订单号'], $column_values, ['扣款金额']);
+            $data_keys = array_merge(['mchid', 'mch_order'], $data_keys, ['mch_amount']);
+        }elseif ($export_type === 'provider') {
+            $column_values = array_merge(['上游名称', '上游订单号'], $column_values, ['折扣金额']);
+            $data_keys = array_merge(['store_name', 'ch_trade_no'], $data_keys, ['channel_amount']);
+        }
         $merchant_list = Model('')->table('merchant')->limit(1000)->order('company_name asc')->select();
         foreach ($merchant_list as $value) {
             $merchants[$value['mchid']] = $value;

+ 21 - 0
test/TestRefillClear.php

@@ -133,6 +133,27 @@ class TestRefillClear extends TestCase
         $this->clear($start_date,$end_date);
     }
 
+    //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillClear::testDecember1)( .*)?$/" --test-suffix TestRefillClear.php /var/www/html/test
+    public function testDecember1()
+    {
+        $start_date = strtotime('2021-12-01');
+        $end_date   = strtotime('2021-12-03');
+        $this->clear($start_date,$end_date);
+    }
+    //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillClear::testDecember2)( .*)?$/" --test-suffix TestRefillClear.php /var/www/html/test
+    public function testDecember2()
+    {
+        $start_date = strtotime('2021-12-03');
+        $end_date   = strtotime('2021-12-05');
+        $this->clear($start_date,$end_date);
+    }
+    //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillClear::testDecember3)( .*)?$/" --test-suffix TestRefillClear.php /var/www/html/test
+    public function testDecember3()
+    {
+        $start_date = strtotime('2021-12-05');
+        $end_date   = strtotime('2021-12-07');
+        $this->clear($start_date,$end_date);
+    }
 
     private function clear($start_date, $end_date)
     {