stanley-king 4 år sedan
förälder
incheckning
a3e1416a2d
31 ändrade filer med 1525 tillägg och 575 borttagningar
  1. 312 213
      admin/control/merchant.php
  2. 9 1
      admin/templates/default/merchant.index.php
  3. 32 3
      admin/templates/default/merchant.order.stats.php
  4. 120 0
      admin/templates/default/merchant.provider.evidence_list.php
  5. 10 2
      admin/templates/default/merchant.refill.evidence_list.php
  6. 90 0
      admin/templates/default/order.stats.check.php
  7. 3 3
      admin/templates/default/provider.amount.control.php
  8. 160 0
      admin/templates/default/provider.evidence.add.php
  9. 9 1
      admin/templates/default/provider.index.php
  10. 32 3
      admin/templates/default/provider.order.stats.php
  11. 9 1
      admin/templates/default/refill.order.index.php
  12. 9 1
      admin/templates/default/refill.order.send.index.php
  13. 11 1
      admin/templates/default/system.order.stats.php
  14. 30 0
      data/config/lingzh/refill.ini.php
  15. 235 323
      data/config/win/refill.ini.php
  16. 24 0
      data/model/provider_evidence.model.php
  17. 10 5
      data/model/refill_provider.model.php
  18. 14 0
      data/model/refill_stats.model.php
  19. 1 1
      helper/fcgisrv/LZRAccServer.php
  20. 41 0
      helper/refill/api/lingzh/fensheng/RefillCallBack.php
  21. 101 0
      helper/refill/api/lingzh/fensheng/RefillPhone.php
  22. 29 0
      helper/refill/api/lingzh/fensheng/config.php
  23. 3 0
      helper/refill/api/lingzh/fensheng/琳珠网络科技话费接口充值协议 (1).doc
  24. BIN
      helper/refill/api/lingzh/fensheng/琳珠网络科技话费接口状态码详解 (2).docx
  25. 54 0
      helper/refill/api/xyz/wantong/RefillCallBack.php
  26. 112 0
      helper/refill/api/xyz/wantong/RefillPhone.php
  27. 6 0
      helper/refill/api/xyz/wantong/api.txt
  28. 16 0
      helper/refill/api/xyz/wantong/config.php
  29. 5 5
      helper/refill/api/xyz/xunyin/RefillPhone.php
  30. 8 0
      racc/callback/lingzh/fensheng.php
  31. 30 12
      test/TestRefill.php

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 312 - 213
admin/control/merchant.php


+ 9 - 1
admin/templates/default/merchant.index.php

