Ver código fonte

Merge branch 'raccount' into relectric

stanley-king 2 anos atrás
pai
commit
b59f1a09d6
33 arquivos alterados com 885 adições e 156 exclusões
  1. 5 3
      admin/control/orderstats.php
  2. 45 22
      admin/control/refill_order_manual.php
  3. 10 1
      admin/control/task.php
  4. 62 39
      admin/templates/default/merchant.refill.balance.php
  5. 61 14
      admin/templates/default/provider.refill.balance.php
  6. 13 2
      admin/templates/default/refill.task.php
  7. 58 48
      admin/templates/default/system.refill.balance.php
  8. 30 0
      admin/templates/default/transfer.order.php
  9. 29 0
      admin/templates/default/transfer.order.recharge.php
  10. 12 4
      core/framework/libraries/log.php
  11. 3 0
      crontab/control/minutes.php
  12. 1 0
      crontab/index.php
  13. 1 0
      data/config/win/base.ini.php
  14. 93 0
      data/config/yl/refill.ini.php
  15. BIN
      helper/refill/api/xyz/guochuang/20220603天津移动调价函.png
  16. BIN
      helper/refill/api/xyz/guochuang/20220606内蒙古移动调价函.png
  17. 2 2
      helper/refill/api/xyz/guochuang/config.php
  18. 2 2
      helper/refill/api/yl/guochuang/config.php
  19. 1 1
      helper/refill/api/yl/yuke/RefillCallBack.php
  20. 53 0
      helper/refill/api/yl/yuke_dx/RefillCallBack.php
  21. 142 0
      helper/refill/api/yl/yuke_dx/RefillPhone.php
  22. 7 0
      helper/refill/api/yl/yuke_dx/api.txt
  23. 15 0
      helper/refill/api/yl/yuke_dx/config.php
  24. BIN
      helper/refill/api/yl/yuke_dx/充值服务接入文档v2.4.docx
  25. 53 0
      helper/refill/api/yl/yuke_lt/RefillCallBack.php
  26. 142 0
      helper/refill/api/yl/yuke_lt/RefillPhone.php
  27. 7 0
      helper/refill/api/yl/yuke_lt/api.txt
  28. 15 0
      helper/refill/api/yl/yuke_lt/config.php
  29. BIN
      helper/refill/api/yl/yuke_lt/充值服务接入文档v2.4.docx
  30. 7 16
      helper/statistics/refill_balance.php
  31. 2 0
      test/TestRefillBalance.php
  32. 2 2
      test/TestRefillClearYL.php
  33. 12 0
      test/TestRefillYl.php

+ 5 - 3
admin/control/orderstats.php

@@ -198,9 +198,9 @@ class orderstatsControl extends SystemControl
 
         $condition = ['end' => $end_unixtime];
 
-        $end_txt = date("Y-m-d H:i:s");
+        $end_txt = date("Y-m-d",$end_unixtime);
         $manager = new task\manager();
