فهرست منبع

merge from fixbug

stanley-king 3 سال پیش
والد
کامیت
ffbde5801c
51فایلهای تغییر یافته به همراه1474 افزوده شده و 514 حذف شده
  1. 1 1
      admin/control/merchant.php
  2. 10 17
      admin/control/orderstats.php
  3. 3 1
      admin/control/provider_info.php
  4. 8 2
      admin/control/refill_evidence.php
  5. 16 17
      admin/templates/default/merchant.order.stats.php
  6. 11 0
      admin/templates/default/merchant.refill.evidence_list.php
  7. 6 0
      admin/templates/default/provider.info.add.php
  8. 7 1
      admin/templates/default/provider.info.edit.php
  9. 4 2
      admin/templates/default/provider.info.php
  10. 15 17
      admin/templates/default/provider.order.stats.php
  11. 97 93
      admin/templates/default/recharge.manual.add.php
  12. 88 84
      admin/templates/default/recharge.manual.edit.php
  13. 13 0
      admin/templates/default/refill.order.index.php
  14. 11 18
      admin/templates/default/system.order.stats.php
  15. 2 2
      data/config/dev/base.ini.php
  16. 65 5
      data/config/win/refill.ini.php
  17. 68 8
      data/config/xyz/refill.ini.php
  18. 1 1
      helper/rbridge/wsd/Bridge.php
  19. 8 0
      helper/refill/RefillBase.php
  20. 68 0
      helper/refill/api/xyz/feinimoshu_hf/RefillCallBack.php
  21. 116 0
      helper/refill/api/xyz/feinimoshu_hf/RefillPhone.php
  22. 46 0
      helper/refill/api/xyz/feinimoshu_hf/config.php
  23. 55 0
      helper/refill/api/xyz/suning/RefillCallBack.php
  24. 168 0
      helper/refill/api/xyz/suning/RefillPhone.php
  25. 54 0
      helper/refill/api/xyz/suning/config.php
  26. BIN
      helper/refill/api/xyz/suning/苏宁卡API销售接口说明v1.6.1.pdf
  27. 50 0
      helper/refill/api/xyz/yinteng/RefillCallBack.php
  28. 102 0
      helper/refill/api/xyz/yinteng/RefillPhone.php
  29. 21 0
      helper/refill/api/xyz/yinteng/config.php
  30. 10 0
      helper/refill/api/xyz/yinteng/北京椰子开户信息.txt
  31. 9 0
      helper/refill/api/xyz/yinteng/接口地址.txt
  32. 48 52
      helper/refill/api/xyz/yunlingfs/RefillCallBack.php
  33. 5 49
      helper/refill/api/xyz/yunlingfs/RefillPhone.php
  34. 16 18
      helper/refill/api/xyz/yunlingfs/config.php
  35. 13 0
      helper/refill/api/xyz/yunlingfs/新系椰子分省通代理信息.txt
  36. BIN
      helper/refill/api/xyz/yunlingfs/新系统通信充值接口 - 副本.doc
  37. 19 19
      helper/refill/util.php
  38. 3 3
      helper/statistics/stat_refill.php
  39. 4 0
      mobile/callback/refill_feinimoshu_hf.php
  40. 4 0
      mobile/callback/refill_yinteng.php
  41. 39 21
      mobile/control/refill.php
  42. 4 4
      mobile/refill_yunlingfs.php
  43. 51 56
      racc/control/lzrefill.php
  44. 1 1
      racc/control/refill.php
  45. 1 1
      rdispatcher/processor.php
  46. 8 8
      rdispatcher/proxy.php
  47. 79 0
      test/TestExportOrder.php
  48. 16 0
      test/TestRedis.php
  49. 13 3
      test/TestRefill.php
  50. 12 10
      test/TestRefillThird.php
  51. 5 0
      test/TestTime.php

+ 1 - 1
admin/control/merchant.php

@@ -613,7 +613,7 @@ class merchantControl extends SystemControl
         $input['after_available'] = ncPriceFormat($mem_info['available_predeposit'] + $params['pointsnum']);
         $input['admin_name'] = $admininfo['name'];
         $input['admin_id'] = $admininfo['id'];
-        $input['add_type'] = 2;
+        $input['add_type'] = $params['add_type'];
 
         $model_merchant = Model('merchant');
         return $model_merchant->addRefillEvidence($input);

+ 10 - 17
admin/control/orderstats.php

@@ -41,10 +41,10 @@ class orderstatsControl extends SystemControl
             Tpl::output('merchant_list', $merchant_list);
         }
         $total_stats = $this->stats($stats_list);
-        $check_text = ['未编辑', '匹配', '不匹配'];
+        $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
         Tpl::output('total_stats', $total_stats);
         Tpl::output('stats_list', $stats_list);
-        Tpl::output('check_text', $check_text);
+        Tpl::output('order_time_type_text', $order_time_type_text);
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage($page);
     }
@@ -57,6 +57,9 @@ class orderstatsControl extends SystemControl
         if (!empty($_GET['cid'])) {
             $condition['cid'] = $_GET['cid'];
         }
+        if (!empty($_GET['order_time_type'])) {
+            $condition['order_time_type'] = $_GET['order_time_type'];
+        }
         $start_unixtime = intval($_GET['query_start_time']);
         $end_unixtime = intval($_GET['query_end_time']);
         if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
@@ -68,23 +71,13 @@ class orderstatsControl extends SystemControl
         }
         $stats_list = $model_refill_order->getOrderStatsList($condition,'','*','time_stamp asc');
 
-        $success_count_total = $success_refill_amounts_total = $success_mch_amounts_total = $success_channel_amounts_total = $profit_amounts_total = 0;
-        foreach ($stats_list as $stats) {
-            $success_count_total += $stats['success_count'];
-            $success_refill_amounts_total += $stats['success_refill_amounts'];
-            $success_mch_amounts_total += $stats['success_mch_amounts'];
-            $success_channel_amounts_total += $stats['success_channel_amounts'];
-            $profit_amounts_total += $stats['profit_amounts'];
+        $total_stats = $this->stats($stats_list);
+        $stats = $total_stats[$_GET['order_time_type']];
+        if(empty($stats)) {
+            $stats = $total_stats['notify_time'];
         }
-        $total_stats = [
-            'success_count_total' => ncPriceFormat($success_count_total),
-            'success_refill_amounts_total' => ncPriceFormat($success_refill_amounts_total),
-            'success_mch_amounts_toatl' => ncPriceFormat($success_mch_amounts_total),
-            'success_channel_amounts_total' => ncPriceFormat($success_channel_amounts_total),
-            'profit_amounts_total' => ncPriceFormat($profit_amounts_total)
-        ];
         $result['data'] = $stats_list;
-        $result['total_stats'] = $total_stats;
+        $result['total_stats'] = $stats;
         echo(json_encode($result));
         exit;
     }

+ 3 - 1
admin/control/provider_info.php

@@ -20,7 +20,7 @@ class provider_infoControl extends SystemControl
         foreach ($provider_list as $provider) {
             $providers[$provider['provider_id']] = $provider;
         }