@@ -70,7 +70,7 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
             <tbody>
             <?php if (!empty($output['merchant_list']) && is_array($output['merchant_list'])) { ?>
                 <?php foreach ($output['merchant_list'] as $k => $v) { ?>
-                    <tr>
+                    <tr class="trFlex">
                         <td><?php echo $v['mchid']; ?></td>
                         <td><?php echo $v['name']; ?></td>
                         <td><?php echo $v['company_name']; ?></td>
@@ -143,5 +143,13 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
             $('input[name="op"]').val('merchant');
             $('#formSearch').submit();
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
 </script>

+ 32 - 3
admin/templates/default/merchant.order.stats.php

@@ -5,6 +5,8 @@
         <div class="item-title">
             <h3>对账管理</h3>
             <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=provider_evidence"><span>上游充值申请记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
                 <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>商户对账记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><span>通道对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>商户对账记录</span></a></li>
@@ -75,17 +77,22 @@
                 <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>
                 <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>
+                <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>
             <tbody>
             <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
                 <?php foreach ($output['stats_list'] as $k => $v) { ?>
-                    <tr>
+                    <tr class="trFlex">
                         <td><?php echo $v['time_text']; ?></td>
                         <td><?php echo $v['cname']; ?></td>
                         <td><?php echo $v['cid']; ?></td>
@@ -94,11 +101,25 @@
                         <td class="align-center"><?php echo $v['success_channel_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['success_mch_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['profit_amounts']; ?></td>
-                        <td class="align-center"><?php echo $v['service_amounts']; ?></td>
                         <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 $v['corder_success_count']; ?></td>
+                        <td class="align-center"><?php echo $v['corder_success_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['gap_order_count']; ?></td>
+                        <td class="align-center"><?php echo $v['gap_success_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['remark']; ?></td>
+                        <td class="align-center">
+                            <?php if($v['check_status'] == 1){?>
+                                <span style="color: #0bb20c">匹配</span>
+                            <?php }elseif ($v['check_status'] == 2) {?>
+                                <span style="color: #f30707">不匹配</span>
+                            <?php }else{?>
+                                <span style="color: #fd9d0e">未编辑</span>
+                            <?php }?>
+                        </td>
                         <td class="align-center w200">
+                                <a href="index.php?act=merchant&op=OrderStatsCheck&stat_id=<?php echo $v['stat_id'] ?>">编辑</a>
                         </td>
                     </tr>
                 <?php } ?>
@@ -136,5 +157,13 @@
             elem: '#endTime',
             type: 'datetime'
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
 </script>

+ 120 - 0
admin/templates/default/merchant.provider.evidence_list.php

@@ -0,0 +1,120 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span>上游充值申请记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><span>通道对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch">
+        <input type="hidden" value="merchant" name="act">
+        <input type="hidden" value="provider_evidence" name="op">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="store_name">通道店铺名称</label></th>
+                <td><input type="text" value="<?php echo $_GET['store_name']; ?>" name="store_name"
+                           id="store_name" class="txt"></td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=merchant&op=refill_evidence" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <!--   <table class="table tb-type2" id="prompt">-->
+    <!--    <tbody>-->
+    <!--      <tr class="space odd">-->
+    <!--        <th colspan="12"><div class="title">-->
+    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
+    <!--            <span class="arrow"></span></div></th>-->
+    <!--      </tr>-->
+    <!--      <tr>-->
+    <!--        <td><ul>-->
+    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
+    <!--          </ul></td>-->
+    <!--      </tr>-->
+    <!--    </tbody>-->
+    <!--  </table>-->
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>申请编号</th>
+                <th>通道店铺名称</th>
+                <th>申请金额</th>
+                <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>
+                <th class="align-center"><?php echo $lang['operation']; ?></th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['evidence_list']) && is_array($output['evidence_list'])) { ?>
+                <?php foreach ($output['evidence_list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $v['apply_id']; ?></td>
+                        <td><?php echo $v['store_name']; ?></td>
+                        <td><?php echo $v['amount']*100%100==0 ? intval($v['amount']) : $v['amount']; ?> (<?php echo $v['amount']>=10000 ? $v['amount']/10000 .'万' : $v['amount'] . '元';?>)</td>
+                        <td class="align-center"><?php echo $v['bank_username']; ?></td>
+                        <td class="align-center"><?php echo $v['bank_name']; ?></td>
+                        <td class="align-center"><?php echo $v['to_bank_username']; ?></td>
+                        <td class="align-center"><?php echo $v['to_bank_name']; ?></td>
+                        <td class="nowarp align-center"><?php echo $v['add_time'] ? date('Y-m-d H:i', $v['add_time']) : $lang['no_limit']; ?></td>
+                        <td class="align-center w200">
+                            <?php if($v['voucher_name'] != '/') {?>
+                            <a target="_blank"
+                               href="<?php echo UPLOAD_SITE_URL . '/' . ATTACH_UPFILE . DS . 'provider/' .$v['voucher_name']; ?>">预览</a>
+                            <?php }?>
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="16">
+                    <div class="pagination"><?php echo $output['page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('input[name="op"]').val('provider_evidence');
+            $('#formSearch').submit();
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+    });
+    
+</script>

+ 10 - 2
admin/templates/default/merchant.refill.evidence_list.php

@@ -5,7 +5,7 @@
         <div class="item-title">
             <h3>充值申请</h3>
             <ul class="tab-base">
-                <li><a href="JavaScript:void(0);" class="current" class="current"><span>充值申请</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>充值申请</span></a></li>
             </ul>
         </div>
     </div>
@@ -74,7 +74,7 @@
             <tbody>
             <?php if (!empty($output['evidence_list']) && is_array($output['evidence_list'])) { ?>
                 <?php foreach ($output['evidence_list'] as $k => $v) { ?>
-                    <tr>
+                    <tr class="trFlex">
                         <td><?php echo $v['apply_id']; ?></td>
                         <td><?php echo $v['mch_name']; ?></td>
                         <td><?php echo $v['amount']*100%100==0 ? intval($v['amount']) : $v['amount']; ?> (<?php echo $v['amount']>=10000 ? $v['amount']/10000 .'万' : $v['amount'] . '元';?>)</td>
@@ -164,5 +164,13 @@
             $('input[name="op"]').val('refill_evidence');
             $('#formSearch').submit();
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
 </script>

+ 90 - 0
admin/templates/default/order.stats.check.php

@@ -0,0 +1,90 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+
+<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=provider_evidence"><span>上游充值申请记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><span>通道对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>对账</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form id="user_form" enctype="multipart/form-data" method="post">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <input type="hidden" name="stat_id" value="<?php echo $_GET['stat_id'];?>"/>
+        <table class="table tb-type2">
+            <tbody>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation" for="corder_success_count"><?php echo $output['stats_type'];?>成功订单数量:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><input type="text" value="" name="corder_success_count" id="corder_success_count" class="txt"></td>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation" for="name"><?php echo $output['stats_type'];?>成功订单金额:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform"><input type="text" value="" name="corder_success_amounts" id="corder_success_amounts" 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="remark" rows="6" class="tarea"></textarea></td>
+                <td class="vatop tips"></td>
+            </tr>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
+        charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
+      id="cssfile2"/>
+<script type="text/javascript">
+    $(function () {
+        //按钮先执行验证再提交表单
+        $("#submitBtn").click(function () {
+            if ($("#user_form").valid()) {
+                $("#user_form").submit();
+            }
+        });
+        $('#user_form').validate({
+            errorPlacement: function (error, element) {
+                error.appendTo(element.parent().parent().prev().find('td:first'));
+            },
+            rules: {
+                corder_success_count: {
+                    required: true,
+                },
+                corder_success_amounts: {
+                    required: true,
+                },
+            },
+            messages: {
+                corder_success_count: {
+                    required: '不能为空',
+                },
+                corder_success_amounts: {
+                    required: '不能为空',
+                }
+            }
+        });
+    });
+</script>

+ 3 - 3
admin/templates/default/provider.amount.control.php

@@ -196,7 +196,7 @@
 
                             <td style="text-align: center;width: 150px;min-width:150px;padding-right: 10px;" class="batch-td">
                                 <div style="width: 46px;display:inline-block">
-                                    <input type="text" class="input-one styleOne" name="speed[]"
+                                    <input type="text" class="input-one styleOne" name="speed[]" autocomplete="off"
                                            value="<?php echo $output['datas'][$provider['provider_id']][$key]['speed']?>"
                                            <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
                                                readOnly
@@ -210,7 +210,7 @@
                                     </div>
                                 </div>
                                 <div style="width: 40px;display:inline-block;">
-                                    <input type="text" class="input-tow styleTow" name="sort[]"
+                                    <input type="text" class="input-tow styleTow" name="sort[]" autocomplete="off"
                                            value="<?php echo $output['datas'][$provider['provider_id']][$key]['sort']?>"
                                            <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
                                                readOnly
@@ -224,7 +224,7 @@
                                     </div>
                                 </div>
                                 <div style="width: 40px;display:inline-block">
-                                    <input type="text" class="input-three styleTow" name="opened[]"
+                                    <input type="text" class="input-three styleTow" name="opened[]" autocomplete="off"
                                            value="<?php echo $output['datas'][$provider['provider_id']][$key]['opened']?>"
                                             <?php if($output['datas'][$provider['provider_id']][$key]['has'] == 0){?>
                                                 readOnly

+ 160 - 0
admin/templates/default/provider.evidence.add.php

@@ -0,0 +1,160 @@
+<?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=provider_evidence"><span>上游充值申请记录</span></a></li>
+          <li><a href="JavaScript:void(0);" class="current"><span>新增上游充值申请</span></a></li>
+          <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>平台对账记录</span></a></li>
+          <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><span>通道对账记录</span></a></li>
+          <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
+      </ul>
+    </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" />
+   
+    <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">
+              <select name="provider_id" class="querySelect">
+                  <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                  <?php foreach($output['provider_list'] as $provider){?>
+                      <option value="<?php echo $provider['provider_id']?>"><?php echo $provider['store_name']?>
+                      </option>
+                  <?php }?>
+              </select>
+          <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="amount" name="amount" class="txt" ></td>
+          <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="to_bank_username" id="to_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="to_bank_name" id="to_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">
+                <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 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><a href="JavaScript:void(0);" class="btn" id="submitBtn"><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());
+    });
+    $("#submitBtn").click(function () {
+        if ($("#points_form").valid()) {
+            $("#points_form").submit();
+        }
+    });
+    $('#points_form').validate({
+        errorPlacement: function (error, element) {
+            error.appendTo(element.parent().parent().prev().find('td:first'));
+        },
+        rules : {
+            provider_id: {
+				required : true
+			},
+            bank_username   : {
+                required : true,
+            },
+            bank_name: {
+                required : true
+            },
+            amount   : {
+                required : true,
+            },
+            to_bank_username: {
+                required : true
+            },
+            to_bank_name   : {
+                required : true,
+            }
+        },
+        messages : {
+            provider_id: {
+                required : '需选择上游店铺'
+            },
+            bank_username   : {
+                required : '不能为空',
+            },
+            bank_name: {
+                required : '不能为空'
+            },
+            amount   : {
+                required : '不能为空',
+            },
+            to_bank_username: {
+                required : '不能为空'
+            },
+            to_bank_name   : {
+                required : '不能为空',
+            }
+        }
+    });
+});
+</script>

+ 9 - 1
admin/templates/default/provider.index.php

@@ -80,7 +80,7 @@
             <tbody>
             <?php if (!empty($output['provider_list']) && is_array($output['provider_list'])) { ?>
                 <?php foreach ($output['provider_list'] as $k => $v) { ?>
-                    <tr>
+                    <tr class="trFlex">
                         <td><?php echo $v['provider_id']; ?></td>
                         <td><?php echo $v['name']; ?></td>
                         <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
@@ -136,5 +136,13 @@
             $('input[name="op"]').val('provider');
             $('#formSearch').submit();
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
 </script>

+ 32 - 3
admin/templates/default/provider.order.stats.php

@@ -5,6 +5,8 @@
         <div class="item-title">
             <h3>对账管理</h3>
             <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=provider_evidence"><span>上游充值申请记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
                 <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>通道对账记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
@@ -75,17 +77,22 @@
                 <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>
                 <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>
+                <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>
             <tbody>
             <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
                 <?php foreach ($output['stats_list'] as $k => $v) { ?>
-                    <tr>
+                    <tr class="trFlex">
                         <td><?php echo $v['time_text']; ?></td>
                         <td><?php echo $v['cname']; ?></td>
                         <td><?php echo $v['cid']; ?></td>
@@ -94,11 +101,25 @@
                         <td class="align-center"><?php echo $v['success_channel_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['success_mch_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['profit_amounts']; ?></td>
-                        <td class="align-center"><?php echo $v['service_amounts']; ?></td>
                         <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 $v['corder_success_count']; ?></td>
+                        <td class="align-center"><?php echo $v['corder_success_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['gap_order_count']; ?></td>
+                        <td class="align-center"><?php echo $v['gap_success_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['remark']; ?></td>
+                        <td class="align-center">
+                            <?php if($v['check_status'] == 1){?>
+                                <span style="color: #0bb20c">匹配</span>
+                            <?php }elseif ($v['check_status'] == 2) {?>
+                                <span style="color: #f30707">不匹配</span>
+                            <?php }else{?>
+                                <span style="color: #fd9d0e">未编辑</span>
+                            <?php }?>
+                        </td>
                         <td class="align-center w200">
+                                <a href="index.php?act=merchant&op=OrderStatsCheck&stat_id=<?php echo $v['stat_id'] ?>">编辑</a>
                         </td>
                     </tr>
                 <?php } ?>
@@ -136,5 +157,13 @@
             elem: '#endTime',
             type: 'datetime'
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
 </script>

+ 9 - 1
admin/templates/default/refill.order.index.php

@@ -237,7 +237,7 @@
         <?php if (count($output['order_list']) > 0) { ?>
             <?php
             foreach ($output['order_list'] as $key => $order) { ?>
-                <tr class="hover">
+                <tr class="hover trFlex">
                     <td class="align-center"><?php echo $key+1;?></td>
                     <td class="align-left"><?php echo $order['order_sn']; ?></td>
                     <td class="align-center"><?php echo $order['mchid']; ?></td>
@@ -321,6 +321,14 @@
             elem: '#endTime',
             type: 'datetime'
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
     function hCopyChannel(e) {
         let str = ''

+ 9 - 1
admin/templates/default/refill.order.send.index.php

@@ -69,7 +69,7 @@
         <?php if (count($output['order_list']) > 0) { ?>
             <?php
             foreach ($output['order_list'] as $key => $order) { ?>
-                <tr class="hover">
+                <tr class="hover trFlex">
                     <td class="align-center"><?php echo $key+1;?></td>
                     <td class="align-left"><?php echo $order['order_sn']; ?></td>
                     <td class="align-center"><?php echo $order['mchid']; ?></td>
@@ -167,6 +167,14 @@
                 window.location.reload();
             }, 60000);
         }
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
     function hCopyChannel(e) {
         let str = ''

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

@@ -5,6 +5,8 @@
         <div class="item-title">
             <h3>对账管理</h3>
             <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=provider_evidence"><span>上游充值申请记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><span>通道对账记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
@@ -72,7 +74,7 @@
             <tbody>
             <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
                 <?php foreach ($output['stats_list'] as $k => $v) { ?>
-                    <tr>
+                    <tr class="trFlex">
                         <td><?php echo $v['time_text']; ?></td>
                         <td><?php echo $v['cname']; ?></td>
                         <td><?php echo $v['cid']; ?></td>
@@ -123,5 +125,13 @@
             elem: '#endTime',
             type: 'datetime'
         });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
     });
 </script>

+ 30 - 0
data/config/lingzh/refill.ini.php

@@ -282,6 +282,35 @@ $feiniao_phone = ['name' => 'feiniao', 'store_id' => 44,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$fensheng_phone = ['name' => 'fensheng', 'store_id' => 45,'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 73, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 73, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 74, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 74, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 75, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 75, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 76, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 76, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 77, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 77, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 78, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 78, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
     ['name' => 'baizeyd', 'cfg' => $baizeyd, 'opened' => true, 'sort' => 1],
     ['name' => 'aming', 'cfg' => $aming_phone, 'opened' => true, 'sort' => 1],
@@ -294,5 +323,6 @@ $phone_providers = [
     ['name' => 'amingjd', 'cfg' => $amingjd_phone],
     ['name' => 'legou', 'cfg' => $legou_phone],
     ['name' => 'feiniao', 'cfg' => $feiniao_phone],
+    ['name' => 'fensheng', 'cfg' => $fensheng_phone],
     ];
 $config['phone_providers'] = $phone_providers;

+ 235 - 323
data/config/win/refill.ini.php

@@ -2,415 +2,327 @@
 
 global $config;
 
-$config['refill_oil_specs'] = [100, 200, 500, 1000, 2000];
-$config['refill_phone_specs'] = [10, 20, 30, 50, 100, 200, 300, 500];
-
+$config['refill_oil_specs'] = [100 , 200 , 500 , 1000 , 2000];
+$config['refill_phone_specs'] = [10 , 20 , 30 , 50 , 100 , 200 , 300 , 500];
 //充值额度基本表
 $config['refill_specs'] = [
-    'petrochina'  => $config['refill_oil_specs'],
-    'sinopec'     => $config['refill_oil_specs'],
-    'chinamobile' => $config['refill_phone_specs'],
-    'chinaunicom' => $config['refill_phone_specs'],
-    'chinatelecom' => $config['refill_phone_specs']
+    'petrochina'    => $config['refill_oil_specs'],
+    'sinopec'       => $config['refill_oil_specs'],
+    'chinamobile'   => $config['refill_phone_specs'],
+    'chinaunicom'   => $config['refill_phone_specs'],
+    'chinatelecom'  => $config['refill_phone_specs']
 ];
 
-//充值渠道配置表
-//速汇充京东加油通道
-$tianjt_oil = ['name' => 'tianjt', 'store_id' => 7,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6290, 'price' => 97.0, 'quality' => 1, 'card_type' => 'sinopec']],
-        200 => [['goods_id' => 6291, 'price' => 194, 'quality' => 1, 'card_type' => 'sinopec']],
-        500 => [['goods_id' => 6292, 'price' => 485, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6293, 'price' => 970, 'quality' => 1, 'card_type' => 'sinopec']]
-    ],
-    'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
-
-//速汇充天猫加油通道
-$suhctm_oil = ['name' => 'suhctm', 'store_id' => 7,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6290, 'price' => 96.8, 'quality' => 1, 'card_type' => 'sinopec']],
-        200 => [['goods_id' => 6291, 'price' => 193.6, 'quality' => 1, 'card_type' => 'sinopec']],
-        500 => [['goods_id' => 6292, 'price' => 484, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6293, 'price' => 968, 'quality' => 1, 'card_type' => 'sinopec']]
-    ],
-    'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
-
-$suhcpdd_oil = ['name' => 'suhcpdd', 'store_id' => 7,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6290, 'price' => 96.8, 'quality' => 1, 'card_type' => 'sinopec']],
-        200 => [['goods_id' => 6291, 'price' => 193.6, 'quality' => 1, 'card_type' => 'sinopec']],
-        500 => [['goods_id' => 6292, 'price' => 484, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6293, 'price' => 968, 'quality' => 1, 'card_type' => 'sinopec']]
-    ],
-    'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
-
-//赵梓暄提供的加油通道
-$zzx_oil = ['name' => 'zzx', 'store_id' => 13,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6307, 'price' => 97.8, 'quality' => 1, 'card_type' => 'petrochina,sinopec']],
-        200 => [['goods_id' => 6308, 'price' => 195.6, 'quality' => 1, 'card_type' => 'petrochina,sinopec']],
-        500 => [['goods_id' => 6309, 'price' => 489, 'quality' => 1, 'card_type' => 'petrochina,sinopec']],
-        1000 => [['goods_id' => 6310, 'price' => 978, 'quality' => 1, 'card_type' => 'petrochina,sinopec']]
-    ],
-    'refill_type' => 'api'];
-
-//赵梓暄提供的加油通道
-$lx_oil = ['name' => 'lx', 'store_id' => 14,'qualitys' => '1',
-    'amount' => [
-        500 => [['goods_id' => 6322, 'price' => 479, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6311, 'price' => 958, 'quality' => 1, 'card_type' => 'sinopec']] //,
-//        2000 => ['goods_id' => 6322, 'price' => 1916]
-    ],
-    'period' => ['start' => '14:00', 'end' => '19:00'], 'official_sn' => true, 'refill_type' => 'inner_store'];
-
-//赛虎
-$saihu_oil = ['name' => 'saihu', 'store_id' => 15,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6313, 'price' => 97, 'quality' => 1, 'card_type' => 'sinopec']],
-        200 => [['goods_id' => 6314, 'price' => 194, 'quality' => 1, 'card_type' => 'sinopec']],
-        500 => [['goods_id' => 6315, 'price' => 485, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6316, 'price' => 970, 'quality' => 1, 'card_type' => 'sinopec']],
-        2000 => [['goods_id' => 6317, 'price' => 1940, 'quality' => 1, 'card_type' => 'sinopec']]
-    ],
-    'refill_type' => 'api'];
-
-#官方中石油通道
-$gftd_oil = ['name' => 'gftd', 'store_id' => 19,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6339, 'price' => 95, 'quality' => 1, 'card_type' => 'petrochina']],
-        200 => [['goods_id' => 6340, 'price' => 190, 'quality' => 1, 'card_type' => 'petrochina']],
-        500 => [['goods_id' => 6341, 'price' => 475, 'quality' => 1, 'card_type' => 'petrochina']],
-        1000 => [['goods_id' => 6342, 'price' => 950, 'quality' => 1, 'card_type' => 'petrochina']]
-    ],
-    'period' => [], 'refill_type' => 'api'];
-
-#官方中石化通道
-$gftdsinop_oil = ['name' => 'gftdsinop', 'store_id' => 20,'qualitys' => '1',
-    'amount' => [
-        100 => [['goods_id' => 6343, 'price' => 95, 'quality' => 1, 'card_type' => 'sinopec']],
-        200 => [['goods_id' => 6344, 'price' => 190, 'quality' => 1, 'card_type' => 'sinopec']],
-        500 => [['goods_id' => 6345, 'price' => 475, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6346, 'price' => 950, 'quality' => 1, 'card_type' => 'sinopec']]
-    ],
-    'period' => [], 'refill_type' => 'api'];
 