-        $task = $manager->add_task('refill_balance_stat_all',$condition,1,-1,"对账统计-{$end_txt}");
+        $task = $manager->add_task('refill_balance_stat_all',$condition,1,-1,"{$end_txt}-对账统计");
         if ($task->completed() && $task->success()) {
             exit(json_encode(['code' => true, 'msg' => '操作成功,此记录已新建成功。']));
         } else {
@@ -301,9 +301,11 @@ class orderstatsControl extends SystemControl
         $accumulate_balance = $_POST['accumulate_balance'] ?? 0;
         $balance = $_POST['balance'] ?? 0;
         $remark = $_POST['remark'] ?? '';
+        $transfer_in = $_POST['transfer_in'] ?? 0;
+        $transfer_out = $_POST['transfer_out'] ?? 0;
 
         $update = [
-            'success_count' => $success_count,
+            'success_count' => $success_count, 'transfer_in' => $transfer_in, 'transfer_out' => $transfer_out,
             'refill_amount' => $refill_amount, 'mch_amount' => $mch_amount, 'channel_amount' => $channel_amount,
             'profit_amount' => $profit_amount, 'refund_amount' => $refund_amount, 'except_amount' => $except_amount,
             'accumulate_balance' => $accumulate_balance, 'balance' => $balance, 'remark' => $remark

+ 45 - 22
admin/control/refill_order_manual.php

@@ -172,7 +172,7 @@ class refill_order_manualControl extends SystemControl
         }
 
         $model_refill_order = Model('refill_order');
-        $orders = $model_refill_order->getMerchantOrderList($cond,'',0,'refill_order.*,vr_order.order_state,vr_order.buyer_id,vr_order.store_id','refill_order.order_id desc',2000);
+        $orders = $model_refill_order->getMerchantOrderList($cond,'',0,'refill_order.*,vr_order.order_state,vr_order.buyer_id,vr_order.store_id,vr_order.goods_id','refill_order.order_id desc',2000);
         if(empty($orders)) {
             showMessage('操作数据为空');
         }
@@ -256,6 +256,7 @@ class refill_order_manualControl extends SystemControl
             $provider_amount = [];
             foreach ($orders as $order)
             {
+                $cbproxy = false;
                 $order_id = intval($order['order_id']);
                 if (algorithm::binary_search($buyback_ids, $order_id)) continue;
 
@@ -266,9 +267,15 @@ class refill_order_manualControl extends SystemControl
                 $store_id = $order['store_id'];
                 $provider_info = $providers[$store_id];
                 $account_id = $provider_info['account_id'];
-                if (empty($mchid) || empty($buyer_id) || empty($store_id) || empty($account_id)) {
-                    Log::record("refill order manual err order_id:{$order_id}, order_sn:{$order['order_sn']}");
-                    continue;
+
+                if (empty($mchid) || empty($buyer_id) || empty($store_id) || empty($account_id))
+                {
+                    if ($order['channel_name'] === 'cbproxy' && $order['goods_id'] == ZERO_GOODS_ID) {
+                        $cbproxy = true;
+                    } else {
+                        Log::record("refill order manual err order_id:{$order_id}, order_sn:{$order['order_sn']}");
+                        continue;
+                    }
                 }
 
                 try
@@ -300,11 +307,12 @@ class refill_order_manualControl extends SystemControl
                         }
                     }
 
-                    if($ret)
+                    if($ret && !$cbproxy)
                     {
                         $provider_bz = "通道:{$store_id},椰子单号:{$order['order_sn']},卡号:{$order['card_no']},返销退款:{$order['channel_amount']}";
                         $this->credit_save_money($order['channel_amount'], 'add', $account_id, $provider_bz);
-                        if($merge > 0) {
+                        if ($merge > 0)
+                        {
                             $provider_amount['store_id'] = $store_id;
                             if (!array_key_exists('channel_amount', $provider_amount)) {
                                 $provider_amount['channel_amount'] = $order['channel_amount'];
@@ -313,7 +321,7 @@ class refill_order_manualControl extends SystemControl
                                 $provider_amount['channel_amount'] += $order['channel_amount'];
                                 $provider_amount['count'] += 1;
                             }
-                        }else{
+                        } else {
                             $this->ct_provider_amount(['channel_amount' => $order['channel_amount']], $provider_info, $cur_time, $admininfo);
                         }
                     }
@@ -372,27 +380,30 @@ class refill_order_manualControl extends SystemControl
         $condition = [];
         $order_list = [];
         $mch_orderData = [];
+
         if(!empty($_GET['mchid'])) {
             $condition['mchid'] = $_GET['mchid'];
         }
         if (!empty($_GET['mch_orders'])) {
             $mch_orders = rtrim($_GET['mch_orders'],',');
             $condition['mch_order'] = ['in', $mch_orders];
-
         }
+
         $merchant_list = $this->merchants();
-        if(!empty($condition)) {
+        if (!empty($condition))
+        {
             $condition['inner_status'] = 0;
-            $order_list = $mod->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+            $order_list = $mod->getMerchantOrderList($condition, 200, 0, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
             $order_list = $this->OrderDataFormat($order_list, $merchant_list);
-            if(empty($mch_orders)) {
+            if (empty($mch_orders)) {
                 $mch_orderData = [];
-            }else{
-                $mch_orderData = explode(',',$mch_orders);
+            } else {
+                $mch_orderData = explode(',', $mch_orders);
             }
+
             foreach ($order_list as $order_id => $order) {
                 $mch_order = $order['mch_order'];
-                if(in_array($mch_order, $mch_orderData)) {
+                if (in_array($mch_order, $mch_orderData)) {
                     $key = array_search($mch_order, $mch_orderData);
                     unset($mch_orderData[$key]);
                 }
@@ -440,6 +451,7 @@ class refill_order_manualControl extends SystemControl
         $mod = Model('refill_order');
         $cur_time = time();
         $start_day = $cur_time - 86400 * 2;
+        $end_day = $cur_time;
 
         if (!empty($input['mch_orders'])) {
             $mch_orders = rtrim($input['mch_orders'],',');
@@ -468,13 +480,19 @@ class refill_order_manualControl extends SystemControl
         else {
             return [];
         }
+        if(!empty($input['query_start_time'])) {
+            $start_day = strtotime($input['query_start_time']);
+        }
+        if(!empty($input['query_end_time'])) {
+            $end_day = strtotime($input['query_end_time']);
+        }
 
-//        $condition['vr_order.add_time&vr_order.add_time'] = ['_multi' => true,
-//            ['egt', $start_day],
-//            ['lt', $cur_time]];
-//        $condition['refill_order.order_time&refill_order.order_time'] = ['_multi' => true,
-//            ['egt', $start_day],
-//            ['lt', $cur_time]];
+        $condition['vr_order.add_time&vr_order.add_time'] = ['_multi' => true,
+            ['egt', $start_day],
+            ['lt', $end_day]];
+        $condition['refill_order.order_time&refill_order.order_time'] = ['_multi' => true,
+            ['egt', $start_day],
+            ['lt', $end_day]];
 
         $merchant_list = $this->merchants(['mchid' => ['in', $mchids]]);
         $order_list = $mod->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
@@ -618,8 +636,13 @@ class refill_order_manualControl extends SystemControl
         $input['mch_name'] = $merchant_info['name'];
         $input['member_id'] = $merchant_info['admin_id'];
         $input['amount'] = $params['mch_amount'];
-        $input['bank_username'] = '椰子';
-        $input['bank_name'] = '椰子退款';
+        if(ADMIN_NAME === 'YEZI') {
+            $input['bank_username'] = '椰子';
+            $input['bank_name'] = '椰子退款';
+        }else{
+            $input['bank_username'] = '椰林';
+            $input['bank_name'] = '椰林退款';
+        }
         $input['bz'] = $params['bz'];
         $input['voucher_name'] = '/';
         $input['status'] = 2;

+ 10 - 1
admin/control/task.php

@@ -4,7 +4,13 @@
 class taskControl extends SystemControl
 {
     private $task_type = [
-        'refill_order_export' => '订单导出'
+        'refill_order_stat' => '24小时内订单统计',
+        'refill_order_stat_ex' => '大于24小时订单统计',
+        'refill_order_export' => '订单导出',
+        'order_stat_reload' => '对账重新统计',
+        'refill_balance_create' => '结余记录生成',
+        'refill_balance_rebuild' => '结余记录重新生成',
+        'refill_balance_stat_all' => '结余记录统计'
     ];
 
     private $task_state = [
@@ -32,6 +38,9 @@ class taskControl extends SystemControl
         if(!empty($_GET['state'])) {
             $condition['state'] = $_GET['state'];
         }
+        if(in_array($_GET['is_show'], ['0', '1'])) {
+            $condition['is_show'] = $_GET['is_show'];
+        }
         $task_list = $model->getList($condition, 50);
         foreach ($task_list as $key => $value) {
             $task_list[$key]['condition'] = unserialize($value['task_params']);

+ 62 - 39
admin/templates/default/merchant.refill.balance.php

@@ -274,8 +274,6 @@
                                 <td class="align-center"><?php echo $output['order_time_type_text'][$v['time_type']]; ?></td>
                                 <td class="align-center"><?php echo $v['remark']; ?></td>
                                 <td style="text-align: center;color:#0D93BF;">
-                                    <a href="javascript:void(0);" class="item_create_btn" style="color:#0D93BF;">新建</a>
-                                    <span> | </span>
                                     <a href="javascript:void(0);" class="handleBtn" data-index="<?php echo $k ?>" style="color:#0D93BF;">编辑</a>
                                     <span>|</span>
                                     <a style="margin:0 5px;color:#0D93BF;" href="index.php?act=orderstats&op=refill_balance_rebuild&balance_id=<?php echo $v['balance_id']; ?>" data-index="<?php echo $k ?>" class="rebuildBtn">重新生成</a>
@@ -593,13 +591,39 @@
         })
 
 
-
         $('.handleBtn').on('click', function() {
             var index = $(this).attr('data-index');
             var data = stats_list_data[index];
+            console.log('data', data)
             layui.use(['form', 'layer', 'laydate'], function() {
                 var layer = layui.layer;
                 var form = layui.form;
+                const transfer_detail_data = [];
+                Object.keys(data.transfer_detail_data).map(key => {
+                    transfer_detail_data.push(data.transfer_detail_data[key])
+                })
+                console.log('transfer_detail_data', transfer_detail_data)
+                let transferDetailHTML = '';
+                for (let i = 0; i < transfer_detail_data.length; i++) {
+                    if (i % 3 == 0) {
+                        transferDetailHTML += `<div class="layui-form-item">`
+                    }
+                    transferDetailHTML += `
+                            <div class="layui-inline">
+                                <label class="layui-form-label">${transfer_detail_data[i].name}</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" value="${transfer_detail_data[i].amount}" disabled style="height:38px;" required  lay-verify="required" autocomplete="off" class="layui-input">
+                                </div>
+                            </div>
+                        `
+                    if (i % 3 == 2 || i == transfer_detail_data.length - 1) {
+                        transferDetailHTML += `</div> `
+                    }
+                }
+
+
+
+
                 layer.confirm(`
                     <div>
                         <form id="editStatDataForm" class="layui-form" method="post" action="index.php?act=Orderstats&op=refill_balance_edit">
@@ -620,15 +644,17 @@
                                         <input type="text" value="${data.refill_amount}" style="height:38px;" name="refill_amount" required  lay-verify="required" placeholder="成功金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">下游金额:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.mch_amount}" style="height:38px;" name="mch_amount" required  lay-verify="required" placeholder="下游金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+                            </div>
+
+                            <div class="layui-form-item">
+                              
 
                                <div class="layui-inline">
                                     <label class="layui-form-label">上游金额:</label>
@@ -636,9 +662,7 @@
                                         <input type="text" value="${data.channel_amount}" style="height:38px;" name="channel_amount" required  lay-verify="required" placeholder="上游金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">利润:</label>
                                     <div class="layui-input-inline">
@@ -646,40 +670,56 @@
                                     </div>
                                </div>
 
+
                                <div class="layui-inline">
-                                    <label class="layui-form-label">返销金额:</label>
+                                    <label class="layui-form-label">银行转入:</label>
                                     <div class="layui-input-inline">
-                                        <input type="text" value="${data.refund_amount}" style="height:38px;" name="refund_amount" required  lay-verify="required" placeholder="返销金额" autocomplete="off" class="layui-input">
+                                        <input type="text" value="${data.transfer_in}" style="height:38px;" name="transfer_in" required  lay-verify="required" placeholder="银行转入" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+
+                               
                             </div>
 
                             <div class="layui-form-item">
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">银行转出:</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" value="${data.transfer_out}" style="height:38px;" name="transfer_out" required  lay-verify="required" placeholder="银行转出" autocomplete="off" class="layui-input">
+                                    </div>
+                               </div>
+                               <div class="layui-inline">
+                                    <label class="layui-form-label">返销金额:</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" value="${data.refund_amount}" style="height:38px;" name="refund_amount" required  lay-verify="required" placeholder="返销金额" autocomplete="off" class="layui-input">
+                                    </div>
+                               </div>
                                <div class="layui-inline">
                                     <label class="layui-form-label">异常金额:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.except_amount}" style="height:38px;" name="except_amount" required  lay-verify="required" placeholder="异常金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+                            </div>
 
+                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">累计结余:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.accumulate_balance}" style="height:38px;" name="accumulate_balance" required  lay-verify="required" placeholder="累计结余" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">本次结余:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.balance}" style="height:38px;" name="balance" required  lay-verify="required" placeholder="本次结余" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-
-                               
                             </div>
+                             
+                            
+                            
 
                             <div class="layui-form-item">
                                 <div class="layui-block">
@@ -688,42 +728,25 @@
                                         <input type="text" value="${data.remark}" style="width:525px;height:38px;" name="remark" required  lay-verify="required" placeholder="备注" autocomplete="off" class="layui-input">
                                     </div>
                                 </div>
-                            </div>  
+                            </div>
+
+                            <div style="height:1px;border-top: 1px dotted #CBE9F3;margin-bottom:15px;"></div>
+
+                            ${transferDetailHTML}
+
                         </form>
                     </div>`, {
-                    area: '800px',
+                    area: '1200px',
                     title: '编辑'
                 }, function(index) {
                     $('#editStatDataForm').submit();
                 })
-                // layer.open({
-                //     area: '500px',
-                //     type: 1,
-                //     title: '编辑',
-                //     content: 
-                // })
                 form.render();
-                // laydate.render({
-                //     elem: '#editItemStartDate',
-                //     type: 'datetime',
-                //     done: function(value) {
-                //         console.log('选中的开始日期...', value)
-                //         selectStartDate = value;
-                //     }
-                // });
-
-                // laydate.render({
-                //     elem: '#editItemEndDate',
-                //     type: 'datetime',
-                //     done: function(value) {
-                //         console.log('选中的结束日期...', value)
-                //         selectEndDate = value;
-                //     }
-                // });
-
             })
         })
 
 
+
+
     });
 </script>

+ 61 - 14
admin/templates/default/provider.refill.balance.php

@@ -264,8 +264,6 @@
                                 <td class="align-center"><?php echo $output['order_time_type_text'][$v['time_type']]; ?></td>
                                 <td class="align-center"><?php echo $v['remark']; ?></td>
                                 <td style="text-align: center;color:#0D93BF;">
-                                    <a href="javascript:void(0);" class="item_create_btn" style="color:#0D93BF;">新建</a>
-                                    <span> | </span>
                                     <a href="javascript:void(0);" class="handleBtn" data-index="<?php echo $k ?>" style="color:#0D93BF;">编辑</a>
                                     <span>|</span>
                                     <a style="margin:0 5px;color:#0D93BF;" href="index.php?act=orderstats&op=refill_balance_rebuild&balance_id=<?php echo $v['balance_id']; ?>" data-index="<?php echo $k ?>" class="rebuildBtn">重新生成</a>
@@ -579,12 +577,40 @@
             }
         })
 
+
         $('.handleBtn').on('click', function() {
             var index = $(this).attr('data-index');
             var data = stats_list_data[index];
+            console.log('data', data)
             layui.use(['form', 'layer', 'laydate'], function() {
                 var layer = layui.layer;
                 var form = layui.form;
+                const transfer_detail_data = [];
+                Object.keys(data.transfer_detail_data).map(key => {
+                    transfer_detail_data.push(data.transfer_detail_data[key])
+                })
+                console.log('transfer_detail_data', transfer_detail_data)
+                let transferDetailHTML = '';
+                for (let i = 0; i < transfer_detail_data.length; i++) {
+                    if (i % 3 == 0) {
+                        transferDetailHTML += `<div class="layui-form-item">`
+                    }
+                    transferDetailHTML += `
+                            <div class="layui-inline">
+                                <label class="layui-form-label">${transfer_detail_data[i].name}</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" value="${transfer_detail_data[i].amount}" disabled style="height:38px;" required  lay-verify="required" autocomplete="off" class="layui-input">
+                                </div>
+                            </div>
+                        `
+                    if (i % 3 == 2 || i == transfer_detail_data.length - 1) {
+                        transferDetailHTML += `</div> `
+                    }
+                }
+
+
+
+
                 layer.confirm(`
                     <div>
                         <form id="editStatDataForm" class="layui-form" method="post" action="index.php?act=Orderstats&op=refill_balance_edit">
@@ -605,15 +631,17 @@
                                         <input type="text" value="${data.refill_amount}" style="height:38px;" name="refill_amount" required  lay-verify="required" placeholder="成功金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">下游金额:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.mch_amount}" style="height:38px;" name="mch_amount" required  lay-verify="required" placeholder="下游金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+                            </div>
+
+                            <div class="layui-form-item">
+                              
 
                                <div class="layui-inline">
                                     <label class="layui-form-label">上游金额:</label>
@@ -621,9 +649,7 @@
                                         <input type="text" value="${data.channel_amount}" style="height:38px;" name="channel_amount" required  lay-verify="required" placeholder="上游金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">利润:</label>
                                     <div class="layui-input-inline">
@@ -631,40 +657,54 @@
                                     </div>
                                </div>
 
+
                                <div class="layui-inline">
-                                    <label class="layui-form-label">返销金额:</label>
+                                    <label class="layui-form-label">银行转入:</label>
                                     <div class="layui-input-inline">
-                                        <input type="text" value="${data.refund_amount}" style="height:38px;" name="refund_amount" required  lay-verify="required" placeholder="返销金额" autocomplete="off" class="layui-input">
+                                        <input type="text" value="${data.transfer_in}" style="height:38px;" name="transfer_in" required  lay-verify="required" placeholder="银行转入" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+
+                               
                             </div>
 
                             <div class="layui-form-item">
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">银行转出:</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" value="${data.transfer_out}" style="height:38px;" name="transfer_out" required  lay-verify="required" placeholder="银行转出" autocomplete="off" class="layui-input">
+                                    </div>
+                               </div>
+                               <div class="layui-inline">
+                                    <label class="layui-form-label">返销金额:</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" value="${data.refund_amount}" style="height:38px;" name="refund_amount" required  lay-verify="required" placeholder="返销金额" autocomplete="off" class="layui-input">
+                                    </div>
+                               </div>
                                <div class="layui-inline">
                                     <label class="layui-form-label">异常金额:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.except_amount}" style="height:38px;" name="except_amount" required  lay-verify="required" placeholder="异常金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+                            </div>
 
+                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">累计结余:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.accumulate_balance}" style="height:38px;" name="accumulate_balance" required  lay-verify="required" placeholder="累计结余" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">本次结余:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.balance}" style="height:38px;" name="balance" required  lay-verify="required" placeholder="本次结余" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-
-                              
                             </div>
+                                
 
                             <div class="layui-form-item">
                                 <div class="layui-block">
@@ -673,16 +713,23 @@
                                         <input type="text" value="${data.remark}" style="width:525px;height:38px;" name="remark" required  lay-verify="required" placeholder="备注" autocomplete="off" class="layui-input">
                                     </div>
                                 </div>
-                            </div>    
+                            </div>
+
+                            <div style="height:1px;border-top: 1px dotted #CBE9F3;margin-bottom:15px;"></div>
+
+                            ${transferDetailHTML}
 
                         </form>
                     </div>`, {
-                    area: '800px',
+                    area: '1200px',
                     title: '编辑'
                 }, function(index) {
                     $('#editStatDataForm').submit();
                 })
+                form.render();
             })
         })
+
+
     });
 </script>

+ 13 - 2
admin/templates/default/refill.task.php

@@ -134,6 +134,17 @@
                         </select>
                     </label>
                 </td>
+                <th><label>显示状态</label></th>
+                <td>
+                    <label>
+                        <select name="is_show">
+                            <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                            <option value="0" <?php if ($_GET['is_show'] == '0'){ ?>selected<?php } ?>>不显示</option>
+                            <option value="1" <?php if ($_GET['is_show'] == '1'){ ?>selected<?php } ?>>显示</option>
+
+                        </select>
+                    </label>
+                </td>
                 <td>
                     <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
                        title="<?php echo $lang['nc_query']; ?>">&nbsp;
@@ -148,7 +159,7 @@
         <tr class="thead">
             <th class="align-center">编号</th>
             <th class="align-center">任务ID</th>
-            <th class="align-center">任务类型</th>
+            <th class="align-left">任务类型</th>
             <th class="align-left">标题</th>
             <th class="align-center">任务状态</th>
             <th class="align-center">生成日期</th>
@@ -165,7 +176,7 @@
                 <tr class="hover trFlex">
                     <td class="align-center"><?php echo $key + 1; ?></td>
                     <td class="align-center"><?php echo $value['task_id']; ?></td>
-                    <td class="align-center"><?php echo $output['task_type'][$value['type']]; ?></td>
+                    <td class="align-left"><?php echo $output['task_type'][$value['type']]; ?></td>
                     <td class="align-left"><?php echo $value['title']; ?></td>
                     <td class="align-center"><?php echo $output['task_state'][$value['state']]; ?></td>
                     <td class="align-center"><?php echo $value['add_time'] ? date('Y-m-d H:i:s', $value['add_time']) : '/'; ?></td>

+ 58 - 48
admin/templates/default/system.refill.balance.php

@@ -224,8 +224,6 @@
                                 <td class="align-center"><?php echo $output['order_time_type_text'][$v['time_type']]; ?></td>
                                 <td class="align-center"><?php echo $v['remark']; ?></td>
                                 <td style="color:#069;">
-                                    <a style="color:#0D93BF;" href="javascript:void(0)" data-index="<?php echo $k ?>" data-balance_id="<?php echo $v['balance_id']; ?>" class="item_create_btn">新建</a>
-                                    <span>|</span>
                                     <a style="color:#0D93BF;" href="javascript:void(0)" data-index="<?php echo $k ?>" class="handleBtn">编辑</a>
                                     <span>|</span>
                                     <a style="margin:0 5px;color:#0D93BF;" href="index.php?act=orderstats&op=refill_balance_rebuild&balance_id=<?php echo $v['balance_id']; ?>" data-index="<?php echo $k ?>" class="rebuildBtn">重新生成</a>
@@ -234,11 +232,6 @@
                                         <a style="color:#0D93BF;" href="index.php?act=orderstats&op=refill_balance_confirm&balance_id=<?php echo $v['balance_id']; ?>" data-index="<?php echo $k ?>" class="checkBtn">确认</a>
                                     <?php } ?>
                                 </td>
-                                <!--                        <td class="align-center w200">-->
-                                <!--                            <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=--><?php //echo $v['stat_id'];
-                                                                                                                                ?>
-                                <!--">重新统计</a>-->
-                                <!--                        </td>-->
                             </tr>
                         <?php } ?>
                     <?php } else { ?>
@@ -247,12 +240,6 @@
                         </tr>
                     <?php } ?>
                 </tbody>