-        $info_list = $mod->getProviderInfoList($condition,50);
+        $info_list = $mod->getProviderInfoList($condition,50,'*','store_id desc');
         foreach ($info_list as $key => $value) {
             $info_list[$key]['provider_name'] = $providers[$value['provider_id']]['name'];
             $info_list[$key]['store_name'] = $providers[$value['provider_id']]['store_name'];
@@ -59,6 +59,7 @@ class provider_infoControl extends SystemControl
                 $insert_array['admin_url'] = $_POST['admin_url'] ?? '';
                 $insert_array['admin_name'] = $_POST['admin_name'] ?? '';
                 $insert_array['admin_pwd'] = $_POST['admin_pwd'] ?? '';
+                $insert_array['bz'] = $_POST['bz'] ?? '';
                 $result = $mod->addInfo($insert_array);
                 if ($result) {
                     showMessage('添加成功', 'index.php?act=provider_info&op=index');
@@ -91,6 +92,7 @@ class provider_infoControl extends SystemControl
             $update['admin_url'] = trim($_POST['admin_url']);
             $update['admin_name'] = trim($_POST['admin_name']);
             $update['admin_pwd'] = trim($_POST['admin_pwd']);
+            $update['bz'] = trim($_POST['bz']);
 
             $result = $mod->editProviderInfo($update, ['info_id' => $info_id]);
             if (!$result) {

+ 8 - 2
admin/control/refill_evidence.php

@@ -31,6 +31,9 @@ class refill_evidenceControl extends SystemControl
             $condition['status'] = 3;
         } else {
         }
+        if (!empty($_GET['add_type'])) {
+            $condition['add_type'] = intval($_GET['add_type']);
+        }
         $export = $_GET['export'] ?? 0;
 
         $start_unixtime = intval(strtotime($_GET['query_start_time']));
@@ -57,7 +60,7 @@ class refill_evidenceControl extends SystemControl
             ->where($condition)
             ->group('status,add_type')
             ->select();
-        $success_amount = $send_amount = $cancel_amount = $mch_amount = $system_amount = 0;
+        $success_amount = $send_amount = $cancel_amount = $mch_amount = $system_amount = $system_edit_amount = 0;
         foreach ($counts as $count) {
             if($count['status'] == 1) {
                 $send_amount += $count['amounts'];
@@ -67,6 +70,8 @@ class refill_evidenceControl extends SystemControl
                     $mch_amount += $count['amounts'];
                 }elseif ($count['add_type'] == 2) {
                     $system_amount += $count['amounts'];
+                }elseif ($count['add_type'] == 3) {
+                    $system_edit_amount += $count['amounts'];
                 }
             }elseif ($count['status'] == 3) {
                 $cancel_amount += $count['amounts'];
@@ -77,6 +82,7 @@ class refill_evidenceControl extends SystemControl
         $stats['cancel_amount'] = $cancel_amount;
         $stats['mch_amount'] = $mch_amount;
         $stats['system_amount'] = $system_amount;
+        $stats['system_edit_amount'] = $system_edit_amount;
         if(!empty($export)) {
             $result['data'] = $evidence_list;
             $result['stats'] = $stats;
@@ -93,7 +99,7 @@ class refill_evidenceControl extends SystemControl
     {
         $status_text = ['申请中', '已通过', '已驳回'];
         $operation_text = ['未预存', '已预存'];
-        $add_type_text = ['商户预存','后台手动预存'];
+        $add_type_text = ['商户预存','后台手动预存','后台手动调款'];
 
         foreach ($data as $key => $value) {
             $data[$key]['add_time'] = date('Y-m-d H:i', $value['add_time']);

+ 16 - 17
admin/templates/default/merchant.order.stats.php

@@ -14,20 +14,14 @@
     input::placeholder{ 
         color:#333; 
     }
-    .row_q {
-    display: flex;
-        
-    }
+  
     .row_q ul li {
         height: 30px;
         line-height: 30px;
     }
-    #merchant_name_form {
-        display: block;
-        margin-top: 123px;
-    }
-    .moveright {
-        margin-left: 40px;
+    .row_w {
+        float: left;
+        margin-right: 40px;
     }
 </style>
 <div class="page">
@@ -59,7 +53,7 @@
                 </td>
                 <th><label>统计日期类型</label></th>
                 <td>
-                    <select name="order_time_type">
+                    <select name="order_time_type" id="order_time_type">
                         <option value="">请选择...</option>
                         <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
                         <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
@@ -67,7 +61,7 @@
                 </td>
                 <th><label>商户名称</label></th>
                 <td>
-                    <select name="cid" class="querySelect" lay-verify="" lay-search>
+                    <select name="cid" id="cid" 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']?>"
@@ -100,14 +94,14 @@
         </tr>
         <tr>
             <td class="row_q">
-                <ul>
+                <ul class="row_w">
                     <li>回调日期统计</li>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?></li>
                 </ul>
-                <ul class="moveright">
+                <ul>
                     <li>下单日期统计</li>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['order_time']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?></li>
@@ -140,6 +134,7 @@
                 <th class="align-center">金额误差</th>
                 <th class="align-center">备注</th>
                 <th class="align-center">匹配状态</th>
+                <th class="align-center">统计日期类型</th>
                 <th class="align-center"><?php echo $lang['operation']; ?></th>
             </tr>
             </thead>
@@ -172,6 +167,7 @@
                                 <span style="color: #fd9d0e">未编辑</span>
                             <?php }?>
                         </td>
+                        <td class="align-center"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
                         <td class="align-center w200">
                             <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=<?php echo $v['stat_id'];?>">重新统计</a>
                             |<a href="index.php?act=merchant&op=OrderStatsCheck&stat_id=<?php echo $v['stat_id'] ?>">编辑</a>
@@ -308,12 +304,15 @@
         $('#ncexport').click(function () {
             let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
             let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
-            let cid = $('select').val()
-            let text = $('select option:selected').text()
+            let cid = $('#cid').val()
+            let order_time_type = $('#order_time_type').val()
+            let text = $("#cid").find("option:selected").text();
+
             $.get('index.php?act=orderstats&op=ExportData&type=merchant', {
                 query_start_time: starTime,
                 query_end_time: endTime,
-                cid: cid
+                cid: cid,
+                order_time_type:order_time_type
             }, function (data) {
                 data = JSON.parse(data)
                 if (data && data.data) {

+ 11 - 0
admin/templates/default/merchant.refill.evidence_list.php

@@ -24,6 +24,7 @@
                 <th><label for="merchant_name">机构名称</label></th>
                 <td><input type="text" value="<?php echo $output['mch_name']; ?>" name="mch_name"
                            id="merchant_name" class="txt"></td>
+                <th><label for="state_sel">申请状态</label></th>
                 <td>
                     <select name="state_sel">
                         <option value="">请选择...</option>
@@ -33,6 +34,15 @@
                         <option value="4" <?php if($_GET['state_sel'] == '4'){ echo 'selected';}?>>全部</option>
                     </select>
                 </td>
+                <th><label for="add_type">预存类型</label></th>
+                <td>
+                    <select name="add_type">
+                        <option value="">请选择...</option>
+                        <option value="1" <?php if($_GET['state_sel'] == '1'){ echo 'selected';}?>>商户预存</option>
+                        <option value="2" <?php if($_GET['state_sel'] == '2'){ echo 'selected';}?>>后台手动预存</option>
+                        <option value="3" <?php if($_GET['state_sel'] == '3'){ echo 'selected';}?>>后台手动调款</option>
+                    </select>
+                </td>
                 <th><label for="query_start_time">下单时间</label></th>
                 <td>
                     <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
@@ -69,6 +79,7 @@
                         <li>充值成功金额:<?php echo $output['stats']['success_amount'];?></li>
                         <li>商户提交充值金额:<?php echo $output['stats']['mch_amount'];?></li>
                         <li>后台手动充值金额:<?php echo $output['stats']['system_amount'];?></li>
+                        <li>后台手动调款金额:<?php echo $output['stats']['system_edit_amount'];?></li>
                     <li></li>
                         <li>已驳回金额:<?php echo $output['stats']['cancel_amount'];?></li>
                         <li>待处理充值金额:<?php echo $output['stats']['send_amount'];?></li>

+ 6 - 0
admin/templates/default/provider.info.add.php

@@ -97,6 +97,12 @@
                 <td class="vatop rowform"><input type="text" id="admin_pwd" name="admin_pwd" class="txt"></td>
                 <td class="vatop tips"></td>
             </tr>
+            <tr>
+                <td colspan="2" class="required"><label>备注:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><textarea name="bz" rows="6" class="tarea"></textarea></td>
+            </tr>
             </tbody>
             <tfoot>
             <tr class="tfoot">

+ 7 - 1
admin/templates/default/provider.info.edit.php

@@ -1,7 +1,7 @@
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <style>
     .txt {
-        width: 18%!important;
+        width: 85%!important;
     }
 </style>
 <div class="page">
@@ -66,6 +66,12 @@
                 <td class="vatop"><input type="text" value="<?php echo $output['provider_info']['admin_pwd'];?>" name="admin_pwd" id="admin_pwd" class="txt"></td>
                 <td class="vatop tips"></td>
             </tr>
+            <tr>
+                <td colspan="2" class="required"><label>备注:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><textarea name="bz" rows="6" class="tarea"><?php echo $output['provider_info']['bz']?></textarea></td>
+            </tr>
             </tbody>
             <tfoot>
             <tr class="tfoot">

+ 4 - 2
admin/templates/default/provider.info.php

@@ -67,6 +67,7 @@
                 <th class="align-center">后台地址</th>
                 <th class="align-center">登录名称</th>
                 <th class="align-center">登录密码</th>
+                <th class="align-center">备注</th>
                 <th class="align-center">操作</th>
             </tr>
             </thead>
@@ -88,6 +89,7 @@
                         </td>
                         <td class="align-center"><?php echo $v['admin_name']; ?></td>
                         <td class="align-center"><?php echo $v['admin_pwd']; ?></td>
+                        <td class="align-center"><?php echo $v['bz']; ?></td>
                         <td class="align-center w200">
                             <a href="index.php?act=provider_info&op=edit&info_id=<?php echo $v['info_id'] ?>">编辑</a>
                             |
@@ -97,14 +99,14 @@
                 <?php } ?>
             <?php } else { ?>
                 <tr class="no_data">
-                    <td colspan="10"><?php echo $lang['nc_no_record']; ?></td>
+                    <td colspan="12"><?php echo $lang['nc_no_record']; ?></td>
                 </tr>
             <?php } ?>
             </tbody>
             <tfoot>
             <tr class="tfoot">
                 <td></td>
-                <td colspan="10">
+                <td colspan="12">
                     <div class="pagination"><?php echo $output['page']; ?></div>
                 </td>
             </tr>

+ 15 - 17
admin/templates/default/provider.order.stats.php

@@ -14,20 +14,13 @@
     input::placeholder{ 
         color:#333; 
     }
-    .row_q {
-    display: flex;
-        
-    }
     .row_q ul li {
         height: 30px;
         line-height: 30px;
     }
-    #merchant_name_form {
-        display: block;
-        margin-top: 123px;
-    }
-    .moveright {
-        margin-left: 40px;
+    .row_w {
+        float: left;
+        margin-right: 40px;
     }
 </style>
 <div class="page">
@@ -59,7 +52,7 @@
                 </td>
                 <th><label>统计日期类型</label></th>
                 <td>
-                    <select name="order_time_type">
+                    <select name="order_time_type" id="order_time_type">
                         <option value="">请选择...</option>
                         <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
                         <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
@@ -67,7 +60,7 @@
                 </td>
                 <th><label>通道名称</label></th>
                 <td>
-                    <select name="cid" class="querySelect" lay-verify="" lay-search>
+                    <select name="cid" id="cid" class="querySelect" lay-verify="" lay-search>
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
                         <?php foreach($output['provider_list'] as $provider){?>
                             <option value="<?php echo $provider['store_id']?>"
@@ -100,14 +93,14 @@
         </tr>
         <tr>
             <td class="row_q">
-                <ul>
+                <ul class="row_w">
                     <li>回调日期统计</li>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?></li>
                 </ul>
-                <ul class="moveright">
+                <ul>
                     <li>下单日期统计</li>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['order_time']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?></li>
@@ -140,6 +133,7 @@
                 <th class="align-center">金额误差</th>
                 <th class="align-center">备注</th>
                 <th class="align-center">匹配状态</th>
+                <th class="align-center">统计日期类型</th>
                 <th class="align-center"><?php echo $lang['operation']; ?></th>
             </tr>
             </thead>
@@ -172,6 +166,7 @@
                                 <span style="color: #fd9d0e">未编辑</span>
                             <?php }?>
                         </td>
+                        <td class="align-center"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
                         <td class="align-center w200">
                             <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=<?php echo $v['stat_id'];?>">重新统计</a>
                             |<a href="index.php?act=merchant&op=OrderStatsCheck&stat_id=<?php echo $v['stat_id'] ?>">编辑</a>
@@ -307,12 +302,15 @@
         $('#ncexport').click(function () {
             let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
             let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
-            let cid = $('select').val()
-            let text = $('select option:selected').text()
+            let cid = $('#cid').val()
+            let order_time_type = $('#order_time_type').val()
+            let text = $("#cid").find("option:selected").text();
+
             $.get('index.php?act=orderstats&op=ExportData&type=provider', {
                 query_start_time: starTime,
                 query_end_time: endTime,
-                cid: cid
+                cid: cid,
+                order_time_type:order_time_type
             }, function (data) {
                 data = JSON.parse(data)
                 if (data && data.data) {

+ 97 - 93
admin/templates/default/recharge.manual.add.php

@@ -1,104 +1,108 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <!--//zmr>v20-->
 <div class="page">
-  <div class="fixed-bar">
-    <div class="item-title">
-      <h3>预存款</h3>
-      <ul class="tab-base">
-          <li><a href="index.php?act=merchant&op=merchant" ><span><?php echo $lang['nc_manage'] ?></span></a></li>
-          <li><a href="index.php?act=merchant&op=merchant_add"><span><?php echo $lang['nc_new'] ?></span></a></li>
-        <li><a href="JavaScript:void(0);"  class="current"><span>加款</span></a></li>
-      </ul>
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>预存款</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="index.php?act=merchant&op=merchant_add"><span><?php echo $lang['nc_new'] ?></span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>加款</span></a></li>
+            </ul>
+        </div>
     </div>
-  </div>
-  <div class="fixed-empty"></div>
-  <form id="points_form" method="post" name="form1" enctype="multipart/form-data">
-    <input type="hidden" name="form_submit" value="ok" />
-    <input type="hidden" name="type" value="<?php echo $_GET['type'];?>" />
-    <table class="table tb-type2 nobdb">
-      <tbody>
-        <tr class="noborder">
-          <td colspan="2" class="required"><label class="validation">机构编号:</label></td>
-        </tr>
-        <tr class="noborder">
-          <td class="vatop rowform">
-            <input type="text" name="mch_id" id="mch_id" class="txt" value="<?php echo $_GET['mchid']?>" readonly>
-          <td class="vatop tips"></td>
-        </tr>
-        <tr class="noborder">
-            <td colspan="2" class="required"><label class="validation">开户人姓名:</label></td>
-        </tr>
-        <tr class="noborder">
-            <td class="vatop rowform">
-                <input type="text" name="bank_username" id="bank_username" class="txt" value="">
-            <td class="vatop tips"></td>
-        </tr>
-        <tr class="noborder">
-            <td colspan="2" class="required"><label class="validation">银行名称:</label></td>
-        </tr>
-        <tr class="noborder">
-            <td class="vatop rowform">
-                <input type="text" name="bank_name" id="bank_name" class="txt" value="">
-            <td class="vatop tips"></td>
-        </tr>
-        <tr>
-          <td colspan="2" class="required"><label class="validation">金额:</label></td>
-        </tr>
-        <tr class="noborder">
-          <td class="vatop rowform"><input type="text" id="pointsnum" name="pointsnum" class="txt" ></td>
-          <td class="vatop tips"></td>
-        </tr>
-        <tr>
-            <td colspan="2"><label>充值申请凭证:</label></td>
-        </tr>
-        <tr class="noborder">
-            <td class="vatop rowform">
+    <div class="fixed-empty"></div>
+    <form id="points_form" method="post" name="form1" enctype="multipart/form-data">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <input type="hidden" name="type" value="<?php echo $_GET['type']; ?>"/>
+        <input type="hidden" name="add_type" value="2"/>
+        <table class="table tb-type2 nobdb">
+            <tbody>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">机构编号:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <input type="text" name="mch_id" id="mch_id" class="txt" value="<?php echo $_GET['mchid'] ?>"
+                           readonly>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">开户人姓名:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <input type="text" name="bank_username" id="bank_username" class="txt" value="">
+                <td class="vatop tips"></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">银行名称:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <input type="text" name="bank_name" id="bank_name" class="txt" value="">
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
+                <td colspan="2" class="required"><label class="validation">金额:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><input type="text" id="pointsnum" name="pointsnum" class="txt"></td>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
+                <td colspan="2"><label>充值申请凭证:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
                 <span class="type-file-box">
-                    <input type='text' name='textfield' id='textfield1' class='type-file-text' />
-                    <input type='button' name='button' id='button1' value='' class='type-file-button' />
+                    <input type='text' name='textfield' id='textfield1' class='type-file-text'/>
+                    <input type='button' name='button' id='button1' value='' class='type-file-button'/>
                     <input name="voucher" type="file" class="type-file-file" id="voucher" size="30" hidefocus="true">
                 </span>
-            </td>
-            <td class="vatop tips"></td>
-        </tr>
-        <tr>
-          <td colspan="2" class="required"><label>描述信息:</label></td>
-        </tr>
-        <tr class="noborder">
-          <td class="vatop rowform"><textarea name="pointsdesc" rows="6" class="tarea"></textarea></td>
-          <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
-        </tr>
-      </tbody>
-      <tfoot>
-        <tr class="tfoot">
-          <td colspan="2" ><a href="JavaScript:void(0);" class="btn" onclick="document.form1.submit()"><span><?php echo $lang['nc_submit'];?></span></a></td>
-        </tr>
-      </tfoot>
-    </table>
-  </form>
+                </td>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
+                <td colspan="2" class="required"><label>描述信息:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><textarea name="pointsdesc" rows="6" class="tarea"></textarea></td>
+                <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
+            </tr>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td colspan="2"><a href="JavaScript:void(0);" class="btn"
+                                   onclick="document.form1.submit()"><span><?php echo $lang['nc_submit']; ?></span></a>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
 </div>
 <script type="text/javascript">
-$(function(){
-    $("#voucher").change(function(){
-        $("#textfield1").val($(this).val());
-    });
-    $('#points_form').validate({
-        rules : {
-            apply_id: {
-				required : true
-			},
-            pointsnum   : {
-                required : true,
-            }
-        },
-        messages : {
-            apply_id: {
-				required : '请输入申请编号'
-			},
-            pointsnum  : {
-                required : '请添加预存款'
+    $(function () {
+        $("#voucher").change(function () {
+            $("#textfield1").val($(this).val());
+        });
+        $('#points_form').validate({
+            rules: {
+                apply_id: {
+                    required: true
+                },
+                pointsnum: {
+                    required: true,
+                }
+            },
+            messages: {
+                apply_id: {
+                    required: '请输入申请编号'
+                },
+                pointsnum: {
+                    required: '请添加预存款'
+                }
             }
-        }
+        });
     });
-});
 </script>

+ 88 - 84
admin/templates/default/recharge.manual.edit.php

@@ -1,96 +1,100 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <!--//zmr>v20-->
 <div class="page">
-  <div class="fixed-bar">
-    <div class="item-title">
-      <h3>预存款</h3>
-      <ul class="tab-base">
-          <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
-          <li><a href="index.php?act=merchant&op=merchant_add"><span><?php echo $lang['nc_new'] ?></span></a></li>
-        <li><a href="JavaScript:void(0);"  class="current"><span>调款</span></a></li>
-      </ul>
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>预存款</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="index.php?act=merchant&op=merchant_add"><span><?php echo $lang['nc_new'] ?></span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>调款</span></a></li>
+            </ul>
+        </div>
     </div>
-  </div>
-  <div class="fixed-empty"></div>
+    <div class="fixed-empty"></div>
     <form id="points_form" method="post" name="form1" enctype="multipart/form-data">
-    <input type="hidden" name="form_submit" value="ok" />
-      <input type="hidden" name="type" value="<?php echo $_GET['type'];?>" />
-    <table class="table tb-type2 nobdb">
-      <tbody>
-        <tr class="noborder">
-          <td colspan="2" class="required"><label class="validation">机构编号:</label></td>
-        </tr>
-        <tr class="noborder">
-          <td class="vatop rowform">
-            <input type="text" name="mch_id" id="mch_id" class="txt" value="<?php echo $_GET['mchid']?>" readonly>
-          <td class="vatop tips"></td>
-        </tr>
-        <tr class="noborder">
-            <td colspan="2" class="required"><label class="validation">操作人姓名:</label></td>
-        </tr>
-        <tr class="noborder">
-            <td class="vatop rowform">
-                <input type="text" name="bank_username" id="bank_username" class="txt" value="">
-            <td class="vatop tips"></td>
-        </tr>
-        <tr>
-          <td colspan="2" class="required"><label class="validation">金额:</label></td>
-        </tr>
-        <tr class="noborder">
-          <td class="vatop rowform"><input type="text" id="pointsnum" name="pointsnum" class="txt" ></td>
-          <td class="vatop tips"></td>
-        </tr>
-        <tr>
-            <td colspan="2"><label>充值申请凭证:</label></td>
-        </tr>
-        <tr class="noborder">
-            <td class="vatop rowform">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <input type="hidden" name="type" value="<?php echo $_GET['type']; ?>"/>
+        <input type="hidden" name="add_type" value="3"/>
+        <table class="table tb-type2 nobdb">
+            <tbody>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">机构编号:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <input type="text" name="mch_id" id="mch_id" class="txt" value="<?php echo $_GET['mchid'] ?>"
+                           readonly>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">操作人姓名:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <input type="text" name="bank_username" id="bank_username" class="txt" value="">
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
+                <td colspan="2" class="required"><label class="validation">金额:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><input type="text" id="pointsnum" name="pointsnum" class="txt"></td>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
+                <td colspan="2"><label>充值申请凭证:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
                 <span class="type-file-box">
-                    <input type='text' name='textfield' id='textfield1' class='type-file-text' />
-                    <input type='button' name='button' id='button1' value='' class='type-file-button' />
+                    <input type='text' name='textfield' id='textfield1' class='type-file-text'/>
+                    <input type='button' name='button' id='button1' value='' class='type-file-button'/>
                     <input name="voucher" type="file" class="type-file-file" id="voucher" size="30" hidefocus="true">
                 </span>
-            </td>
-            <td class="vatop tips"></td>
-        </tr>
-        <tr>
-          <td colspan="2" class="required"><label>描述信息:</label></td>
-        </tr>
-        <tr class="noborder">
-          <td class="vatop rowform"><textarea name="pointsdesc" rows="6" class="tarea"></textarea></td>
-          <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
-        </tr>
-      </tbody>
-      <tfoot>
-        <tr class="tfoot">
-          <td colspan="2" ><a href="JavaScript:void(0);" class="btn" onclick="document.form1.submit()"><span><?php echo $lang['nc_submit'];?></span></a></td>
-        </tr>
-      </tfoot>
-    </table>
-  </form>
+                </td>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
+                <td colspan="2" class="required"><label>描述信息:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><textarea name="pointsdesc" rows="6" class="tarea"></textarea></td>
+                <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
+            </tr>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td colspan="2"><a href="JavaScript:void(0);" class="btn"
+                                   onclick="document.form1.submit()"><span><?php echo $lang['nc_submit']; ?></span></a>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
 </div>
 <script type="text/javascript">
-$(function(){
-    $("#voucher").change(function(){
-        $("#textfield1").val($(this).val());
-    });
-    $('#points_form').validate({
-        rules : {
-            apply_id: {
-				required : true
-			},
-            pointsnum   : {
-                required : true,
-            }
-        },
-        messages : {
-            apply_id: {
-				required : '请输入申请编号'
-			},
-            pointsnum  : {
-                required : '请添加预存款'
+    $(function () {
+        $("#voucher").change(function () {
+            $("#textfield1").val($(this).val());
+        });
+        $('#points_form').validate({
+            rules: {
+                apply_id: {
+                    required: true
+                },
+                pointsnum: {
+                    required: true,
+                }
+            },
+            messages: {
+                apply_id: {
+                    required: '请输入申请编号'
+                },
+                pointsnum: {
+                    required: '请添加预存款'
+                }
             }
-        }
+        });
     });
-});
 </script>

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

@@ -462,6 +462,8 @@
         $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
         $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
         $('#ncsubmit').click(function () {
+            var index = layer.load(0, {shade: false}); 
+
             $('input[name="op"]').val('index');
             let selectArr = selest_nc.getValue();
             let selectStr = ''
@@ -475,6 +477,7 @@
         });
         // 导出
         $('#ncexport').click(function () {
+            
             $('input[name="export"]').val('1');
             $('input[name="op"]').val('index');
             // 不包含客户
@@ -487,9 +490,18 @@
             $('input[name="no_mchid"]').val(selectStr);
             $('#formSearch').submit();
             $('input[name="export"]').val('');
+            var ii = layer.load();
+            setTimeout(function(){
+                layer.close(ii);
+            }, 800);
         })
         // 对账导出
         $('#ncexport_stats').click(function () {
+            var ii = layer.load();
+            setTimeout(function(){
+                layer.close(ii);
+            }, 800);
+
             $('input[name="export_stats"]').val('1');
             $('input[name="op"]').val('index');
             // 不包含客户
@@ -505,6 +517,7 @@
         })
         //搜索+统计 
         $('#ncstat').click(function () {
+            var index = layer.load(0, {shade: false}); 
             $('input[name="fShowStat"]').val('1');
             $('input[name="op"]').val('index');
             // 不包含客户

+ 11 - 18
admin/templates/default/system.order.stats.php

@@ -1,23 +1,12 @@
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <style>
-.row_q {
-    display: inline-block;
-        
-    }
-    .row_q ul {
-    display: inline-block;
-
-    }
     .row_q ul li {
         height: 30px;
         line-height: 30px;
     }
-    #merchant_name_form {
-        display: block;
-        margin-top: 123px;
-    }
-    .moveright {
-        margin-left: 40px;
+    .row_w {
+        float: left;
+        margin-right: 40px;
     }
 </style>
 <div class="page">
@@ -48,7 +37,7 @@
                 <td>
                 <th><label>统计日期类型</label></th>
                 <td>
-                    <select name="order_time_type">
+                    <select name="order_time_type" id="order_time_type">
                         <option value="">请选择...</option>
                         <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
                         <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
@@ -79,14 +68,14 @@
           </tr>
           <tr>
             <td class="row_q">
-                <ul>
+                <ul class="row_w">
                     <li>回调日期统计</li>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?></li>
                 </ul>
-                <ul class="moveright">
+                <ul>
                     <li>下单日期统计</li>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['order_time']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?></li>
@@ -114,6 +103,7 @@
                 <th class="align-center">订单总量</th>
                 <th class="align-center">失败订单数量</th>
                 <th class="align-center">成功占比</th>
+                <th class="align-center">统计日期类型</th>
 <!--                <th class="align-center">操作</th>-->
             </tr>
             </thead>
@@ -133,6 +123,7 @@
                         <td class="align-center"><?php echo $v['order_count']; ?></td>
                         <td class="align-center"><?php echo $v['cancel_count']; ?></td>
                         <td class="align-center"><?php echo $v['success_ratio']; ?></td>
+                        <td class="align-center"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
 <!--                        <td class="align-center w200">-->
 <!--                            <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=--><?php //echo $v['stat_id'];?><!--">重新统计</a>-->
 <!--                        </td>-->
@@ -266,9 +257,11 @@
         $('#ncexport').click(function () {
             let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
             let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let order_time_type = $('#order_time_type').val();
             $.get('index.php?act=orderstats&op=ExportData', {
                 query_start_time: starTime,
-                query_end_time: endTime
+                query_end_time: endTime,
+                order_time_type:order_time_type
             }, function (data) {
                 data = JSON.parse(data)
                 if (data && data.data) {

+ 2 - 2
data/config/dev/base.ini.php

@@ -46,8 +46,8 @@ $config['gip'] 		= 0;
 $config['dbdriver'] = 'mysqli';
 $config['tablepre']	= 'lrlz_';
 
-define('SSH_TUNEL_PROD','local');
-//define('SSH_TUNEL_PROD','xyz');
+//define('SSH_TUNEL_PROD','local');
+define('SSH_TUNEL_PROD','xyz');
 //define('SSH_TUNEL_PROD','lingzh');
 
 if(SSH_TUNEL_PROD ==='local') {

+ 65 - 5
data/config/win/refill.ini.php

@@ -801,16 +801,16 @@ $afd_phone = ['name' => 'afd', 'store_id' => 54,'qualitys' => '1',
     ],
     'refill_type' => 'api'];
 
-$qianqianman_phone = ['name' => 'qianqianman', 'store_id' => 53, 'qualitys' => '7',
+$qianqianman_phone = ['name' => 'qianqianman', 'store_id' => 53, 'qualitys' => '5',
     'amount' => [
         50 => [
-            ['goods_id' => 6560, 'price' => 45.5, 'quality' => 7, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6560, 'price' => 45.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6561, 'price' => 91, 'quality' => 7, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6561, 'price' => 91, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6562, 'price' => 182, 'quality' => 7, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6562, 'price' => 182, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -912,6 +912,64 @@ $zanzan_phone = ['name' => 'zanzan', 'store_id' => 60, 'qualitys' => '5',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$feinimoshu_hf_phone = ['name' => 'feinimoshu_hf', 'store_id' => 62, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6620, 'price' => 9.62, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 6621, 'price' => 19.24, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 6622, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6623, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6624, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6625, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6626, 'price' => 288.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 6627, 'price' => 481, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yinteng_phone = ['name' => 'yinteng', 'store_id' => 63, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6628, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 6629, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 6630, 'price' => 28.41, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6631, 'price' => 47.35, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6632, 'price' => 94.7, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6633, 'price' => 189.4, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6634, 'price' => 284.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 6635, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -948,7 +1006,9 @@ $phone_providers = [
     ['name' => 'qianqianman', 'cfg' => $qianqianman_phone],
     ['name' => 'weiyiwt', 'cfg' => $weiyiwt_phone],
     ['name' => 'xiaochuang', 'cfg' => $xiaochuang_phone],
-    ['name' => 'zanzan', 'cfg' => $zanzan_phone]
+    ['name' => 'zanzan', 'cfg' => $zanzan_phone],
+    ['name' => 'feinimoshu_hf', 'cfg' => $feinimoshu_hf_phone],
+    ['name' => 'yinteng', 'cfg' => $yinteng_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 68 - 8
data/config/xyz/refill.ini.php

@@ -551,15 +551,15 @@ $yunling_phone = ['name' => 'yunling', 'store_id' => 37, 'qualitys' => '1',
             ['goods_id' => 6456, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6457, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6457, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6457, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6457, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6458, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6458, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6458, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6459, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6459, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6459, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
@@ -567,15 +567,15 @@ $yunling_phone = ['name' => 'yunling', 'store_id' => 37, 'qualitys' => '1',
             ['goods_id' => 6460, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6461, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6461, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6461, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6462, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6462, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6462, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6463, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6463, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6463, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ]
     ],
@@ -912,6 +912,64 @@ $zanzan_phone = ['name' => 'zanzan', 'store_id' => 60, 'qualitys' => '5',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$feinimoshu_hf_phone = ['name' => 'feinimoshu_hf', 'store_id' => 62, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6620, 'price' => 9.62, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 6621, 'price' => 19.24, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 6622, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6623, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6624, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6625, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6626, 'price' => 288.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 6627, 'price' => 481, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yinteng_phone = ['name' => 'yinteng', 'store_id' => 63, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6628, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 6629, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 6630, 'price' => 28.41, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6631, 'price' => 47.35, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6632, 'price' => 94.7, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6633, 'price' => 189.4, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6634, 'price' => 284.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 6635, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -948,7 +1006,9 @@ $phone_providers = [
     ['name' => 'qianqianman', 'cfg' => $qianqianman_phone],
     ['name' => 'weiyiwt', 'cfg' => $weiyiwt_phone],
     ['name' => 'xiaochuang', 'cfg' => $xiaochuang_phone],
-    ['name' => 'zanzan', 'cfg' => $zanzan_phone]
+    ['name' => 'zanzan', 'cfg' => $zanzan_phone],
+    ['name' => 'feinimoshu_hf', 'cfg' => $feinimoshu_hf_phone],
+    ['name' => 'yinteng', 'cfg' => $yinteng_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 1 - 1
helper/rbridge/wsd/Bridge.php

@@ -46,10 +46,10 @@ class Bridge implements IBridge
             'mch_order' => $params['chargeId'],
             'notify_url' => config::MCH_NOTIFY_URL];
 
-        refill\util::push_queue($mchid,$params['chargeId'],time());
         $code = refill\util::push_add($input);
         if($code) {
             $ret = $this->retbody($code, '提交成功', $params);
+            refill\util::push_queue_order($mchid,$params['chargeId'],ORDER_STATE_QUEUE);
         }
         else {
             $ret = $this->retbody($code, '提交失败', $params);

+ 8 - 0
helper/refill/RefillBase.php

@@ -155,6 +155,7 @@ class RefillBase
         }
 
         $mod_refill->edit($order_id, ['notify_time' => time(), 'notify_state' => 1]);
+        util::pop_queue_order($mchid,$mch_order);
         QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
         util::del_exclude_channel($mchid,$mch_order,$card_type);
 
@@ -442,6 +443,7 @@ class RefillBase
             else
             {
                 if($neterr && util::need_check($net_errno)) {
+                    //
                     break;
                 }
 
@@ -612,6 +614,9 @@ class RefillBase
                 $refill_order = Model('refill_order');
                 $refill_order->edit($order_id, ['notify_time' => time(), 'notify_state' => 1,'is_retrying' => 0]);
                 mtopcard\cards_helper::assign($order_id);
+
+                $refill_info = $refill_order->getOrderInfo(['order_id' => $order_id]);
+                util::pop_queue_order($refill_info['mchid'],$refill_info['mch_order']);
             }
             else {
                 $tran->commit();
@@ -645,6 +650,9 @@ class RefillBase
                 $refill_order = Model('refill_order');
                 $refill_order->edit($order_id, ['notify_time' => time(), 'notify_state' => 1,'is_retrying' => 0]);
                 mtopcard\cards_helper::reuse($order_id);
+
+                $refill_info = $refill_order->getOrderInfo(['order_id' => $order_id]);
+                util::pop_queue_order($refill_info['mchid'],$refill_info['mch_order']);
             }
             else {
                 $tran->commit();

+ 68 - 0
helper/refill/api/xyz/feinimoshu_hf/RefillCallBack.php

@@ -0,0 +1,68 @@
+<?php
+
+
+namespace refill\feinimoshu_hf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/feinimoshu_hf/config.php');
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['signature']);
+        $sign = $this->sign($input);
+        if ($params['appid'] == config::APPID && $params['signature'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($input)
+    {
+        $key = config::APPKEY;
+        $input['token'] = $key;
+        $body = config::body($input);
+
+        return strtolower(md5($body));
+    }
+
+    //[$order_id, $success, $can_try, $need_handle]
+    public function notify($params)
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['morder'];
+        $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'] = strtolower($params['vnum']) == 'null' ? '' : $params['vnum'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 116 - 0
helper/refill/api/xyz/feinimoshu_hf/RefillPhone.php

@@ -0,0 +1,116 @@
+<?php
+namespace refill\feinimoshu_hf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/feinimoshu_hf/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $card_no, int $amount, string $order_sn)
+    {
+        $params['appid'] = config::APPID;
+        $params['notify'] = config::NOTIFY_URL;
+        $params['card'] = $card_no;
+        $params['order'] = $order_sn;
+        $params['cash'] = $amount;
+        $params['proid'] = 10012;
+
+        return $params;
+    }
+
+
+    public function add($card_no, $card_type,$amount,$input)
+    {
+        $order_sn = $input['order_sn'];
+        $params = $this->req_params($card_no,$amount,$order_sn);
+
+        $sign = $this->sign($params);
+        $params['signature'] = $sign;
+
+        $resp = http_request(config::ORDER_URL,$params,'GET');
+        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'], false];
+            } else {
+                return [false, $resp['info'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appid'] = config::APPID;
+        $params['morder'] = $refill_info['order_sn'];
+        $sign = $this->sign($params);
+        $params['signature'] = $sign;
+
+        $resp = http_request(config::QUERY_URL,$params);
+        if (empty($resp)) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = json_decode($resp,true);
+
+            if (empty($resp)) {
+                return [false, '返回值错误'];
+            }
+
+            $code = intval($resp['code']);
+            $status = intval($resp['data']['status']);
+
+            if ($code != 1) {
+                return [false, $resp['info']];
+            } elseif ($status == 2) {
+                $order_state = ORDER_STATE_SUCCESS;
+                $data['official_sn'] = strtolower($params['vnum']) == 'null' ? '' : $params['vnum'];
+                Model('refill_order')->edit($refill_info['order_id'], $data);
+            } elseif ($status == 3) {
+                $order_state = ORDER_STATE_CANCEL;
+            } else {
+                $order_state = ORDER_STATE_SEND;
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['appid'] = config::APPID;
+        $sign = $this->sign($params);
+        $params['signature'] = $sign;
+
+        $resp = http_request(config::QUERY_URL,$params);
+        if($resp === false) {
+        }
+        else {
+
+        }
+    }
+
+    private function sign($input)
+    {
+        $key = config::APPKEY;
+        $body = config::body($input);
+        $body .= "&token={$key}";
+
+        return strtolower(md5($body));
+    }
+}

+ 46 - 0
helper/refill/api/xyz/feinimoshu_hf/config.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace refill\feinimoshu_hf;
+class config
+{
+    const CHANNEL_HOST = 'http://122.114.168.35';
+    const ORDER_URL = config::CHANNEL_HOST . '/gateway/api.run/submit';
+    const QUERY_URL = config::CHANNEL_HOST . '/gateway/api.run/order';
+    const BALANCE_URL = config::CHANNEL_HOST . '/gateway/api.run/account';
+
+    const APPID = 'CZ30533982';
+    const APPKEY = 'lvrg4xoqvrozuq2irjza2a6dlenrsv';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_feinimoshu_hf.php";
+
+    public static function body($params)
+    {
+        ksort($params);
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v)
+        {
+            if (false === self::check_empty($v) && "@" != substr($v, 0, 1))
+            {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+        return $body;
+    }
+
+    private static function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+}

+ 55 - 0
helper/refill/api/xyz/suning/RefillCallBack.php

@@ -0,0 +1,55 @@
+<?php
+namespace refill\suning;
+require_once(BASE_HELPER_RAPI_PATH . '/suning/config.php');
+
+use refill;
+use Log;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        //苏宁接口提交成功即订单成功,只需处理成功
+        $order_sn = $params['order_sn'];
+        $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'];
+
+        $card_info = $params['cardList'];
+        if(!empty($card_info))
+        {
+            $result = $this->rsa_decode($card_info['password']);
+            if (empty($result)) {
+                $data['ret_state'] = 2;
+                $data['card_info'] = '回调解密,解密失败';
+            } else {
+                $data['ret_state'] = 1;
+                $card_info['password'] = $result;
+                $result = json_encode($card_info);
+                $data['card_info'] = $result;
+            }
+            Model('thrid_refill')->edit_third($order_id, $data);
+        }
+        return [$order_id, true, false,true];
+    }
+
+    private function rsa_decode($encrypted)
+    {
+        $ret = openssl_private_decrypt(base64_decode($encrypted), $decrypted, config::PRIVATE_KEY);
+        if ($ret) {
+            $result = json_decode($decrypted, true);
+            return $result;
+        } else {
+            $err = openssl_error_string();
+            Log::record("suning callback openssl_private_decrypt error={$err}",Log::ERR);
+            return false;
+        }
+    }
+}

+ 168 - 0
helper/refill/api/xyz/suning/RefillPhone.php

@@ -0,0 +1,168 @@
+<?php
+
+namespace refill\suning;
+
+require_once(BASE_HELPER_RAPI_PATH . '/suning/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function goods($quality,int $amount,int $card_type,$other)
+    {
+        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$other);
+        if($goods_id <= 0) return [0,0];
+
+        $store_id = $this->mStoreID;
+        $pcode = $other['product_code'];
+        $thrid_refill = Model('thrid_refill');
+        $product = $thrid_refill->getProviderProduct($store_id,$goods_id,$pcode);
+        if(empty($product)) {
+            Log::record("cannot find provider's produce where name={$this->mName}, goods_id = {$goods_id} pcode={$pcode}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($product['channel_amount'])];
+        }
+    }
+
+    private function req_params(string $order_sn, string $product_code,$quantity)
+    {
+        $params['partner'] = config::PARTNER;
+        $params['service'] = 'cardSaleAgent';
+        $params['format'] = 'json';
+        $params['orderTime'] = date("YmdHis",time());
+        $params['partnerOrderNo'] = $order_sn;
+        $params['productNo'] = $product_code;
+        $params['quantity'] = 1;
+        $params['amount'] = $quantity * 100;
+        return $params;
+    }
+
+    private function getProductCode($goods_id,$sys_pcode)
+    {
+        $thrid_refill = Model('thrid_refill');
+        $product = $thrid_refill->getProviderProduct($this->mStoreID,$goods_id,$sys_pcode);
+        if (empty($product)) {
+            return false;
+        } else {
+            return $product['channel_code'];
+        }
+    }
+
+    //直充提单
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        if(empty($card_no)) {
+            return $this->cardkey_add($params);
+        } else {
+            return $this->direct_add($card_no, $params);
+        }
+    }
+
+    private function direct_add($card_no, $params)
+    {
+        $order_sn = $params['order_sn'];
+        $goods_id = intval($params['goods_id']);
+        $product_code = $this->getProductCode($goods_id,$params['product_code']);
+
+        Model('thrid_refill')->edit_third($params['order_id'], ['chcode' => $product_code]);
+        $quantity = intval($params['quantity']);
+
+        $params = $this->req_params($order_sn,$product_code,$quantity);
+
+        $params['userName'] = $card_no;
+        $params['bizType'] = '02';
+        $sign = $this->sign($params);
+        $params['Sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params);
+        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['respCode'] == 00) {
+                $notify_data = $this->notify_data_format($resp);
+                //可替换延迟回调
+                refill\util::push_notify('suning',$notify_data);
+                return [true, $resp['orderNo'], false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    private function cardkey_add($params)
+    {
+        $order_sn = $params['order_sn'];
+        $goods_id = intval($params['goods_id']);
+        $product_code = $this->getProductCode($goods_id,$params['product_code']);
+        Model('thrid_refill')->edit_third($params['order_id'], ['chcode' => $product_code]);
+
+        $quantity = intval($params['quantity']);
+        $params = $this->req_params($order_sn,$product_code,$quantity);
+        $params['bizType'] = '01';
+        $sign = $this->sign($params);
+        $params['Sign'] = $sign;
+
+        $resp = http_request(config::CARD_ORDER_URL, $params);
+        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['respCode'] == 00) {
+                $notify_data = $this->notify_data_format($resp);
+                //可替换延迟回调
+                refill\util::push_notify('suning',$notify_data);
+                return [true, $resp['orderNo'], false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        return [false, '苏宁三方下单即回调,无需查询接口'];
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if ($i == 0) {
+                $body .= "{$k}={$v}";
+            } else {
+                $body .= "&{$k}={$v}";
+            }
+            $i++;
+        }
+        return bin2hex(hash_hmac("sha1", $body, config::APP_KEY, true));
+    }
+
+    private function notify_data_format($params): array
+    {
+        $data['order_sn'] = $params['partnerOrderNo'];
+        $data['cardList'] = $params['cardList'];
+
+        return $data;
+    }
+}

+ 54 - 0
helper/refill/api/xyz/suning/config.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace refill\suning;
+
+class config
+{
+    //正式地址及正式账号信息
+    const ORDER_URL = 'http://video.api.sctongqian.com/Order/DirectOrder';//直充订单提交地址
+    const CARD_ORDER_URL = 'http://video.api.sctongqian.com/Order/CardOrder';//卡密订单提交地址
+    const QUERY_URL= 'http://video.api.sctongqian.com/Business/QueryOrder';
+
+
+    const PARTNER = 'YZKJ';
+
+    const APP_KEY= 211394768;
+    const App_Secret = 'vA+24E7SOUWPAIHvNMdXyw==';
+
+    //沙箱环境账号
+//    const ORDER_URL = 'http://182.150.21.90:8050/Order/DirectOrder';//直充订单提交地址
+//    const CARD_ORDER_URL = 'http://182.150.21.90:8050/Order/CardOrder';//卡密订单提交地址
+//    const QUERY_URL= 'http://182.150.21.90:8050/Business/QueryOrder';
+//    const APP_KEY= 211394658;
+//    const App_Secret = 'ZZV9akQWGkmR0ln6zOGmsQ==';
+
+    const NOTIFY_URL = BASE_SITE_URL . "/racc/callback/lingzh/sctongqian.php";
+    const API_IP = NET_IP;
+
+    const PUBLIC_KEY = <<<heredoc
+-----BEGIN RSA PUBLIC KEY-----
+MIGJAoGBAJZPPaJkFbdhTmSqc3aNSLTOXA3PpEZ8aZflS0h5ZTF7NSm3cGBBMZ2K
+giFAhf4CoqYpeUGiq5iFIfRvLLihidocr8QAlTuVdwUv7dWc0BP3bWWwK3j7re0m
+Pu0xhetm8hmyF6UWQxr+4D+tiWtLj1NZEv6ZPf6d4XSgxDpFGtq1AgMBAAE=
+-----END RSA PUBLIC KEY-----
+heredoc;
+
+    const PRIVATE_KEY = <<<heredoc
+-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAlwAAAAdzc2gtcn
+NhAAAAAwEAAQAAAIEAlk89omQVt2FOZKpzdo1ItM5cDc+kRnxpl+VLSHllMXs1KbdwYEEx
+nYqCIUCF/gKipil5QaKrmIUh9G8suKGJ2hyvxACVO5V3BS/t1ZzQE/dtZbArePut7SY+7T
+GF62byGbIXpRZDGv7gP62Ja0uPU1kS/pk9/p3hdKDEOkUa2rUAAAIQSSgusUkoLrEAAAAH
+c3NoLXJzYQAAAIEAlk89omQVt2FOZKpzdo1ItM5cDc+kRnxpl+VLSHllMXs1KbdwYEExnY
+qCIUCF/gKipil5QaKrmIUh9G8suKGJ2hyvxACVO5V3BS/t1ZzQE/dtZbArePut7SY+7TGF
+62byGbIXpRZDGv7gP62Ja0uPU1kS/pk9/p3hdKDEOkUa2rUAAAADAQABAAAAgDZc7IbKOg
+x8FhVUjLQo/03dgO/B1MFlh+9XD/ZjaZUO4bh3zx4RFjfLe6s5If0vyNHeGCwEAJoGNLSq
+bPtN+YQqi3GIYEgscHCQYrsa/TMEn4Svrd+1VRoxYrPN+zgpTf1MXcPW22xr2K433u+f4l
+M19Dmi/G3u5mY0lorAyzPBAAAAQQCq6lRGiMBLuO46a4Cw5KWarqWH63B0Dlp/mry7ugnL
+GeBOhYJmzlA5sMWpTg3XyzOxez11Oo+nUn2ByF+XrLcdAAAAQQDF42SO61xOpf5qVN84XV
+s1wcNcJxuhPhet43A8VqAo8MC4f522Lp3/4B1Uf/hwzAx5Gg2tkFnx8eXobsvceG1lAAAA
+QQDCcwggFzrz6BiNE4Tqmz6TDOuH13wyXqUXGgO3fjibIoJCwSo+KggqhlPUM7zDWSbhns
+NJd7JPEi6j+lOvY0sRAAAAGnN0YW5sZXkta2luZ0BTdGFubGV5TWFjcHJv
+-----END OPENSSH PRIVATE KEY-----
+heredoc;
+}

BIN
helper/refill/api/xyz/suning/苏宁卡API销售接口说明v1.6.1.pdf


+ 50 - 0
helper/refill/api/xyz/yinteng/RefillCallBack.php

@@ -0,0 +1,50 @@
+<?php
+namespace refill\yinteng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yinteng/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $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'] = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 102 - 0
helper/refill/api/xyz/yinteng/RefillPhone.php

@@ -0,0 +1,102 @@
+<?php
+
+namespace refill\yinteng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yinteng/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 $amount, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['szVerifyString'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders);
+
+        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['nRtn'] == 0) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['szRtnCode'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            $status = intval($resp['nRtn']);
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019])) {
+                $order_state = ORDER_STATE_SEND;
+            } else {
+                return [false, $status];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 21 - 0
helper/refill/api/xyz/yinteng/config.php

@@ -0,0 +1,21 @@
+<?php
+
+
+namespace refill\yinteng;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.41.208.107:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://121.41.208.107:10186/plat/api/old/queryorder';
+
+    const USER_ID= '200009';
+    const KEY = '3ee7b46ecac14e1e95d554c5ea8752c2';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yinteng.php";
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+}

+ 10 - 0
helper/refill/api/xyz/yinteng/北京椰子开户信息.txt

@@ -0,0 +1,10 @@
+客户端地址:http://121.41.208.107:10186/plat/index
+
+账号:yezi123密码:123456(登录请修改密码)
+
+密钥:3ee7b46ecac14e1e95d554c5ea8752c2
+ID:200009
+
+授信金额:5万
+
+IP:121.41.208.107

+ 9 - 0
helper/refill/api/xyz/yinteng/接口地址.txt

@@ -0,0 +1,9 @@
+正式环境:
+话费下单地址:http://121.41.208.107:10186/plat/api/old/submitorder
+查询地址:http://121.41.208.107:10186/plat/api/old/queryorder
+查询余额地址:http://121.41.208.107:10186/plat/api/old/queryBalance
+
+测试ID:200000
+秘钥:2a7533687d974571a2051ad555bfd2f5
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ

+ 48 - 52
helper/refill/api/xyz/yunlingfs/RefillCallBack.php

@@ -1,53 +1,49 @@
-<?php
-
-
-namespace refill\yunlingfs;
-
-require_once(BASE_HELPER_RAPI_PATH . '/yunlingfs/config.php');
-
-
-use refill;
-use Log;
-
-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)
-    {
-        $userid = config::USER_ID;
-        $key = config::KEY;
-        $content = "userid={$userid}&orderid={$params['orderid']}&sporderid={$params['sporderid']}&merchantsubmittime={$params['merchantsubmittime']}";
-        $content .= "&resultno={$params['resultno']}&key={$key}";
-        return md5($content);
-    }
-
-    public function notify($params)
-    {
-        $status = intval($params['resultno']);
-        $order_sn = $params['sporderid'];
-        $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 === 1) {
-            $data['official_sn'] = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
-            Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false, true];
-        } elseif ($status === 9) {
-            return [$order_id, false, true, true];
-        } else {
-            return [$order_id, false, false, false];
-        }
-    }
+<?php
+namespace refill\yunlingfs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yunlingfs/config.php');
+use refill;
+use Log;
+
+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)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$userid}&orderid={$params['orderid']}&sporderid={$params['sporderid']}&merchantsubmittime={$params['merchantsubmittime']}";
+        $content .= "&resultno={$params['resultno']}&key={$key}";
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['resultno']);
+        $order_sn = $params['sporderid'];
+        $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 === 1) {
+            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
 }

+ 5 - 49
helper/refill/api/xyz/yunlingfs/RefillPhone.php

@@ -14,31 +14,24 @@ class RefillPhone extends refill\IRefillPhone
         parent::__construct($cfgs);
     }
 
-    private function req_params(int $phone, int $amount, string $order_sn)
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
     {
         $params['userid'] = config::USER_ID;
         $params['productid'] = '';
-        $params['productType'] = '1';
         $params['price'] = $amount;
         $params['num'] = 1;
         $params['mobile'] = $phone;
         $params['spordertime'] = date("YmdHis");
         $params['sporderid'] = $order_sn;
         $params['back_url'] = config::NOTIFY_URL;
+        $params['paytype'] = config::operator[$card_type];
         return $params;
     }
 
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
         $order_sn = $params['order_sn'];
-        $params = $this->req_params($card_no, $amount, $order_sn);
-        $params['operator'] = config::operator[$card_type];
-        $region = $this->getPhoneInfo($card_no);
-        if($region === false) {
-            return [false, '归属地获取失败', false];
-        }
-
-        $params['region'] = $region;
+        $params = $this->req_params($card_no, $card_type, $amount, $order_sn);
         $sign = $this->sign($params);
         $params['sign'] = $sign;
 
@@ -55,7 +48,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, '网络错误', true];
             }
             $resultno = intval($resp['resultno']);
-            if (in_array($resultno, [0,1,2])) {
+            if (in_array($resultno, [0,2])) {
                 return [true, $resp['orderid'], false];
             } else {
                 return [false, $resp['message'], false];
@@ -84,7 +77,7 @@ class RefillPhone extends refill\IRefillPhone
             $resultno = intval($resp['resultno']);
             if ($resultno === 1) {
                 $order_state = ORDER_STATE_SUCCESS;
-                $updata['official_sn'] = $resp['supnumber'];
+                $updata['official_sn'] = $resp['remark1'];
                 Model('refill_order')->edit($refill_info['order_id'], $updata);
             } elseif ($resultno === 9) {
                 $order_state = ORDER_STATE_CANCEL;
@@ -115,41 +108,4 @@ class RefillPhone extends refill\IRefillPhone
 
         return $val;
     }
-
-    private function getPhoneInfo($phone)
-    {
-        $url = "https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel={$phone}";
-        $resp = http_request($url);  //获取API返回 的数据
-        $resp = mb_convert_encoding($resp, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5'); //解决中文乱码
-
-        $datas = explode('=', $resp);
-        if(count($datas) == 2)
-        {
-            $body = trim($datas[1]);
-            if(preg_match_all("/(\w+):'([^']+)/", $body, $m)) {
-                $res = array_combine($m[1], $m[2]);
-                return $this->formatProvince($res['province']);
-            }
-        }
-        return false;
-    }
-
-    public function formatProvince(string $province) : string
-    {
-        if(empty($province)) {
-            return '';
-        }
-
-        $checkArr = ["省","市","自治区","特别行政区"];
-
-        for($i = 0; $i < count($checkArr); $i++) {
-            if(strpos($province, $checkArr[$i]) === false) {
-                continue;
-            } else {
-                $province = mb_strcut($province, 0, strrpos($province, $checkArr[$i]));
-            }
-        }
-
-        return $province;
-    }
 }

+ 16 - 18
helper/refill/api/xyz/yunlingfs/config.php

@@ -1,19 +1,17 @@
-<?php
-
-
-namespace refill\yunlingfs;
-
-use mtopcard;
-class config
-{
-    const ORDER_URL = 'http://39.101.180.197:8177/soft/onlinepay.do';
-    const QUERY_URL= 'http://39.101.180.197:8177/soft/searchpay.do';
-    const USER_ID= '10073527';
-    const KEY = 'BA804D1914CFCDD19AB86EED110E0EF4';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_yunlingfs.php";
-    const operator = [
-        mtopcard\ChinaMobileCard  => '移动',
-        mtopcard\ChinaUnicomCard  => '联通',
-        mtopcard\ChinaTelecomCard => '电信'
-    ];
+<?php
+namespace refill\yunlingfs;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.89.243.74:9086/onlinepay.do';
+    const QUERY_URL= 'http://121.89.243.74:9086/searchpay.do';
+    const USER_ID= '10002543';
+    const KEY = 'c3SRnHJ7Bcj544MsdxY2mesADs33QGtz';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_yunlingfs.php";
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'yd',
+        mtopcard\ChinaUnicomCard  => 'lt',
+        mtopcard\ChinaTelecomCard => 'dx'
+    ];
 }

+ 13 - 0
helper/refill/api/xyz/yunlingfs/新系椰子分省通代理信息.txt

@@ -0,0 +1,13 @@
+代理平台:
+代理登录地址:http://121.89.243.74:7080/login.jsp
+登录账号:yezifs
+登录密码:yezi131419
+
+
+
+接口使用:
+用户编号(userid):10002543
+秘钥(key):c3SRnHJ7Bcj544MsdxY2mesADs33QGtz
+余额查询地址:http://121.89.243.74:9086/searchbalance.do
+接口充值地址:http://121.89.243.74:9086/onlinepay.do
+主动查单地址:http://121.89.243.74:9086/searchpay.do

BIN
helper/refill/api/xyz/yunlingfs/新系统通信充值接口 - 副本.doc


+ 19 - 19
helper/refill/util.php

@@ -213,8 +213,8 @@ class util
     public static function push_add($params)
     {
         try {
-            queue\DispatcherClient::instance()->push('add', $params);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('add', $params);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -223,8 +223,8 @@ class util
     public static function push_addthird($params)
     {
         try {
-            queue\DispatcherClient::instance()->push('addthird', $params);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('addthird', $params);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -233,8 +233,8 @@ class util
     public static function push_notify($chname, $params)
     {
         try {
-            queue\DispatcherClient::instance()->push('notify', ['channel' => $chname, 'params' => $params]);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('notify', ['channel' => $chname, 'params' => $params]);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -243,8 +243,8 @@ class util
     public static function push_notify_merchant($order_id, $manual)
     {
         try {
-            queue\DispatcherClient::instance()->push('notify_mechant', ['order_id' => $order_id, 'manual' => $manual]);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('notify_mechant', ['order_id' => $order_id, 'manual' => $manual]);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -253,8 +253,8 @@ class util
     public static function push_query($order_id)
     {
         try {
-            queue\DispatcherClient::instance()->push('query', ['order_id' => $order_id]);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('query', ['order_id' => $order_id]);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -263,8 +263,8 @@ class util
     public static function manual_success($order_id)
     {
         try {
-            queue\DispatcherClient::instance()->push('manual_success', ['order_id' => $order_id]);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('manual_success', ['order_id' => $order_id]);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -273,8 +273,8 @@ class util
     public static function manual_cancel($order_id)
     {
         try {
-            queue\DispatcherClient::instance()->push('manual_cancel', ['order_id' => $order_id]);
-            return true;
+            $ret = queue\DispatcherClient::instance()->push('manual_cancel', ['order_id' => $order_id]);
+            return $ret !== false;
         } catch (Exception $ex) {
             return false;
         }
@@ -465,16 +465,16 @@ class util
     }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    public static function push_queue($mchid,$mch_order,$val)
+    public static function push_queue_order($mchid,$mch_order,$order_state)
     {
         $ins = Cache::getInstance('cacheredis');
 
         $name = 'merchant_order_query';
         $key = "{$mchid}-{$mch_order}";
-        $ins->hset($name, '', [$key => $val]);
+        $ins->hset($name, '', [$key => $order_state]);
     }
 
-    public static function pop_queue($mchid,$mch_order)
+    public static function pop_queue_order($mchid,$mch_order)
     {
         $ins = Cache::getInstance('cacheredis');
 
@@ -483,7 +483,7 @@ class util
         $ins->hdel($name, '', $key);
     }
 
-    public static function query_queue($mchid,$mch_order)
+    public static function query_queue_order($mchid,$mch_order)
     {
         $ins = Cache::getInstance('cacheredis');
 
@@ -495,7 +495,7 @@ class util
 
     public static function need_check($net_errno)
     {
-        static $errors = [56];
+        static $errors = [CURLE_GOT_NOTHING,CURLE_RECV_ERROR];
         return in_array($net_errno,$errors);
     }
 }

+ 3 - 3
helper/statistics/stat_refill.php

@@ -85,7 +85,7 @@ class stat_refill
     {
         $cond = [
             'refill_order.inner_status' => 0,
-            "refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]]
+            "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]]
         ];
 
         $items = Model('')->table('refill_order,vr_order')
@@ -154,7 +154,7 @@ class stat_refill
         $cond = [
             'refill_order.inner_status' => 0,
             'vr_order.order_state' => ORDER_STATE_SUCCESS,
-            "refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
+            "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
         ];
 
         $items = Model('')->table('refill_order,vr_order')
@@ -200,7 +200,7 @@ class stat_refill
         $cond = [
             'refill_order.inner_status' => 0,
             'vr_order.order_state' => ORDER_STATE_SUCCESS,
-            "refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
+            "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
         ];
 
         $items = Model('')->table('refill_order,vr_order')

+ 4 - 0
mobile/callback/refill_feinimoshu_hf.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('feinimoshu_hf',$_POST);
+echo ('success');

+ 4 - 0
mobile/callback/refill_yinteng.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('yinteng',$_POST);
+echo ('ok');

+ 39 - 21
mobile/control/refill.php

@@ -110,14 +110,13 @@ class refillControl extends merchantControl
 
         [$can_refill, $period] = refill\util::can_commit($card_no, $card_type);
         if ($can_refill === false) {
-            refill\util::push_queue($this->mchid(),$mch_order,time() + $period);
             $state = refill\util::async_add($params, $period);
         } else {
-            refill\util::push_queue($this->mchid(),$mch_order,time());
             $state = refill\util::push_add($params);
         }
 
         if ($state === true) {
+            refill\util::push_queue_order($this->mchid(),$mch_order,ORDER_STATE_QUEUE);
             return self::outsuccess(['state' => true]);
         } else {
             $code = $state;
@@ -289,36 +288,55 @@ class refillControl extends merchantControl
             return self::outerr(201,"客户订单号order_sn错误");
         }
 
-        $mod_refill = Model('refill_order');
-        $refill_info = $mod_refill->getOrderInfo(['mch_order' => $order_sn,'mchid' => $mchid,'inner_status' => 0]);
+        $order_state = refill\util::query_queue_order($mchid,$order_sn);
+        if ($order_state == ORDER_STATE_QUEUE || $order_state == ORDER_STATE_SEND) {
+            Log::record("query_state in queue mchid={$mchid} mch_order={$order_sn} order_state={$order_state}" ,Log::DEBUG);
+            $result['mchid'] = $mchid;
+            $result['order_sn'] = $order_sn;
+            $result['order_state'] = $order_state;
 
-        if(empty($refill_info))
+            $this->query_request($mchid,$order_sn);
+            return self::outsuccess($result);
+        }
+        else
         {
-            $ret = refill\util::query_queue($mchid,$order_sn);
-            if ($ret > 0) {
-                $result['mchid'] = $mchid;
-                $result['order_sn'] = $order_sn;
-                $result['order_state'] = ORDER_STATE_QUEUE;
-                return self::outsuccess($result);
-            } else {
+            $mod_refill = Model('refill_order');
+            $refill_info = $mod_refill->getOrderInfo(['mch_order' => $order_sn,'mchid' => $mchid,'inner_status' => 0]);
+
+            if(empty($refill_info))
+            {
+                Log::record("query_state in db no order mchid={$mchid} mch_order={$order_sn}" ,Log::DEBUG);
                 return self::outerr(202, "无此订单");
             }
+            else
+            {
+                $vr_order = Model('vr_order');
+                $order_info = $vr_order->getOrderInfo(['order_sn' => $refill_info['order_sn']]);
+                Log::record("query_state in db mchid={$mchid} mch_order={$order_sn} order_state={$order_info['order_state']}" ,Log::DEBUG);
+
+                if (empty($order_info)) {
+                    return self::outerr(203, "无此交易号");
+                } else {
+                    $result = $this->format($order_info, $refill_info);
+                    return self::outsuccess($result);
+                }
+            }
         }
-        else
+    }
+
+    private function query_request($mchid,$order_sn)
+    {
+        $mod_refill = Model('refill_order');
+        $refill_info = $mod_refill->getOrderInfo(['mch_order' => $order_sn,'mchid' => $mchid,'inner_status' => 0]);
+
+        if(!empty($refill_info))
         {
             $vr_order = Model('vr_order');
             $order_info = $vr_order->getOrderInfo(['order_sn' => $refill_info['order_sn']]);
 
-            if(empty($order_info)) {
-                return self::outerr(203,"无此交易号");
-            }
-
-            if($order_info['order_state'] == ORDER_STATE_SEND) {
+            if(!empty($order_info) && $order_info['order_state'] == ORDER_STATE_SEND) {
                 QueueClient::push("QueryRefillState",['order_id' => $refill_info['order_id']]);
             }
-
-            $result = $this->format($order_info,$refill_info);
-            return self::outsuccess($result);
         }
     }
 }

+ 4 - 4
mobile/refill_yunlingfs.php

@@ -1,4 +1,4 @@
-<?php
-
-refill\util::push_notify('yunlingfs',$_POST);
-echo ('SUCCESS');
+<?php
+
+refill\util::push_notify('yunlingfs',$_POST);
+echo ('OK');

+ 51 - 56
racc/control/lzrefill.php

@@ -98,13 +98,12 @@ class lzrefillControl extends lzbaseControl
             'org_quality' => $quality
         ];
 
-        refill\util::push_queue($this->mchid(),$mch_order,time());
         $ret = refill\util::push_add($params);
-        if($ret) {
+        if ($ret) {
+            refill\util::push_queue_order($this->mchid(), $mch_order, ORDER_STATE_QUEUE);
             return self::outsuccess($this->merchant_available);
-        }
-        else {
-            return self::outerr(-6,$this->merchant_available);
+        } else {
+            return self::outerr(-6, $this->merchant_available);
         }
     }
 
@@ -267,80 +266,76 @@ class lzrefillControl extends lzbaseControl
             return self::outerr(-9,$this->merchant_available);
         }
 
-        $mod_refill = Model('refill_order');
-        $refill_info = $mod_refill->getOrderInfo(['mch_order' => $order_sn,'mchid' => $mchid,'inner_status' => 0]);
-
-        if(empty($refill_info))
-        {
-            $state = 3;
-            $msg = "{$order_sn}-无此订单";
+        $order_state = refill\util::query_queue_order($mchid,$order_sn);
+        if ($order_state == ORDER_STATE_QUEUE || $order_state == ORDER_STATE_SEND) {
+            $state = 0;
+            $msg = "{$order_sn}-充值中";
             $remark = "";
             $content = "|{$state}|{$msg}|{$remark}";
             echo $content;
+            $this->query_request($mchid,$order_sn);
+
             return true;
         }
-
-        if(empty($refill_info))
+        else
         {
-            $ret = refill\util::query_queue($mchid,$order_sn);
-            if ($ret > 0) {
-                $state = 0;
-                $msg = "{$order_sn}-充值中";
+            $mod_refill = Model('refill_order');
+            $refill_info = $mod_refill->getOrderInfo(['mch_order' => $order_sn,'mchid' => $mchid,'inner_status' => 0]);
+
+            if(empty($refill_info))
+            {
+                $state = 3;
+                $msg = "{$order_sn}-无此订单";
                 $remark = "";
                 $content = "|{$state}|{$msg}|{$remark}";
                 echo $content;
                 return true;
-            } else {
-                $state = 3;
-                $msg = "{$order_sn}-无此订单";
-                $remark = "";
+            }
+            else
+            {
+                $vr_order = Model('vr_order');
+                $order_info = $vr_order->getOrderInfo(['order_sn' => $refill_info['order_sn']]);
+
+                $order_state = $order_info['order_state'];
+                if ($order_state == ORDER_STATE_CANCEL) {
+                    $state = 2;
+                    $msg = "{$order_sn}-充值失败";
+                    $remark = "";
+                } else {
+                    $state = 1;
+                    $msg = "{$order_sn}-充值成功";
+                    $remark = "{$refill_info['official_sn']}";
+                }
+
+                if($refill_info['card_type'] == mtopcard\ThirdRefillCard) {
+                    $remark = $this->third_remark($refill_info);
+                }
+
                 $content = "|{$state}|{$msg}|{$remark}";
                 echo $content;
+
                 return true;
             }
         }
+    }
 
-        $vr_order = Model('vr_order');
-        $order_info = $vr_order->getOrderInfo(['order_sn' => $refill_info['order_sn']]);
+    private function query_request($mchid,$order_sn)
+    {
+        $mod_refill = Model('refill_order');
+        $refill_info = $mod_refill->getOrderInfo(['mch_order' => $order_sn,'mchid' => $mchid,'inner_status' => 0]);
 
-        if($refill_info['is_retrying'])
-        {
-            QueueClient::push("QueryRefillState",['order_id' => $refill_info['order_id']]);
-            $state = 0;
-            $msg = "{$order_sn}-充值中";
-            $remark = "";
-        }
-        else
+        if(!empty($refill_info))
         {
-            $order_state = $order_info['order_state'];
-            if($order_state == ORDER_STATE_SEND || $order_state == ORDER_STATE_PAY || $order_state == ORDER_STATE_NEW) {
+            $vr_order = Model('vr_order');
+            $order_info = $vr_order->getOrderInfo(['order_sn' => $refill_info['order_sn']]);
+
+            if(!empty($order_info) && $order_info['order_state'] == ORDER_STATE_SEND) {
                 QueueClient::push("QueryRefillState",['order_id' => $refill_info['order_id']]);
-                $state = 0;
-                $msg = "{$order_sn}-充值中";
-                $remark = "";
-            }
-            elseif($order_state == ORDER_STATE_CANCEL) {
-                $state = 2;
-                $msg = "{$order_sn}-充值失败";
-                $remark = "";
             }
-            else {
-                $state = 1;
-                $msg = "{$order_sn}-充值成功";
-                $remark = "{$refill_info['official_sn']}";
-            }
-        }
-
-        if($refill_info['card_type'] == mtopcard\ThirdRefillCard) {
-            $remark = $this->third_remark($refill_info);
         }
-
-        $content = "|{$state}|{$msg}|{$remark}";
-        echo $content;
-
-        return true;
     }
 
+
     private function third_remark($refill_info)
     {
         $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $this->mchid()]);

+ 1 - 1
racc/control/refill.php

@@ -106,7 +106,7 @@ class refillControl extends merchantControl
             'org_quality' => $quality
         ];
 
-        refill\util::push_queue($this->mchid(),$mch_order,time());
+        refill\util::push_queue_order($this->mchid(),$mch_order,ORDER_STATE_QUEUE);
         refill\util::push_add($params);
         return self::outsuccess(['state' => true]);
     }

+ 1 - 1
rdispatcher/processor.php

@@ -37,7 +37,7 @@ class processor extends queue\ILooper
                     $input = $params['params'];
 
                     if (empty($channel) || empty($params))
-                        return;
+                        continue;
                     $this->mProxy->notify($channel, $input);
                 } elseif ($method == 'notify_mechant') {
                     $order_id = intval($params['order_id']);

+ 8 - 8
rdispatcher/proxy.php

@@ -35,8 +35,9 @@ class proxy
         $regin_no   = intval($params['regin_no']) ?? 0;
         $quantity = 1;
 
-        Log::record("proxy::add mch_order={$mch_order} card_no = {$card_no}",Log::DEBUG);
+        refill\util::push_queue_order($mchid,$mch_order,ORDER_STATE_SEND);
 
+        Log::record("proxy::add mch_order={$mch_order} card_no = {$card_no}",Log::DEBUG);
         $need_check = false;
         $first_comit = false;
         if($card_type == 0)
@@ -64,6 +65,8 @@ class proxy
                 $order_id = refill\RefillFactory::instance()->zero_order($mchid, $buyer_id, $amount, $card_no,
                     $mch_order, $idcard, $card_name, $notify_url, $quality, $org_quality, $order_time, $commit_times,
                     "无效的手机号");
+
+                refill\util::pop_queue_order($mchid,$mch_order);
                 QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => false]);
                 util::del_exclude_channel($mchid,$mch_order,$card_type);
                 return;
@@ -76,16 +79,12 @@ class proxy
         $params['commit_times'] += 1;
         $commit_times += 1;
 
-        if(!empty($mch_order) && $last_order_id == 0 && $order_id > 0) {
-            refill\util::pop_queue($mchid,$mch_order);
-        }
-
         if($errcode !== true)
         {
             $fNotify = true;
             if($errcode === refill\errcode::MERCHANT_REFILL_ERROR && $neterr && util::need_check($net_errno)) {
                 $fNotify = false;
-                //检查订单状态
+                //检查状态
             }
             elseif(($errcode === refill\errcode::MERCHANT_REFILL_ERROR && $neterr) || $errcode == refill\errcode::PROVIDER_OVERLOAD || $errcode == errcode::MERCHANT_PRICE_UNSETTING)
             {
@@ -111,7 +110,6 @@ class proxy
                     if (empty($order_info)) {
                         $order_id = refill\RefillFactory::instance()->zero_order($mchid, $buyer_id, $amount, $card_no,
                             $mch_order, $idcard, $card_name, $notify_url, $quality, $org_quality, $order_time, $commit_times, $errmsg);
-                        refill\util::pop_queue($mchid,$mch_order);
                     } else {
                         $order_id = $order_info['order_id'];
                     }
@@ -120,6 +118,7 @@ class proxy
                     $refill_order->edit($order_id, ['notify_time' => time(), 'notify_state' => 1,'is_retrying' => 0]);
                 }
 
+                refill\util::pop_queue_order($mchid,$mch_order);
                 QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
                 util::del_exclude_channel($mchid,$mch_order,$card_type);
             }
@@ -189,6 +188,7 @@ class proxy
             'quantity' => $quantity,
             'third_card_type' => $third_card_type];
 
+        refill\util::push_queue_order($mchid,$mch_order,ORDER_STATE_SEND);
         refill\util::incr_user_commit($mchid,$card_type,$amount,$org_quality);
 
         [$errcode, $errmsg, $order_id, $neterr] = refill\RefillFactory::instance()->add($mchid, $buyer_id, $amount, $card_no,
@@ -204,7 +204,6 @@ class proxy
                     $order_id = refill\RefillFactory::instance()->zero_order($mchid, $buyer_id, $amount, $card_no,
                         $mch_order, $idcard, $card_name, $notify_url, $org_quality, $org_quality,
                         $order_time, $commit_times, $errmsg,$quantity,$third_params);
-                    refill\util::pop_queue($mchid,$mch_order);
                 } else {
                     $order_id = $order_info['order_id'];
                 }
@@ -213,6 +212,7 @@ class proxy
                 $refill_order->edit($order_id, ['notify_time' => time(), 'notify_state' => 1,'is_retrying' => 0]);
             }
 
+            refill\util::pop_queue_order($mchid,$mch_order);
             QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
             util::del_exclude_channel($mchid,$mch_order,$card_type);
         }

+ 79 - 0
test/TestExportOrder.php

@@ -0,0 +1,79 @@
+<?php
+
+
+use PHPUnit\Framework\TestCase;
+use statistics\stat_refill;
+
+define('APP_ID', 'test');
+define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
+
+require_once(BASE_ROOT_PATH . '/global.php');
+require_once(BASE_CORE_PATH . '/lrlz.php');
+require_once(BASE_ROOT_PATH . '/fooder.php');
+
+
+class TestExportOrder extends TestCase
+{
+    public static function setUpBeforeClass() : void
+    {
+        Base::run_util();
+    }
+
+    public function testXingzhiyu()
+    {
+        $end_time = strtotime("2021-06-15");
+        $this->exoprt(10132,null,$end_time);
+    }
+
+    public function exoprt($mchid,$start_time = null,$end_time = null)
+    {
+        $cond['mchid'] = $mchid;
+        $cond['vr_order.order_state'] = 40;
+        if(!is_null($start_time) && !is_null($end_time)) {
+            $cond["refill_order.notify_time&refill_order.notify_time"] = ['_multi' => true, ['egt', $start_time], ['lt', $end_time]];
+        }
+        elseif(!is_null($start_time)) {
+            $cond["refill_order.notify_time"] = ['egt', $start_time];
+        }
+        elseif(!is_null($end_time)) {
+            $cond["refill_order.notify_time"] = ['lt', $end_time];
+        }
+
+        $path = BASE_DATA_PATH . "/log/{$mchid}.csv";
+        $fp = fopen($path, 'w');
+        fputcsv($fp,['序号','商户订单号','卡号','面额','流水号',"下单时间","回调时间"]);
+
+        $count = 1000;
+        $i = 0;
+
+        $index = 0;
+        while (true)
+        {
+            $start = $i * $count;
+            $items = Model('')->table('refill_order,vr_order')
+                ->field('mch_order,refill_order.card_no,refill_amount,mch_amount,official_sn,from_unixtime(order_time) as sorder_time,from_unixtime(notify_time) as snotify_time')
+                ->join('inner')
+                ->on('refill_order.order_id=vr_order.order_id')
+                ->where($cond)
+                ->limit("{$start},{$count}")
+                ->select();
+
+            if(empty($items)) {
+                break;
+            }
+            $i++;
+
+            foreach ($items as $item)
+            {
+                $index++;
+                $data = [$index,$item['mch_order'],$item['card_no'],$item['refill_amount'],$item['mch_amount'],$item['official_sn'],$item['sorder_time'],$item['snotify_time']];
+                fputcsv($fp,$data);
+            }
+        }
+
+        fclose($fp);
+    }
+}
+
+
+//docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestExportOrder::testXingzhiyu)( .*)?$/" --test-suffix TestExportOrder.php /var/www/html/test

+ 16 - 0
test/TestRedis.php

@@ -13,6 +13,8 @@ require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rlock.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rstorage.php');
 
+use refill;
+
 
 function sub_callback($redis, $chan, $msg)
 {
@@ -293,6 +295,20 @@ class TestRedis extends TestCase
 
     }
 
+    public function testPushQueue()
+    {
+        refill\util::push_queue_order(1,"xxxxx",ORDER_STATE_QUEUE);
+        $ret = refill\util::query_queue_order(1,"xxxxx");
+        $ret = refill\util::query_queue_order(1,"xxxxxx");
+        $x = 1;
+    }
+
+    public function testPushReturn()
+    {
+        $ret = refill\util::push_add(['xxxx']);
+        $ret = refill\util::push_notify('xxx',['xxxx']);
+    }
+
     ////docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRedis::testCancel)( .*)?$/" --test-suffix TestRedis.php /var/www/html/test
     ////docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRedis::testCancelPayed)( .*)?$/" --test-suffix TestRedis.php /var/www/html/test
     public static function tearDownAfterClass() : void

+ 13 - 3
test/TestRefill.php

@@ -337,6 +337,16 @@ class TestRefill extends TestCase
         refill\RefillFactory::instance()->notify('xiaochuang',$params);
     }
 
+    public function testYintengPhone()
+    {
+        $providers = new refill\yinteng\RefillPhone([]);
+//        $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '49631623737966351874']);
+        $data = '{"szOrderId":"49631623737966351874","fSalePrice":"47.35","szAgentId":"200009","nFlag":"2","szVerifyString":"01c5fafb1d67175f0533b69a762286e8","szPhoneNum":"18074608795","szRtnMsg":"1000000083421061514495400262","nDemo":"50"}';
+        $params = json_decode($data , true);
+        refill\RefillFactory::instance()->notify('yinteng',$params);
+    }
+
     public function testTongluPhone()
     {
         $providers = new refill\tonglu\RefillPhone([]);
@@ -741,9 +751,9 @@ class TestRefill extends TestCase
     public function testYunlingfsPhone()
     {
         $providers = new refill\yunlingfs\RefillPhone([]);
-//        $resp = $providers->add(18500608333, 4, 30, ['order_sn' => $this->make_sn()]);
-        $resp = $providers->query(['order_sn' => '72761619399048607916']);
-        $data = '{"userid":"10073527","sporderid":"89451618975609262234","orderid":"02D8A7D2ADD7F4DC73527","resultno":"1","merchantsubmittime":"20210421112737","ordermoney":"28.68","verifystring":"95e3fe834a25cc8c524e09480354d9ba","sign":"b4fb11138a9f883749be320772965add","supnumber":"20210421112716840298"}';
+//        $resp = $providers->add(15139608757, 4, 50, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->query(['order_sn' => '79251623739433607563']);
+        $data = '{"orderid":"BGC21061514434393910","sporderid":"79251623739433607563","userid":"10002543","merchantsubmittime":"20210615144434","resultno":"1","parvalue":"50","remark1":"20210615144420321813","payno":"20210615144420321813","fundbalance":"-47.65","sign":"6B9B7C15A3F9CBC773562327B6744B1E"}';
         $input = json_decode($data, true);
 //        refill\RefillFactory::instance()->notify('yunlingfs',$input);
     }

+ 12 - 10
test/TestRefillThird.php

@@ -170,22 +170,24 @@ class TestRefillThird extends TestCase
 
     public function testFNMS()
     {
-        $providers = $this->getProvider('feinimoshu','RefillOil');
+        $providers = $this->getProvider('feinimoshu_hf','RefillPhone');
         $order_sn = $this->make_sn();
-        [$state, $ch_order, $neterr] = $providers->add(1000111100021211884, 2, 50, ['order_sn' => $order_sn]);
-        $providers->query(['ch_trade_no' => $ch_order,'order_sn' => $order_sn]);
+//        [$state, $ch_order, $neterr] = $providers->add(18500608333, 5, 30, ['order_sn' => $order_sn]);
+        $providers->query(['order_sn' => '60711623734193929309']);
     }
 
     public function testFNMSCB()
     {
         $params = ['appid' => 'CZ30533982',
-            'order' => 'D20210524392940805012773',
-            'morder' => '82001621839274971137',
-            'status' => '3',
-            'cash' => '50',
-            'signature' => '8e6bed66f0a3f28e3e952b60b98973b8'];
-
-        $provider = $this->getProvider('feinimoshu','RefillCallBack');
+            'order' => 'D20210616111088971260328',
+            'morder' => '1879340677155108772500',
+            'status' => '2',
+            'cash' => '30',
+            'vnum' => '110103308152106161039260597703',
+            'actual_cash' => '28.86',
+            'signature' => 'c3077297f26f6231eeaa31ccb8c16148'];
+
+        $provider = $this->getProvider('feinimoshu_hf','RefillCallBack');
         $ret = $provider->verify($params);
         $this->assertTrue($ret,'Verify is OK');
         $provider->notify($params);

+ 5 - 0
test/TestTime.php

@@ -173,4 +173,9 @@ class TestTime extends TestCase
         $y = md5($x);
     }
 
+    public function testSuning()
+    {
+        $x = date("YmdHis",time());
+    }
+
 }