-$oil_providers = [
-    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
-    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
-    ['name' => 'suhcpdd', 'cfg' => $suhcpdd_oil],
-    ['name' => 'zzx', 'cfg' => $zzx_oil],
-    ['name' => 'lx', 'cfg' => $lx_oil],
-    ['name' => 'saihu', 'cfg' => $saihu_oil],
-    ['name' => 'gftd', 'cfg' => $gftd_oil],
-    ['name' => 'gftdsinop', 'cfg' => $gftdsinop_oil]
-];
+//充值渠道配置表
+$oil_providers = [];
 $config['oil_providers'] = $oil_providers;
 
-$beixt_phone = ['name' => 'beixt', 'store_id' => 8,'qualitys' => '1',
-    'amount' => [
-        50 => [['goods_id' => 6295, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6296, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6297, 'price' => 195,  'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
-    ],
-    'refill_type' => 'api'];
 
-$bxtwt_phone = ['name' => 'bxtwt', 'store_id' => 10,'qualitys' => '1',
+$baizeyd = ['name' => 'baizeyd', 'store_id' => 32,'qualitys' => '1',
     'amount' => [
-        50 => [['goods_id' => 6298, 'price' => 48,   'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6299, 'price' => 96,  'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6300, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
-    ],
-    'refill_type' => 'api'];
-
-$bjb_phone = ['name' => 'bjb', 'store_id' => 12,'qualitys' => '1',
-    'amount' => [
-        10 => [['goods_id' => 6305, 'price' => 9.51,  'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6306, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6301, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6302, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6303, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6304, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6327, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6328, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
+        10 => [
+            ['goods_id' => 1, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        30 => [
+            ['goods_id' => 3, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        50 => [
+            ['goods_id' => 4, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        100 => [
+            ['goods_id' => 5, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        200 => [
+            ['goods_id' => 6, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,5',
+
+$aming_phone = ['name' => 'aming', 'store_id' => 34,'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 9.20, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id'  => 9, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 18.40, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 10, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6391, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6391, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 27.60, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 11, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6392, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6392, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 46.00, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 12, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6393, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6393, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 92.0, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 13, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6394, 'price' => 190.60, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6394, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 184.00, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 14, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 276.00, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 15, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 460.00, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
-        ]
-    ],
-    'official_sn' => true, 'refill_type' => 'api'];
-
-//$lingzhdl_phone = ['name' => 'lingzhdl', 'store_id' => 29, 'qualitys' => '1',
-//    'amount' => [
-//        10 => [['goods_id' => 6397, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//        20 => [['goods_id' => 6398, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//        30 => [['goods_id' => 6399, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//        50 => [['goods_id' => 6400, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//
-//        100 => [['goods_id' => 6401, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//        200 => [['goods_id' => 6402, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//        300 => [['goods_id' => 6403, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 6404, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
-//    ],
-//    'official_sn' => true, 'refill_type' => 'api'];
-
-$bjbyd_phone = ['name' => 'bjbyd', 'store_id' => 24,'qualitys' => '1',
-    'amount' => [
-        30 => [['goods_id' => 6367, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 6368, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 6369, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 6370, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinamobile']]
+            ['goods_id' => 16, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$afandnew_phone = ['name' => 'afandnew', 'store_id' => 25,'qualitys' => '1',
-    'amount' => [
-        50 => [['goods_id' => 6371, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6372, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6373, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
-    ],
-    'refill_type' => 'api'];
-
-$tianx_phone = ['name' => 'tianx', 'store_id' => 25,'qualitys' => '1',
-    'amount' => [
-        50 => [['goods_id' => 6371, 'price' => 46.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6372, 'price' => 93,  'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6373, 'price' => 186, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
-    ],
-    'refill_type' => 'api'];
-
-$yifa_phone = ['name' => 'yifa', 'store_id' => 16,'qualitys' => '1',
-    'amount' => [
-        30 => [['goods_id' => 6318, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 6319, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 6320, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 6321, 'price' => 191,  'quality' => 1, 'card_type' => 'chinamobile']]
-    ],
-    'refill_type' => 'api'];
-
-$jiec_phone = ['name' => 'jiec', 'store_id' => 17,'qualitys' => '1',
+$binghc_phone = ['name' => 'binghc', 'store_id' => 35,'qualitys' => '1',
     'amount' => [
-        30 => [['goods_id' => 6323, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6324, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6325, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6326, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6329, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6330, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [
+            ['goods_id' => 17, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 18, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 19, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 20, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 21, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 22, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 23, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 24, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$weit_phone = ['name' => 'weit', 'store_id' => 18,'qualitys' => '1',
+$ruishun_phone = ['name' => 'ruishun', 'store_id' => 36,'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6337, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6338, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6331, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6332, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6333, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6334, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6335, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6336, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
+        10 => [
+            ['goods_id' => 25, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 26, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 27, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 28, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 29, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 30, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 31, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 32, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$afand_phone = ['name' => 'afand', 'store_id' => 26,'qualitys' => '1',
+$wuchen_phone = ['name' => 'wuchen', 'store_id' => 37,'qualitys' => '1',
     'amount' => [
-        30 => [['goods_id' => 6374, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6375, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6376, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6377, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6378, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6379, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
+        10 => [
+            ['goods_id' => 33, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 34, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 35, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 36, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 37, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 38, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 39, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 40, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$afandeng_phone = ['name' => 'afandeng', 'store_id' => 27,'qualitys' => '1',
+$yibao_phone = ['name' => 'yibao', 'store_id' => 38,'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6406, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6407, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6380, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6381, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6382, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6383, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6384, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6385, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        30 => [
+            ['goods_id' => 41, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 42, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 43, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 44, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$tongy_phone = ['name' => 'tongy', 'store_id' => 31,'qualitys' => '2',
+$amingyd_phone = ['name' => 'amingyd', 'store_id' => 39,'qualitys' => '1',
     'amount' => [
-        30 => [['goods_id' => 6408, 'price' => 29.76, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6408, 'price' => 29.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6408, 'price' => 29.64, 'quality' => 2, 'card_type' => 'chinatelecom']],
-
-        50 => [['goods_id' => 6409, 'price' => 49.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6409, 'price' => 48.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6409, 'price' => 49.4, 'quality' => 2, 'card_type' => 'chinatelecom']],
-
-        100 => [['goods_id' => 6410, 'price' => 99.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6410, 'price' => 97.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6410, 'price' => 98.8, 'quality' => 2, 'card_type' => 'chinatelecom']],
-
-        200 => [['goods_id' => 6411, 'price' => 198.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6411, 'price' => 194.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6411, 'price' => 197.6, 'quality' => 2, 'card_type' => 'chinatelecom']],
-
-        300 => [['goods_id' => 6412, 'price' => 297.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6412, 'price' => 291.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6412, 'price' => 296.4, 'quality' => 2, 'card_type' => 'chinatelecom']],
-
-        500 => [['goods_id' => 6413, 'price' => 496, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6413, 'price' => 486.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6413, 'price' => 494, 'quality' => 2, 'card_type' => 'chinatelecom']]
+        30 => [
+            ['goods_id' => 45, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        50 => [
+            ['goods_id' => 46, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        100 => [
+            ['goods_id' => 47, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        200 => [
+            ['goods_id' => 48, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$weiyi_phone = ['name' => 'weiyi', 'store_id' => 32,'qualitys' => '1',
+$chuka_phone = ['name' => 'chuka', 'store_id' => 40,'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6414, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6415, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6416, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6417, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6418, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6419, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6420, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6421, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        20 => [
+            ['goods_id' => 49, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom']
+        ],
+        30 => [
+            ['goods_id' => 50, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom']
+        ],
+        50 => [
+            ['goods_id' => 51, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom']
+        ],
+        100 => [
+            ['goods_id' => 52, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$tonglu_phone = ['name' => 'tonglu', 'store_id' => 33,'qualitys' => '4',
+$amingjd_phone = ['name' => 'amingjd', 'store_id' => 41,'qualitys' => '5',
     'amount' => [
-        10 => [['goods_id' => 6422, 'price' => 9.4, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6423, 'price' => 18.8, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6424, 'price' => 28.2, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6425, 'price' => 47, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6426, 'price' => 94, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6427, 'price' => 188, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6428, 'price' => 282, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6429, 'price' => 470, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        30 => [
+            ['goods_id' => 55, 'price' => 27, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 56, 'price' => 45, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 53, 'price' => 90, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 54, 'price' => 180, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
+$legou_phone = ['name' => 'legou', 'store_id' => 42,'qualitys' => '3',
     'amount' => [
-        10 => [['goods_id' => 6430, 'price' => 9.6, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6431, 'price' => 19.2, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6432, 'price' => 28.8, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6433, 'price' => 48, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6434, 'price' => 96, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6435, 'price' => 192, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6436, 'price' => 288, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6437, 'price' => 480, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [
+            ['goods_id' => 57, 'price' => 9.7, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 58, 'price' => 19.4, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 59, 'price' => 29.1, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 60, 'price' => 48.5, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 61, 'price' => 97, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 62, 'price' => 194, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 63, 'price' => 291, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 64, 'price' => 485, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
+$feiniao_phone = ['name' => 'feiniao', 'store_id' => 44,'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6438, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 65, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6439, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 66, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6440, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 67, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6441, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 68, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6442, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 69, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6443, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 70, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6444, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 71, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6445, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
-        ]
+            ['goods_id' => 72, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+        ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$wantong_phone = ['name' => 'wantong', 'store_id' => 36, 'qualitys' => '4',
+$fensheng_phone = ['name' => 'fensheng', 'store_id' => 45,'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6446, 'price' => 9.35, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6447, 'price' => 18.7, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6448, 'price' => 28.05, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6449, 'price' => 46.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6450, 'price' => 93.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6451, 'price' => 187, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6452, 'price' => 280.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6453, 'price' => 467.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [
+            ['goods_id' => 73, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 73, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 74, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 74, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 75, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 75, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 76, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 76, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 77, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 77, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 78, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 78, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
 $phone_providers = [
-//    ['name' => 'beixt', 'cfg' => $beixt_phone],
-//    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
-//    ['name' => 'bjb', 'cfg' => $bjb_phone],
-//    ['name' => 'bjbyd', 'cfg' => $bjbyd_phone],
-//    ['name' => 'yifa', 'cfg' => $yifa_phone],
-//    ['name' => 'jiec', 'cfg' => $jiec_phone],
-//    ['name' => 'weit', 'cfg' => $weit_phone],
-
-    ['name' => 'afand', 'cfg' => $afand_phone],
-    ['name' => 'afandeng', 'cfg' => $afandeng_phone],
-    ['name' => 'afandnew', 'cfg' => $afandnew_phone],
-    ['name' => 'lingzh', 'cfg' => $lingzh_phone],
-    ['name' => 'tongy', 'cfg' => $tongy_phone],
-    ['name' => 'weiyi', 'cfg' => $weiyi_phone],
-    ['name' => 'tonglu', 'cfg' => $tonglu_phone],
-    ['name' => 'xc', 'cfg' => $xc_phone],
-    ['name' => 'xunyin', 'cfg' => $xunyin_phone],
-    ['name' => 'wantong', 'cfg' => $wantong_phone]
+    ['name' => 'baizeyd', 'cfg' => $baizeyd, 'opened' => true, 'sort' => 1],
+    ['name' => 'aming', 'cfg' => $aming_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'binghc', 'cfg' => $binghc_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'ruishun', 'cfg' => $ruishun_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'wuchen', 'cfg' => $wuchen_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'yibao', 'cfg' => $yibao_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'amingyd', 'cfg' => $amingyd_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'chuka', 'cfg' => $chuka_phone, 'opened' => true, 'sort' => 1],
+    ['name' => 'amingjd', 'cfg' => $amingjd_phone],
+    ['name' => 'legou', 'cfg' => $legou_phone],
+    ['name' => 'feiniao', 'cfg' => $feiniao_phone],
+    ['name' => 'fensheng', 'cfg' => $fensheng_phone],
 ];
 $config['phone_providers'] = $phone_providers;

+ 24 - 0
data/model/provider_evidence.model.php

@@ -0,0 +1,24 @@
+<?php
+
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class provider_evidenceModel extends Model
+{
+    public function __construct()
+    {
+        parent::__construct('provider_evidence');
+    }
+
+    public function getProviderEvidence($condition, $pagesize = '', $field = '*', $order = 'add_time desc', $limit = '')
+    {
+        $list = $this->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
+        if (empty($list)) return [];
+        return $list;
+    }
+
+    public function addProviderEvidence($params)
+    {
+        return $this->insert($params);
+    }
+}

+ 10 - 5
data/model/refill_provider.model.php

@@ -5,24 +5,29 @@ defined('InShopNC') or exit('Access Invalid!');
 
 class refill_providerModel extends Model
 {
+    public function __construct()
+    {
+        parent::__construct('refill_provider');
+    }
+
     public function getProviderInfo($cond)
     {
-        return $this->table('refill_provider')->where($cond)->find();
+        return $this->where($cond)->find();
     }
     public function addProvider($insert){
-        return $this->table('refill_provider')->insert($insert);
+        return $this->insert($insert);
     }
     public function editProvider($update, $condition)
     {
-        return $this->table('refill_provider')->where($condition)->update($update);
+        return $this->where($condition)->update($update);
     }
     public function delProvider($condition)
     {
-        return $this->table('refill_provider')->where($condition)->delete();
+        return $this->where($condition)->delete();
     }
     public function getProviderList($condition, $pagesize = '', $field = '*', $order = 'opened asc , provider_id desc', $limit = '')
     {
-        $list = $this->table('refill_provider')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
+        $list = $this->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
         if (empty($list)) return [];
         return $list;
     }

+ 14 - 0
data/model/refill_stats.model.php

@@ -14,4 +14,18 @@ class refill_statsModel extends Model
     {
         return $this->field('*')->where(['stat_id' => ['gt', 0], 'type' => 'system'])->order('stat_id desc')->limit(0)->find();
     }
+
+    public function getStatsInfo($condition = [], $fields = '*', $master = false, $lock = false)
+    {
+        $stats_info = $this->field($fields)->where($condition)->order('')->master($master)->lock($lock)->find();
+        if (empty($stats_info)) {
+            return [];
+        }
+        return $stats_info;
+    }
+
+    public function edit($stat_id,$data)
+    {
+        return $this->where(['stat_id' => $stat_id])->update($data);
+    }
 }

+ 1 - 1
helper/fcgisrv/LZRAccServer.php

@@ -28,7 +28,7 @@ class LZRAccServer extends BaseServer
             'callback/lingzh/baizeyd.php','callback/lingzh/aming.php','callback/lingzh/binghc.php',
             'callback/lingzh/ruishun.php','callback/lingzh/wuchen.php','callback/lingzh/yibao.php',
             'callback/lingzh/amingyd.php','callback/lingzh/chuka.php','callback/lingzh/amingjd.php',
-            'callback/lingzh/legou.php'  ,'callback/lingzh/feiniao.php'
+            'callback/lingzh/legou.php'  ,'callback/lingzh/feiniao.php', 'callback/lingzh/fensheng.php'
         ];
 
         $this->setExFiles($exfiles);

+ 41 - 0
helper/refill/api/lingzh/fensheng/RefillCallBack.php

@@ -0,0 +1,41 @@
+<?php
+
+
+namespace refill\fensheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fensheng/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+       return true;
+    }
+
+    public function notify($params)
+    {
+        $status = $params['status'];
+        $order_sn = $params['consumerNo'];
+        $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'];
+        
+        $data['official_sn'] = strtolower($params['voucherNo']) == 'null' ? '' : $params['voucherNo'];
+
+        if ($status === '001') {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === '003') {
+            return [$order_id, false, false,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 101 - 0
helper/refill/api/lingzh/fensheng/RefillPhone.php

@@ -0,0 +1,101 @@
+<?php
+
+namespace refill\fensheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fensheng/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, string $order_sn)
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['consumerNo'] = $order_sn;
+        $params['mobile'] = $phone;
+        $params['timestamp'] = date("YmdHis");
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $params['flowCode'] = config::ProductIDS[$card_type][$amount];
+        if (empty($params['flowCode'])) {
+            return [false, '产品编号错误', false];
+        }
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params);
+        if ($resp === false) {
+            return [false, '系统错误', true];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+            if($resp === false) {
+                return [false, '系统错误', true];
+            }
+            if($resp['status'] === '001') {
+                return [true, $resp['orderNo'], false];
+            }
+            return [false , $resp['status'], false];
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['consumerNo'] = $refill_info['order_sn'];
+        $params['account'] = config::ACCOUNT;
+        $params['timestamp'] = date("YmdHis");
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::QUERY_URL, $params);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if ($resp === false) {
+                return [false, '系统错误'];
+            }
+            $status = $resp['status'];
+            if ($status === '001') {
+                $order_state = ORDER_STATE_SUCCESS;
+                $save['official_sn'] = strtolower($resp['voucherNo']) == 'null' ? '' : $resp['voucherNo'];
+                Model('refill_order')->edit($refill_info['order_id'], $save);
+            } elseif ($status === '003') {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif ($status === '002') {
+                $order_state = ORDER_STATE_SEND;
+            } else{
+                $order_state = -1;
+            }
+            if ($order_state == -1) {
+                return [false, $status];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    private function sign($params)
+    {
+        $data['account'] = $params['account'];
+        $data['timestamp'] = $params['timestamp'];
+        $data['secret'] = config::KEY;
+        asort($data);
+        $content = '';
+        foreach ($data as $key => $val){
+            $content .= $val;
+        }
+        return sha1($content);
+    }
+}

+ 29 - 0
helper/refill/api/lingzh/fensheng/config.php

@@ -0,0 +1,29 @@
+<?php
+
+
+namespace refill\fensheng;
+use mtopcard;
+
+class config
+{
+    const ORDER_URL = 'http://47.99.65.204/flow-receiver/fee/recharge';
+    const QUERY_URL = 'http://47.99.65.204/flow-receiver/fee/query/single';
+
+    const ACCOUNT = 'yz1688';
+    const KEY = 'a09e9ee5313944509583fd64ea54a692';
+
+    const ProductIDS = [
+        mtopcard\ChinaMobileCard  => [
+            10 => 'CUCCALLr10r', 20 => 'CMCCALLr20r', 30 => 'CMCCALLr30r',
+            50 => 'CMCCALLr50r', 100 => 'CMCCALLr100r', 200 => 'CMCCALLr200r'
+        ],
+        mtopcard\ChinaUnicomCard  => [
+            10 => 'CUCCALLr10r', 20 => 'CUCCALLr20r', 30 => 'CUCCALLr30r',
+            50 => 'CUCCALLr50r', 100 => 'CUCCALLr100r', 200 => 'CUCCALLr200r'
+        ],
+        mtopcard\ChinaTelecomCard => [
+            10 => 'CTCCALLr10r', 20 => 'CTCCALLr20r', 30 => 'CTCCALLr30r',
+            50 => 'CTCCALLr50r', 100 => 'CTCCALLr100r', 200 => 'CTCCALLr200r'
+        ]
+    ];
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 0
helper/refill/api/lingzh/fensheng/琳珠网络科技话费接口充值协议 (1).doc


BIN
helper/refill/api/lingzh/fensheng/琳珠网络科技话费接口状态码详解 (2).docx


+ 54 - 0
helper/refill/api/xyz/wantong/RefillCallBack.php

@@ -0,0 +1,54 @@
+<?php
+
+
+namespace refill\wantong;
+
+require_once(BASE_HELPER_RAPI_PATH . '/wantong/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content  = $params['order_id'] . $params['out_order_id'] . config::MCHID . $params['tel'] . $params['price'];
+        $content .= $params['status'] . config::KEY;
+        return md5($content);
+    }
+
+    //[$order_id, $success, $can_try, $need_handle]
+    public function notify($params)
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['order_id'];
+        $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'];
+        
+        $data['official_sn'] = strtolower($params['out_order_id']) == 'null' ? '' : $params['out_order_id'];
+
+        if ($status === 1) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 0) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 112 - 0
helper/refill/api/xyz/wantong/RefillPhone.php

@@ -0,0 +1,112 @@
+<?php
+
+namespace refill\wantong;
+
+require_once(BASE_HELPER_RAPI_PATH . '/wantong/config.php');
+
+use refill;
+use Log;
+use mtopcard;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['mchid'] = config::MCHID;
+        $params['tel'] = $phone;
+        $params['orderid'] = $order_sn;
+        $params['price'] = $amount;
+        $params['teltype'] = $this->phone_type($phone);
+        $params['timeout'] = 300;
+        $params['notify'] = config::NOTIFY_URL;
+        $params['time'] = time();
+        $params['rand'] = rand(100000, 999999);
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false);
+        if ($resp === false) {
+            return [false, '系统错误', true];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if ($resp == false) {
+                return [false, '系统错误', true];
+            }
+            if ($resp['code'] == 0) {
+                return [true, $resp['order_id'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['orderid'] = $refill_info['order_sn'];
+        $params['mchid'] = config::MCHID;
+
+        $content = $params['mchid'] . $params['orderid'] . config::KEY;
+        $params['sign'] = md5($content);
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if ($resp['code'] == 100) {
+                $status = $resp['status'];
+                if ($status == 3) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                    $updata['official_sn'] = $resp['out_order_id'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                } elseif ($status == 4) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($status, [1, 2])) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    $order_state = -1;
+                }
+                if ($order_state == -1) {
+                    return [false, $resp['data']];
+                }
+                return [true, $order_state];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content = $params['mchid'] . $params['tel'] . $params['price'] . $params['orderid'] . $params['teltype'] . $params['timeout'] . $params['notify'];
+        $content .= $params['time'] . $params['rand'] . $key;
+        return md5($content);
+    }
+
+    private function phone_type($phone)
+    {
+        $card_type = mtopcard\card_type($phone);
+
+        if ($card_type == mtopcard\ChinaMobileCard) {
+            return 0;
+        } elseif ($card_type == mtopcard\ChinaUnicomCard) {
+            return 1;
+        } elseif ($card_type == mtopcard\ChinaTelecomCard) {
+            return 2;
+        }
+    }
+}

+ 6 - 0
helper/refill/api/xyz/wantong/api.txt

@@ -0,0 +1,6 @@
+http://mm.jm618.cn/account/profile
+商户id  10016
+密码123456
+
+话费充值接口文档
+http://mm.jm618.cn/static/download/api1.pdf

+ 16 - 0
helper/refill/api/xyz/wantong/config.php

@@ -0,0 +1,16 @@
+<?php
+
+
+namespace refill\wantong;
+
+
+class config
+{
+    const ORDER_URL = 'https://mm.jm618.cn/api/telpay';
+    const QUERY_URL = 'https://mm.jm618.cn/api/telpay/query';
+
+    const MCHID = 10016;
+    const KEY = '06be014a9c14b12d893663bff36372ba';
+//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_wantong.php";
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+}

+ 5 - 5
helper/refill/api/xyz/xunyin/RefillPhone.php

@@ -40,7 +40,7 @@ class RefillPhone extends refill\IRefillPhone
         } else {
             Log::record($resp, Log::DEBUG);
             $resp = $this->xmlToArray($resp);
-            if ($resp['Code'] == 0000) {
+            if ($resp['Code'] === '0000') {
                 return [true, $resp['order_no'], false];
             } else {
                 return [false, $resp['msg'], false];
@@ -61,13 +61,13 @@ class RefillPhone extends refill\IRefillPhone
             Log::record($resp, Log::DEBUG);
             $resp = $this->xmlToArray($resp);
 
-            if ($resp['state'] == 8888) {
+            if ($resp['state'] === '8888') {
                 $order_state = ORDER_STATE_SUCCESS;
                 $updata['official_sn'] = $resp['operatorid'];
                 Model('refill_order')->edit($refill_info['order_id'], $updata);
-            } elseif ($resp['state'] == 8030) {
+            } elseif ($resp['state'] === '8030') {
                 $order_state = ORDER_STATE_CANCEL;
-            } elseif ($resp['state'] == 0000) {
+            } elseif ($resp['state'] === '0000') {
                 $order_state = ORDER_STATE_SEND;
             } else {
                 $order_state = -1;
@@ -87,7 +87,7 @@ class RefillPhone extends refill\IRefillPhone
         return md5($content);
     }
 
-    private function xmlToArray($xml)
+    public function xmlToArray($xml)
     {
         //禁止引用外部xml实体
         libxml_disable_entity_loader(true);

+ 8 - 0
racc/callback/lingzh/fensheng.php

@@ -0,0 +1,8 @@
+<?php
+$content = $_SERVER['post_content'];
+$inputs = json_decode($content,true);
+foreach ($inputs as $input) {
+    refill\util::push_notify('fensheng',$input);
+}
+
+echo ('SUCCESS');

+ 30 - 12
test/TestRefill.php

@@ -332,7 +332,7 @@ class TestRefill extends TestCase
     public function testPrice()
     {
         $amounts = [10, 20, 30, 50, 100, 200, 300, 500];
-        $rate = 0.935;
+        $rate = 0.953;
         foreach ($amounts as $amount) {
             $price[] = $amount * $rate;
         }
@@ -394,19 +394,37 @@ class TestRefill extends TestCase
     {
         $providers = new refill\xunyin\RefillPhone([]);
 //        $resp = $providers->add(17703711950, 6, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $providers->query(['order_sn' => '76831617176125893158']);
-        $params['ext'] = '';
-        $params['code'] = '8888';
-        $params['sign'] = '428ac223cf3a1f6f3d382aac754e8e17';
-        $params['statemes'] = '成功';
-        $params['id'] = '76831617176125893158';
-        $params['userid'] = '8417';
-        $params['operatorid'] = '1000000083421033115583773201';
-        $params['status'] = 'SUCCESS';
-        refill\RefillFactory::instance()->notify('xunyin',$params);
+        $resp = $providers->query(['order_sn' => '76831617176125893158']);
+        $xml = '<Order><cpid>8417</cpid><orderid>40591617173295524057</orderid><order_no>14784226</order_no><msg>充值中</msg><Code>0000</Code><Cards/></Order>';
+        $resp = $providers->xmlToArray($xml);
+        if ($resp['Code'] === '0000') {
+            return [true, $resp['order_no'], false];
+        } else {
+            return [false, $resp['msg'], false];
+        }
+//        $params['ext'] = '';
+//        $params['code'] = '8888';
+//        $params['sign'] = '428ac223cf3a1f6f3d382aac754e8e17';
+//        $params['statemes'] = '成功';
+//        $params['id'] = '76831617176125893158';
+//        $params['userid'] = '8417';
+//        $params['operatorid'] = '1000000083421033115583773201';
+//        $params['status'] = 'SUCCESS';
+//        refill\RefillFactory::instance()->notify('xunyin',$params);
+    }
+
+    public function testFenshengPhone()
+    {
+        $providers = new refill\fensheng\RefillPhone([]);
+//        $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->query(['order_sn' => '27511617764278021035']);
+//        $datas = '[{"orderNo":"F2104071058069438461","status":"001","consumerNo":"27511617764278021035","voucherNo":"510490688023364042","mobile":"13699279618"}]';
+//        $datas = json_decode($datas,true);
+//        foreach ($datas as $data) {
+//            refill\RefillFactory::instance()->notify('fensheng',$data);
+//        }
     }
 
-
     public function testLingzhPhone()
     {
         $providers = new refill\lingzh\RefillPhone([]);