-
-                <!-- <tfoot>
-                    <tr class="tfoot">
-                        <td></td>
-                    </tr>
-                </tfoot> -->
             </table>
             <div class="pagination"><?php echo $output['show_page']; ?></div>
         </form>
@@ -406,6 +393,32 @@
             layui.use(['form', 'layer', 'laydate'], function() {
                 var layer = layui.layer;
                 var form = layui.form;
+                const transfer_detail_data = [];
+                Object.keys(data.transfer_detail_data).map(key => {
+                    transfer_detail_data.push(data.transfer_detail_data[key])
+                })
+                console.log('transfer_detail_data', transfer_detail_data)
+                let transferDetailHTML = '';
+                for (let i = 0; i < transfer_detail_data.length; i++) {
+                    if (i % 3 == 0) {
+                        transferDetailHTML += `<div class="layui-form-item">`
+                    }
+                    transferDetailHTML += `
+                            <div class="layui-inline">
+                                <label class="layui-form-label">${transfer_detail_data[i].name}</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" value="${transfer_detail_data[i].amount}" disabled style="height:38px;" required  lay-verify="required" autocomplete="off" class="layui-input">
+                                </div>
+                            </div>
+                        `
+                    if (i % 3 == 2 || i == transfer_detail_data.length - 1) {
+                        transferDetailHTML += `</div> `
+                    }
+                }
+
+
+
+
                 layer.confirm(`
                     <div>
                         <form id="editStatDataForm" class="layui-form" method="post" action="index.php?act=Orderstats&op=refill_balance_edit">
@@ -426,15 +439,17 @@
                                         <input type="text" value="${data.refill_amount}" style="height:38px;" name="refill_amount" required  lay-verify="required" placeholder="成功金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">下游金额:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.mch_amount}" style="height:38px;" name="mch_amount" required  lay-verify="required" placeholder="下游金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+                            </div>
+
+                            <div class="layui-form-item">
+                              
 
                                <div class="layui-inline">
                                     <label class="layui-form-label">上游金额:</label>
@@ -442,9 +457,7 @@
                                         <input type="text" value="${data.channel_amount}" style="height:38px;" name="channel_amount" required  lay-verify="required" placeholder="上游金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">利润:</label>
                                     <div class="layui-input-inline">
@@ -452,31 +465,46 @@
                                     </div>
                                </div>
 
+
                                <div class="layui-inline">
-                                    <label class="layui-form-label">返销金额:</label>
+                                    <label class="layui-form-label">银行转入:</label>
                                     <div class="layui-input-inline">
-                                        <input type="text" value="${data.refund_amount}" style="height:38px;" name="refund_amount" required  lay-verify="required" placeholder="返销金额" autocomplete="off" class="layui-input">
+                                        <input type="text" value="${data.transfer_in}" style="height:38px;" name="transfer_in" required  lay-verify="required" placeholder="银行转入" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+
+                               
                             </div>
 
                             <div class="layui-form-item">
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">银行转出:</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" value="${data.transfer_out}" style="height:38px;" name="transfer_out" required  lay-verify="required" placeholder="银行转出" autocomplete="off" class="layui-input">
+                                    </div>
+                               </div>
+                               <div class="layui-inline">
+                                    <label class="layui-form-label">返销金额:</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" value="${data.refund_amount}" style="height:38px;" name="refund_amount" required  lay-verify="required" placeholder="返销金额" autocomplete="off" class="layui-input">
+                                    </div>
+                               </div>
                                <div class="layui-inline">
                                     <label class="layui-form-label">异常金额:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.except_amount}" style="height:38px;" name="except_amount" required  lay-verify="required" placeholder="异常金额" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
+                            </div>
 
+                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">累计结余:</label>
                                     <div class="layui-input-inline">
                                         <input type="text" value="${data.accumulate_balance}" style="height:38px;" name="accumulate_balance" required  lay-verify="required" placeholder="累计结余" autocomplete="off" class="layui-input">
                                     </div>
                                </div>
-                            </div>
 
-                            <div class="layui-form-item">
                                <div class="layui-inline">
                                     <label class="layui-form-label">本次结余:</label>
                                     <div class="layui-input-inline">
@@ -484,6 +512,8 @@
                                     </div>
                                </div>
                             </div>
+                              
+
                             <div class="layui-form-item">
                                 <div class="layui-block">
                                     <label class="layui-form-label">备注:</label>
@@ -492,40 +522,20 @@
                                     </div>
                                 </div>
                             </div>
+
+
+                            <div style="height:1px;border-top: 1px dotted #CBE9F3;margin-bottom:15px;"></div>
+
+                            ${transferDetailHTML}
+
                         </form>
                     </div>`, {
-                    area: '800px',
+                    area: '1200px',
                     title: '编辑'
                 }, function(index) {
                     $('#editStatDataForm').submit();
                 })
-                // layer.open({
-                //     area: '500px',
-                //     type: 1,
-                //     title: '编辑',
-                //     content: 
-                // })
                 form.render();
-                // laydate.render({
-                //     elem: '#editItemStartDate',
-                //     type: 'datetime',
-                //     value: (data.start_stamp == 0 || !data.start_stamp) ? '' : data.start_stamp,
-                //     done: function(value) {
-                //         console.log('选中的开始日期...', value)
-                //         selectStartDate = value;
-                //     }
-                // });
-
-                // laydate.render({
-                //     elem: '#editItemEndDate',
-                //     type: 'datetime',
-                //     value: (data.end_text == 0 || !data.end_text) ? '' : data.end_text,
-                //     done: function(value) {
-                //         console.log('选中的结束日期...', value)
-                //         selectEndDate = value;
-                //     }
-                // });
-
             })
         })
 

+ 30 - 0
admin/templates/default/transfer.order.php

@@ -105,6 +105,14 @@
         <input type="hidden" name="op" value="transfer_order" />
         <table class="tb-type1 noborder search">
             <tr>
+                <th><label for="query_start_time">下单时间</label></th>
+                <td style="width: 380px">
+                    <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>客户名称</label></th>
                 <td class="layui-form">
                     <select name="mchid" class="querySelect" lay-verify="" lay-search>
@@ -138,6 +146,11 @@
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
                     </a>
                 </td>
+                <td>
+                    <a href="#" class="btns" id="hCopyMchOrderNo">
+                        <span><i class="icon-edit"></i>拷贝商家单号</span>
+                    </a>
+                </td>
             </tr>
         </table>
     </form>
@@ -239,6 +252,23 @@
             document.execCommand("Copy"); // 执行浏览器复制命令
             oInput.parentNode.removeChild(oInput)
         });
+
+        $('#hCopyMchOrderNo').click(function() {
+            let str = ''
+            $('#tbody tr').each(function () {
+                let res = $(this).find('td').eq(4).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)
+        });
+
         $('#ncsubmit').click(function() {
             $('#formSearch').submit();
         });

+ 29 - 0
admin/templates/default/transfer.order.recharge.php

@@ -105,6 +105,14 @@
         <input type="hidden" name="op" value="transfer_order_recharge" />
         <table class="tb-type1 noborder search">
             <tr>
+                <th><label for="query_start_time">下单时间</label></th>
+                <td style="width: 380px">
+                    <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>客户名称</label></th>
                 <td class="layui-form">
                     <select name="mchid" class="querySelect" lay-verify="" lay-search>
@@ -143,6 +151,11 @@
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
                     </a>
                 </td>
+                <td>
+                    <a href="#" class="btns" id="hCopyMchOrderNo">
+                        <span><i class="icon-edit"></i>拷贝商家单号</span>
+                    </a>
+                </td>
             </tr>
         </table>
     </form>
@@ -253,6 +266,22 @@
             oInput.parentNode.removeChild(oInput)
         });
 
+        $('#hCopyMchOrderNo').click(function() {
+            let str = ''
+            $('#tbody tr').each(function () {
+                let res = $(this).find('td').eq(4).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)
+        });
+
         $('#ncsubmit').click(function() {
             $('#formSearch').submit();
         });

+ 12 - 4
core/framework/libraries/log.php

@@ -50,6 +50,8 @@ class Log
     private $mPathFileName;
     private $mPathFile;
 
+    private $mShortName;
+
     private static $stInstance = null;
     private function __construct()
     {
@@ -67,6 +69,8 @@ class Log
 
         $this->mPathFileName = '';
         $this->mPathFile = false;
+
+        $this->mShortName = empty(APP_ID) ? '' : APP_ID;
     }
 
     public static function instance()
@@ -77,6 +81,12 @@ class Log
         return self::$stInstance;
     }
 
+    public static function short_name($name)
+    {
+        $pThis = self::instance();
+        $pThis->mShortName = $name;
+    }
+
     public static function start_sql_log()
     {
         $pThis = self::instance();
@@ -170,15 +180,13 @@ class Log
             $pid = posix_getpid();
         }
 
-        $appid = empty(APP_ID) ? '' : APP_ID;
-        $content = "[{$appid} {$pid} {$now}] {$level}: {$message}\r\n";
+        $content = "[{$this->mShortName} {$pid} {$now}] {$level}: {$message}\r\n";
         return $content;
     }
 
     private function write($content)
     {
-        $appid = empty(APP_ID) ? '' : APP_ID;
-        $log_file = BASE_DATA_PATH . '/log/' . date('Ymd', time()) . '-' . $appid . '.log';
+        $log_file = BASE_DATA_PATH . '/log/' . date('Ymd', time()) . '-' . $this->mShortName . '.log';
 
         if ($this->mAppFileName != $log_file)
         {

+ 3 - 0
crontab/control/minutes.php

@@ -412,6 +412,9 @@ class minutesControl extends BaseCronControl
     //任务队列处理
     public function taskOp()
     {
+        Log::short_name('task');
+        Log::record('start task',Log::DEBUG);
+
         $task_manager = new task\manager();
         $task_id = 0;
         while (true)

+ 1 - 0
crontab/index.php

@@ -3,6 +3,7 @@
 if (empty($_SERVER['argv'][1])) exit('Access Invalid!');
 
 defined('APP_ID') or define('APP_ID','crontab');
+
 defined('BASE_ROOT_PATH') or define('BASE_ROOT_PATH',str_replace('/crontab','',dirname(__FILE__)));
 defined('BASE_PATH') or define('BASE_PATH',BASE_ROOT_PATH . '/crontab');
 

+ 1 - 0
data/config/win/base.ini.php

@@ -13,6 +13,7 @@ define('CROSS_DOAMIN',true);
 define('COOKIE_DOMAIN','192.168.1.218');
 define('COMPANY_NAME', 'XYZ_COMPANY');
 define('NET_IP','123.117.109.96');
+define('ZERO_GOODS_ID', 6666);
 define('ADMIN_NAME', 'YELIN');
 
 $SRV_HOST = 'http://192.168.1.218';

+ 93 - 0
data/config/yl/refill.ini.php

@@ -5873,6 +5873,96 @@ $yuke_phone = ['name' => 'yuke', 'store_id' => 221, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$yuke_lt_phone = ['name' => 'yuke_lt', 'store_id' => 222, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7858, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7858, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7858, 'price' => 9.98, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 7859, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7859, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7859, 'price' => 19.96, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 7860, 'price' => 29.25, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7860, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7860, 'price' => 29.94, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+//            ['goods_id' => 7861, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7861, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7861, 'price' => 49.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+//            ['goods_id' => 7862, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7862, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7862, 'price' => 99.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+//            ['goods_id' => 7863, 'price' => 195, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7863, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7863, 'price' => 199.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 7864, 'price' => 292.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7864, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7864, 'price' => 299.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7865, 'price' => 487.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7865, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7865, 'price' => 499, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yuke_dx_phone = ['name' => 'yuke_dx', 'store_id' => 223, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7866, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7866, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7866, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 7867, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7867, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7867, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 7868, 'price' => 29.25, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7868, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7868, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+//            ['goods_id' => 7869, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7869, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7869, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+//            ['goods_id' => 7870, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7870, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7870, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+//            ['goods_id' => 7871, 'price' => 195, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7871, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7871, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 7872, 'price' => 292.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7872, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7872, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7873, 'price' => 487.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7873, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7873, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -6055,6 +6145,9 @@ $phone_providers = [
     ['name' => 'bodian', 'cfg' => $bodian_phone],
     ['name' => 'chizeng_yi', 'cfg' => $chizeng_yi_phone],
     ['name' => 'yuke', 'cfg' => $yuke_phone],
+    ['name' => 'yuke_lt', 'cfg' => $yuke_lt_phone],
+    ['name' => 'yuke_dx', 'cfg' => $yuke_dx_phone],
+
 ];
 $config['phone_providers'] = $phone_providers;
 

BIN
helper/refill/api/xyz/guochuang/20220603天津移动调价函.png


BIN
helper/refill/api/xyz/guochuang/20220606内蒙古移动调价函.png


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

@@ -63,14 +63,14 @@ class config
     //key格式 卡类型-面值-regin_no
     const Price = [
         //移动
-        "4-10-2" => 10.15, "4-20-2" => 19.92, "4-30-2" => 29.88, "4-50-2" => 49.8, "4-100-2" => 99.6, "4-200-2" => 199.2, "4-300-2" => 298.8, "4-500-2" => 498,//天津 2
+        "4-10-2" => 10.15, "4-20-2" => 19.92, "4-30-2" => 29.94, "4-50-2" => 49.9, "4-100-2" => 99.8, "4-200-2" => 199.6, "4-300-2" => 299.4, "4-500-2" => 499,//天津 2
         "4-10-6" => 9.76, "4-20-6" => 19.52, "4-30-6" => 29.28, "4-50-6" => 48.8, "4-100-6" => 97.6, "4-200-6" => 195.2, "4-300-6" => 292.8, "4-500-6" => 488,//辽宁 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.04, "4-20-8" => 20.08, "4-30-8" => 30.12, "4-50-8" => 50.2, "4-100-8" => 100.4, "4-200-8" => 200.8, "4-300-8" => 301.2, "4-500-8" => 502,//黑龙江 8
         "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
-        "4-10-5" => 10.01, "4-20-5" => 20.02, "4-30-5" => 30.03, "4-50-5" => 50.05, "4-100-5" => 100.1, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
+        "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.895, "4-50-19" => 49.825, "4-100-19" => 99.65, "4-200-19" => 199.3, "4-300-19" => 298.95, "4-500-19" => 498.25,//广东 19
         "4-10-7" => 9.82, "4-20-7" => 19.64, "4-30-7" => 29.46, "4-50-7" => 49.1, "4-100-7" => 98.2, "4-200-7" => 196.4, "4-300-7" => 294.6, "4-500-7" => 491,//吉林 7

+ 2 - 2
helper/refill/api/yl/guochuang/config.php

@@ -63,14 +63,14 @@ class config
     //key格式 卡类型-面值-regin_no
     const Price = [
         //移动
-        "4-10-2" => 10.15, "4-20-2" => 19.92, "4-30-2" => 29.88, "4-50-2" => 49.8, "4-100-2" => 99.6, "4-200-2" => 199.2, "4-300-2" => 298.8, "4-500-2" => 498,//天津 2
+        "4-10-2" => 10.15, "4-20-2" => 19.92, "4-30-2" => 29.94, "4-50-2" => 49.9, "4-100-2" => 99.8, "4-200-2" => 199.6, "4-300-2" => 299.4, "4-500-2" => 499,//天津 2
         "4-10-6" => 9.76, "4-20-6" => 19.52, "4-30-6" => 29.28, "4-50-6" => 48.8, "4-100-6" => 97.6, "4-200-6" => 195.2, "4-300-6" => 292.8, "4-500-6" => 488,//辽宁 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.04, "4-20-8" => 20.08, "4-30-8" => 30.12, "4-50-8" => 50.2, "4-100-8" => 100.4, "4-200-8" => 200.8, "4-300-8" => 301.2, "4-500-8" => 502,//黑龙江 8
         "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
-        "4-10-5" => 10.01, "4-20-5" => 20.02, "4-30-5" => 30.03, "4-50-5" => 50.05, "4-100-5" => 100.1, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
+        "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.895, "4-50-19" => 49.825, "4-100-19" => 99.65, "4-200-19" => 199.3, "4-300-19" => 298.95, "4-500-19" => 498.25,//广东 19
         "4-10-7" => 9.82, "4-20-7" => 19.64, "4-30-7" => 29.46, "4-50-7" => 49.1, "4-100-7" => 98.2, "4-200-7" => 196.4, "4-300-7" => 294.6, "4-500-7" => 491,//吉林 7

+ 1 - 1
helper/refill/api/yl/yuke/RefillCallBack.php

@@ -39,7 +39,7 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_id = $order_info['order_id'];
 
         if ($status === 2) {
-            $data['official_sn'] = $params['data']['callbackOtherAttr']['cert_no'];
+            $data['official_sn'] = $params['callbackOtherAttr']['cert_no'];
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false,true];
         }

+ 53 - 0
helper/refill/api/yl/yuke_dx/RefillCallBack.php

@@ -0,0 +1,53 @@
+<?php
+namespace refill\yuke_dx;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yuke_dx/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $params['rechargeAmount'] = number_format($params['rechargeAmount'], 3);
+        $key = config::SECRET_KEY;
+        $content = "tPfChannelId={$params['tPfChannelId']}&rechargeAccount={$params['rechargeAccount']}&rechargeAmount={$params['rechargeAmount']}&orderType={$params['orderType']}";
+        $content .= "&orderStatus={$params['orderStatus']}&orderSn={$params['orderSn']}&outOrderId={$params['outOrderId']}&createTime={$params['createTime']}";
+        $content .= "&updatedTime={$params['updatedTime']}&secret_key={$key}";
+
+        return strtoupper(md5($content));
+    }
+
+    //[$order_id, $success, $can_try, $need_handle]
+    public function notify($params)
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['outOrderId'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            $data['official_sn'] = $params['callbackOtherAttr']['cert_no'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3 || $status === 4) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 142 - 0
helper/refill/api/yl/yuke_dx/RefillPhone.php

@@ -0,0 +1,142 @@
+<?php
+
+namespace refill\yuke_dx;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yuke_dx/config.php');
+
+use refill;
+use Log;
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $params['rechargeAccount'] = $phone;
+        $params['rechargeAmount'] = $amount;
+        $params['tPfChannelId'] = config::CHANNEL_ID;
+        $params['orderType'] = 0;
+        $params['outOrderId'] = $order_sn;
+        $params['randomNumber'] = $this->createNoncestr(10);
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $card_type, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::ORDER_URL, $params , config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 1) {
+                return [true, $resp['data']['order_sn'], false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['tPfChannelId'] = config::CHANNEL_ID;
+        $params['outOrderId'] = $refill_info['order_sn'];
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::QUERY_URL, $params , config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif($resp['code'] === 1)
+            {
+                $status = $resp['data']['orderInfo']['orderStatus'];
+                if ($status === 2) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 3 || $status === 4) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 1) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $status];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === -2004 && (time() - $refill_info['commit_time'] > 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['tPfChannelId'] = config::CHANNEL_ID;
+        $params['tunnelType'] = 0;
+        $key = config::SECRET_KEY;
+        $content = "tPfChannelId={$params['tPfChannelId']}&tunnelType={$params['tunnelType']}&secret_key={$key}";
+        $params['sign'] = strtoupper(md5($content));
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::BALANCE_URL, $params , config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] == 1) {
+                return [true, $resp['data']['amountOfMoney']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    private function createNoncestr( $length = 32 )
+    {
+        $chars = "abcdefghijklmnopqrstuvwxyz0123456789";
+        $str ="";
+        for ( $i = 0; $i < $length; $i++ )  {
+            $str.= substr($chars, mt_rand(0, strlen($chars)-1), 1);
+        }
+        return $str;
+    }
+
+    private function sign($params)
+    {
+        $key = config::SECRET_KEY;
+        $content = "orderType={$params['orderType']}&tPfChannelId={$params['tPfChannelId']}&rechargeAccount={$params['rechargeAccount']}&rechargeAmount={$params['rechargeAmount']}";
+        $content .= "&randomNumber={$params['randomNumber']}&secret_key={$key}";
+        return strtoupper(md5($content));
+    }
+}

+ 7 - 0
helper/refill/api/yl/yuke_dx/api.txt

@@ -0,0 +1,7 @@
+http://www.recharge.org.cn/rechargeServiceAdmin
+渠道ID:198
+账户:18513846010
+密码:123456
+key:F1181F45F4179F36
+
+下单地址:http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/aries

+ 15 - 0
helper/refill/api/yl/yuke_dx/config.php

@@ -0,0 +1,15 @@
+<?php
+namespace refill\yuke_dx;
+
+class config
+{
+    //回调地址上游配置
+    const ORDER_URL = 'http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/aries';
+    const QUERY_URL = 'http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/getOrderInfo';
+    const BALANCE_URL = 'http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/getBalanceInfo';
+
+    const CHANNEL_ID = '198';
+    const SECRET_KEY = 'F1181F45F4179F36';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yuke_dx.php";
+    const ExtHeaders = ['Content-Type: application/json; charset=utf-8'];
+}

BIN
helper/refill/api/yl/yuke_dx/充值服务接入文档v2.4.docx


+ 53 - 0
helper/refill/api/yl/yuke_lt/RefillCallBack.php

@@ -0,0 +1,53 @@
+<?php
+namespace refill\yuke_lt;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yuke_lt/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $params['rechargeAmount'] = number_format($params['rechargeAmount'], 3);
+        $key = config::SECRET_KEY;
+        $content = "tPfChannelId={$params['tPfChannelId']}&rechargeAccount={$params['rechargeAccount']}&rechargeAmount={$params['rechargeAmount']}&orderType={$params['orderType']}";
+        $content .= "&orderStatus={$params['orderStatus']}&orderSn={$params['orderSn']}&outOrderId={$params['outOrderId']}&createTime={$params['createTime']}";
+        $content .= "&updatedTime={$params['updatedTime']}&secret_key={$key}";
+
+        return strtoupper(md5($content));
+    }
+
+    //[$order_id, $success, $can_try, $need_handle]
+    public function notify($params)
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['outOrderId'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            $data['official_sn'] = $params['callbackOtherAttr']['cert_no'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3 || $status === 4) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 142 - 0
helper/refill/api/yl/yuke_lt/RefillPhone.php

@@ -0,0 +1,142 @@
+<?php
+
+namespace refill\yuke_lt;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yuke_lt/config.php');
+
+use refill;
+use Log;
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $params['rechargeAccount'] = $phone;
+        $params['rechargeAmount'] = $amount;
+        $params['tPfChannelId'] = config::CHANNEL_ID;
+        $params['orderType'] = 0;
+        $params['outOrderId'] = $order_sn;
+        $params['randomNumber'] = $this->createNoncestr(10);
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $card_type, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::ORDER_URL, $params , config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 1) {
+                return [true, $resp['data']['order_sn'], false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['tPfChannelId'] = config::CHANNEL_ID;
+        $params['outOrderId'] = $refill_info['order_sn'];
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::QUERY_URL, $params , config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif($resp['code'] === 1)
+            {
+                $status = $resp['data']['orderInfo']['orderStatus'];
+                if ($status === 2) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 3 || $status === 4) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 1) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $status];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === -2004 && (time() - $refill_info['commit_time'] > 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['tPfChannelId'] = config::CHANNEL_ID;
+        $params['tunnelType'] = 0;
+        $key = config::SECRET_KEY;
+        $content = "tPfChannelId={$params['tPfChannelId']}&tunnelType={$params['tunnelType']}&secret_key={$key}";
+        $params['sign'] = strtoupper(md5($content));
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::BALANCE_URL, $params , config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] == 1) {
+                return [true, $resp['data']['amountOfMoney']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    private function createNoncestr( $length = 32 )
+    {
+        $chars = "abcdefghijklmnopqrstuvwxyz0123456789";
+        $str ="";
+        for ( $i = 0; $i < $length; $i++ )  {
+            $str.= substr($chars, mt_rand(0, strlen($chars)-1), 1);
+        }
+        return $str;
+    }
+
+    private function sign($params)
+    {
+        $key = config::SECRET_KEY;
+        $content = "orderType={$params['orderType']}&tPfChannelId={$params['tPfChannelId']}&rechargeAccount={$params['rechargeAccount']}&rechargeAmount={$params['rechargeAmount']}";
+        $content .= "&randomNumber={$params['randomNumber']}&secret_key={$key}";
+        return strtoupper(md5($content));
+    }
+}

+ 7 - 0
helper/refill/api/yl/yuke_lt/api.txt

@@ -0,0 +1,7 @@
+http://www.recharge.org.cn/rechargeServiceAdmin
+渠道ID:197
+账户:18513846009
+密码:123456
+key:688AA229A7BD12AC
+
+下单地址:http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/aries

+ 15 - 0
helper/refill/api/yl/yuke_lt/config.php

@@ -0,0 +1,15 @@
+<?php
+namespace refill\yuke_lt;
+
+class config
+{
+    //回调地址上游配置
+    const ORDER_URL = 'http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/aries';
+    const QUERY_URL = 'http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/getOrderInfo';
+    const BALANCE_URL = 'http://quantum.recharge.org.cn:19860/polymeric/api/tunnel/getBalanceInfo';
+
+    const CHANNEL_ID = '197';
+    const SECRET_KEY = '688AA229A7BD12AC';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yuke_lt.php";
+    const ExtHeaders = ['Content-Type: application/json; charset=utf-8'];
+}

BIN
helper/refill/api/yl/yuke_lt/充值服务接入文档v2.4.docx


+ 7 - 16
helper/statistics/refill_balance.php

@@ -136,19 +136,19 @@ class refill_balance
             $item = $mod_refill->table('refill_order')->field('order_id,order_time')
                 ->where(['order_time' => ['lt', $end]])
                 ->order('order_id asc')->find();
-            $time = $item['order_time'] ?? 0;
+            $time = $item['order_time'] ?? $end;
         } elseif ($type == 'merchant') {
             $mod_refill = Model('refill_order');
             $item = $mod_refill->table('refill_order')->field('order_id,order_time')
                 ->where(['mchid' => $cid, 'order_time' => ['lt', $end]])
                 ->order('order_id asc')->find();
-            $time = $item['order_time'] ?? 0;
+            $time = $item['order_time'] ?? $end;
         } else {
             $mod_refill = Model('vr_order');
             $item = $mod_refill->table('vr_order')->field('order_id,add_time')
                 ->where(['store_id' => $cid,'add_time' => ['lt', $end]])
                 ->order('order_id asc')->find();
-            $time = $item['order_time'] ?? 0;
+            $time = $item['add_time'] ?? $end;
         }
 
         return $time;
@@ -176,7 +176,7 @@ class refill_balance
                 ->find();
         }
 
-        $time = $item['madd_time'] ?? 0;
+        $time = $item['madd_time'] ?? $end;
         return $time;
     }
 
@@ -202,7 +202,7 @@ class refill_balance
                 ->find();
         }
 
-        $time = $item['madd_time'] ?? 0;
+        $time = $item['madd_time'] ?? $end;
         return $time;
     }
 
@@ -256,20 +256,11 @@ class refill_balance
             $balance = ncPriceFormat($in - $order_stat['channel_amounts']);
         }
 
-        if($start == 0)
-        {
-            $time = min($refill_time,$pay_time);
-            if($time == 0) {
-                return [];
-            }
-
+        if ($start == 0) {
+            $time = min($refill_time, $pay_time);
             $start = strtotime(date('Y-m-d', $time));
         }
 
-        if($start === $end) {
-            return [];
-        }
-
         $accumuter = function ($parent_id)
         {
             if ($parent_id > 0) {

+ 2 - 0
test/TestRefillBalance.php

@@ -22,6 +22,8 @@ class TestRefillBalance extends TestCase
 
     public function testAddBalance()
     {
+        Log::short_name('testAddBalance');
+        Log::record("xxx",Log::DEBUG);
         $refill_balance = new statistics\refill_balance();
         $refill_balance->add_balance('system', 0, 0, strtotime('2021-12-01'), 'order_time');
     }

+ 2 - 2
test/TestRefillClearYL.php

@@ -23,8 +23,8 @@ class TestRefillClearYL extends TestCase
     //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillClearYL::testOrderClear)( .*)?$/" --test-suffix TestRefillClearYL.php /var/www/html/test
     public function testOrderClear()
     {
-        $start_date = strtotime('2022-04-25');
-        $end_date   = strtotime('2022-05-01');
+        $start_date = strtotime('2022-05-20');
+        $end_date   = strtotime('2022-05-31');
 
         $clear = new refill\order_clear();
         $clear->clear($start_date,$end_date);

+ 12 - 0
test/TestRefillYl.php

@@ -724,4 +724,16 @@ class TestRefillYl extends TestCase
         $provider = $this->getProvider('yuke');
         $resp = $provider->balance();
     }
+
+    public function testYuke_lt()
+    {
+        $provider = $this->getProvider('yuke_lt');
+        $resp = $provider->balance();
+    }
+
+    public function testYuke_dx()
+    {
+        $provider = $this->getProvider('yuke_dx');
+        $resp = $provider->balance();
+    }
 }