浏览代码

Merge branch 'raccount' into rchannel

xiaoyu 1 年之前
父节点
当前提交
bacf3feba2
共有 43 个文件被更改,包括 1013 次插入31 次删除
  1. 1 1
      admin/control/merchant.php
  2. 18 3
      admin/control/provider.php
  3. 3 5
      admin/control/refill_third.php
  4. 1 1
      admin/templates/default/merchant.refill.evidence_list.php
  5. 19 1
      admin/templates/default/provider.amount.edit.php
  6. 2 1
      admin/templates/default/refill.merchant.channel.cfg.php
  7. 2 1
      admin/templates/default/third.product.add.php
  8. 2 1
      admin/templates/default/third.product.edit.php
  9. 1 0
      admin/templates/default/third.product.list.php
  10. 17 6
      admin/templates/default/third.proprice.list.php
  11. 2 2
      data/config/dev/base.ini.php
  12. 6 0
      data/config/xyz/refill.ini.php
  13. 28 0
      data/config/yl/refill.ini.php
  14. 8 1
      helper/rbridge/fulu_ylyw/product.php
  15. 9 1
      helper/rbridge/fulu_ylyw/readme.txt
  16. 67 0
      helper/refill/api/xyz/bingguang_third/RefillCallBack.php
  17. 171 0
      helper/refill/api/xyz/bingguang_third/RefillPhone.php
  18. 18 0
      helper/refill/api/xyz/bingguang_third/config.php
  19. 14 0
      helper/refill/api/xyz/bingguang_third/开户信息.txt
  20. 1 1
      helper/refill/api/xyz/by_online/RefillPhone.php
  21. 5 0
      helper/refill/api/xyz/dazhanggui_fs/api.txt
  22. 7 0
      helper/refill/api/xyz/dazhanggui_fs/config.php
  23. 二进制
      helper/refill/api/xyz/guochuang/20230515广东移动调价函.jpg
  24. 二进制
      helper/refill/api/xyz/guochuang/20230517广东移动调价函.jpg
  25. 二进制
      helper/refill/api/xyz/guochuang/20230519辽宁移动调价函.png
  26. 1 1
      helper/refill/api/xyz/guochuang/config.php
  27. 7 0
      helper/refill/api/yl/dazhanggui_fs/config.php
  28. 1 1
      helper/refill/api/yl/guochuang/config.php
  29. 76 0
      helper/refill/api/yl/youjuntf/RefillCallBack.php
  30. 161 0
      helper/refill/api/yl/youjuntf/RefillPhone.php
  31. 7 0
      helper/refill/api/yl/youjuntf/api.txt
  32. 13 0
      helper/refill/api/yl/youjuntf/config.php
  33. 76 0
      helper/refill/api/yl/youlaitf/RefillCallBack.php
  34. 161 0
      helper/refill/api/yl/youlaitf/RefillPhone.php
  35. 7 0
      helper/refill/api/yl/youlaitf/api.txt
  36. 13 0
      helper/refill/api/yl/youlaitf/config.php
  37. 4 0
      mobile/callback/refill_bingguang_third.php
  38. 4 0
      mobile/callback/refill_youjuntf.php
  39. 4 0
      mobile/callback/refill_youlaitf.php
  40. 0 2
      plot/refill/ChannelReader.py
  41. 34 2
      test/TestCommand.php
  42. 13 0
      test/TestRefill.php
  43. 29 0
      test/TestRefillYl.php

+ 1 - 1
admin/control/merchant.php

@@ -434,7 +434,7 @@ class merchantControl extends SystemControl
             if (trim($_GET['product_name']) != '') {
                 $condition['product_name'] = ['like', '%' . $_GET['product_name'] . '%'];
             }
-            $third_product = $mod->getProductList($condition, 50);
+            $third_product = $mod->getProductList($condition, 200, 'system_code asc');
 
             $model_merchant = Model('merchant');
             $items = $model_merchant->table('merchant_price')->where(['mchid' => $mchid, 'quality' => 1, 'card_types' => mtopcard\ThirdRefillCard])->select();

+ 18 - 3
admin/control/provider.php

@@ -585,10 +585,25 @@ class providerControl extends SystemControl
 
         if(chksubmit())
         {
-            $bz = $_POST['bz'];
-            $resp = $mod->where(['id' => $amount_id])->update(['bz' => $bz]);
+            if (!empty($_FILES['voucher']['name'])) {
+                $upload = new UploadFile();
+                $upload->set('default_dir', ATTACH_UPFILE);
+
+                $result = $upload->upfile('voucher');
+                if ($result) {
+                    $updata['voucher_name'] = $upload->file_name;
+                } else {
+                    showMessage($upload->error);
+                }
+            }
+
+            $updata['bz'] = $_POST['bz'];
+            $resp = $mod->where(['id' => $amount_id])->update($updata);
             if($resp) {
-                showMessage('编辑成功');
+                if(!empty($updata['voucher_name'])){
+                    @unlink(BASE_UPLOAD_PATH.'/'.ATTACH_UPFILE.'/'.$provider_amount['voucher_name']);
+                }
+                showMessage('编辑成功', 'index.php?act=provider&op=provider_amount');
             }else{
                 showMessage('编辑失败');
             }

+ 3 - 5
admin/control/refill_third.php

@@ -119,11 +119,9 @@ class refill_thirdControl extends SystemControl
     {
         $system_code = $_GET['system_code'] ?? $_POST['system_code'];
         $mod = Model('refill_third');
-        $third_product = $mod->findThirdProduct($system_code);
-        if(empty($third_product)) {
-            showMessage('产品不存在');
+        if(!empty($system_code)) {
+            $condition['system_code'] = $system_code;
         }
-        $condition['system_code'] = $system_code;
         if(!empty($_GET['store_id']))
         {
             $condition['store_id'] = $_GET['store_id'];
@@ -134,7 +132,7 @@ class refill_thirdControl extends SystemControl
 
         Tpl::output('providers', $providers);
         Tpl::output('product_list', $list);
-        Tpl::output('third_product', $third_product);
+        Tpl::output('system_code', $system_code);
         Tpl::output('recharge_type_text', ['直充','卡密','直充+卡密']);
         Tpl::output('page', $mod->showpage());
         Tpl::showpage('third.proprice.list');

+ 1 - 1
admin/templates/default/merchant.refill.evidence_list.php

@@ -205,7 +205,7 @@
                             <?php echo $v['amount']*100%100==0 ? intval($v['amount']) : $v['amount']; ?>
                             (
                                 <?php
-                                    if($v['amount'] >= 10000) {
+                                    if($v['amount'] >= 10000 || $v['amount'] <= -10000) {
                                         echo intval($v['amount'] / 10000) . '万';
                                     }else{
                                         echo $v['amount'] . '元';

+ 19 - 1
admin/templates/default/provider.amount.edit.php

@@ -41,7 +41,22 @@
                     <?php echo $output['provider_amount']['amount'];?>
                 </td>
             </tr>
-
+            <tr>
+                <td colspan="2"><label>充值申请凭证:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                <span class="type-file-show"> <img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
+                    <div class="type-file-preview" style="display: none;"><img id="view_img" src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_UPFILE.'/'.$output['provider_amount']['voucher_name']; ?>"></div>
+                </span>
+                <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>
@@ -75,5 +90,8 @@
         $("#submitBtn").click(function () {
             $("#user_form").submit();
         });
+        $("#voucher").change(function () {
+            $("#textfield1").val($(this).val());
+        });
     });
 </script>

+ 2 - 1
admin/templates/default/refill.merchant.channel.cfg.php

@@ -172,6 +172,7 @@
                 <li><a href="index.php?act=refill_merchant_channel_cfg&op=index&type=1&quality=<?php echo refill\Quality::SlowTwentyFour; ?>" class="classA" data-type="1-<?php echo refill\Quality::SlowTwentyFour; ?>"><span>有流水油卡通道控制</span></a></li>
                 <li><a href="index.php?act=refill_merchant_channel_cfg&op=index&type=1&quality=<?php echo refill\Quality::CardKey; ?>" class="classA" data-type="1-<?php echo refill\Quality::CardKey; ?>"><span>卡密油卡通道控制</span></a></li>
                 <li><a href="index.php?act=refill_merchant_channel_cfg&op=index&type=1&quality=<?php echo refill\Quality::Quick; ?>" class="classA" data-type="1-<?php echo refill\Quality::Quick; ?>"><span>快充油卡通道控制</span></a></li>
+                <li><a href="index.php?act=refill_merchant_channel_cfg&op=index&type=3&quality=<?php echo refill\Quality::Normal; ?>" class="classA" data-type="3-<?php echo refill\Quality::Normal; ?>"><span>权益通道控制</span></a></li>
             </ul>
         </div>
     </div>
@@ -444,4 +445,4 @@
 
         })
     });
-</script>
+</script>

+ 2 - 1
admin/templates/default/third.product.add.php

@@ -7,6 +7,7 @@
             <ul class="tab-base">
                 <li><a href="index.php?act=refill_third&op=index"><span>增值产品列表</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_new'] ?>产品</span></a></li>
+                <li><a href="index.php?act=refill_third&op=third_proprice"><span>通道产品列表</span></a></li>
             </ul>
         </div>
     </div>
@@ -29,7 +30,7 @@
                 <td class="vatop rowform">
                     <label for="product_type"></label><select name="product_type" id="product_type">
                         <?php foreach($output['third_product_type'] as $product_type => $text){ ?>
-                            <option value="<?php echo $product_type?>" <?php if($_GET['product_type'] == $product_type){ echo 'selected';}?>><?php echo $text;?></option>
+                            <option value="<?php echo $product_type?>"><?php echo $text;?></option>
                         <?php }?>
                     </select>
                 </td>

+ 2 - 1
admin/templates/default/third.product.edit.php

@@ -7,6 +7,7 @@
             <ul class="tab-base">
                 <li><a href="index.php?act=refill_third&op=index"><span>增值产品列表</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_update'] ?></span></a></li>
+                <li><a href="index.php?act=refill_third&op=third_proprice"><span>通道产品列表</span></a></li>
             </ul>
         </div>
     </div>
@@ -30,7 +31,7 @@
                 <td class="vatop rowform">
                     <label for="product_type"></label><select name="product_type" id="product_type">
                         <?php foreach($output['third_product_type'] as $product_type => $text){ ?>
-                            <option value="<?php echo $product_type?>" <?php if($_GET['product_type'] == $product_type){ echo 'selected';}?>><?php echo $text;?></option>
+                            <option value="<?php echo $product_type?>" <?php if($output['third_product']['product_type'] == $product_type){ echo 'selected';}?>><?php echo $text;?></option>
                         <?php }?>
                     </select>
                 </td>

+ 1 - 0
admin/templates/default/third.product.list.php

@@ -7,6 +7,7 @@
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current"><span>增值产品列表</span></a></li>
                 <li><a href="index.php?act=refill_third&op=product_add"><span><?php echo $lang['nc_new'] ?>产品</span></a></li>
+                <li><a href="index.php?act=refill_third&op=third_proprice"><span>通道产品列表</span></a></li>
             </ul>
         </div>
     </div>

+ 17 - 6
admin/templates/default/third.proprice.list.php

@@ -6,7 +6,9 @@
             <h3>增值业务管理</h3>
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current"><span>通道产品列表</span></a></li>
+                <?php if(!empty($output['system_code'])) {?>
                 <li><a href="index.php?act=refill_third&op=third_proprice_add&system_code=<?php echo $_GET['system_code'];?>"><span><?php echo $lang['nc_new'] ?>通道产品</span></a></li>
+                <?php }?>
             </ul>
         </div>
     </div>
@@ -64,12 +66,10 @@
             <tr class="thead">
                 <th>通道名称</th>
                 <th>通道产品名称</th>
-                <th>产品名称</th>
                 <th>店铺ID</th>
                 <th>商品ID</th>
                 <th>通道code</th>
                 <th>椰子code</th>
-                <th>面值</th>
                 <th>折扣价格</th>
                 <th>充值类型</th>
                 <th class="align-center">操作</th>
@@ -81,17 +81,16 @@
                     <tr class="trFlex">
                         <td><?php echo $v['channel_name']; ?></td>
                         <td><?php echo $v['channel_product_name']; ?></td>
-                        <td><?php echo $output['third_product']['product_name']; ?></td>
                         <td><?php echo $v['store_id']; ?></td>
                         <td><?php echo $v['goods_id']; ?></td>
                         <td><?php echo $v['channel_code']; ?></td>
-                        <td><?php echo $output['third_product']['system_code']; ?></td>
-                        <td><?php echo $output['third_product']['refill_amount']; ?></td>
+                        <td><?php echo $v['system_code']; ?></td>
                         <td><?php echo $v['channel_amount']; ?></td>
                         <td><?php echo $output['recharge_type_text'][$v['recharge_type']-1]; ?></td>
                         <td class="align-center w200">
                             <a href="index.php?act=refill_third&op=third_proprice_edit&system_code=<?php echo $v['system_code'] ?>&store_id=<?php echo $v['store_id'];?>&goods_id=<?php echo $v['goods_id'];?>">编辑</a>
-                            <a href="index.php?act=refill_third&op=third_proprice_del&system_code=<?php echo $v['system_code'] ?>&store_id=<?php echo $v['store_id'];?>&goods_id=<?php echo $v['goods_id'];?>">删除</a>
+                            |
+                            <a class="del" href="#" data-system_code="<?php echo $v['system_code'] ?>"  data-store_id="<?php echo $v['store_id'] ?>"  data-goods_id="<?php echo $v['goods_id'] ?>" >删除</a>
                         </td>
                     </tr>
                 <?php } ?>
@@ -113,6 +112,8 @@
     </form>
 </div>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css" />
 <script>
     $(function () {
         $('#ncsubmit').click(function () {
@@ -135,5 +136,15 @@
                 $(this).css('color', 'red')
             }
         })
+        $('.del').click(function() {
+            let system_code = $(this).attr('data-system_code')
+            let store_id = $(this).attr('data-store_id')
+            let goods_id = $(this).attr('data-goods_id')
+            layer.confirm('确定要删除?', {
+                btn: ['确定', '取消']
+            }, function() {
+                window.location.href = `index.php?act=refill_third&op=third_proprice_del&system_code=${system_code}&store_id=${store_id}&goods_id=${goods_id}`
+            }, function() {})
+        });
     });
 </script>

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

@@ -53,14 +53,14 @@ define('SSH_TUNEL_PROD','local');
 
 if(SSH_TUNEL_PROD ==='local') {
     $config['db'][1]['dbhost']       = MASTER_DBHOST;
-    $config['db'][1]['dbport']       = '3306';
+    $config['db'][1]['dbport']       = '3307';
     $config['db'][1]['dbuser']       = 'root';
     $config['db'][1]['dbpwd']        = '55668899';
     $config['db'][1]['dbname']       = 'ylshop';
     $config['db'][1]['dbcharset']    = 'UTF-8';
 
     $config['db']['slave'][0]['dbhost']     = SLAVE_DBHOST;
-    $config['db']['slave'][0]['dbport']     = '3306';
+    $config['db']['slave'][0]['dbport']     = '3307';
     $config['db']['slave'][0]['dbuser']     = 'root';
     $config['db']['slave'][0]['dbpwd']      = '55668899';
     $config['db']['slave'][0]['dbname']     = 'ylshop';

+ 6 - 0
data/config/xyz/refill.ini.php

@@ -9290,6 +9290,11 @@ $bingguang_third = ['name' => 'bingguang', 'store_id' => 321, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$bingguang_third_third = ['name' => 'bingguang_third', 'store_id' => 324, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 8653, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
 
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
@@ -9307,6 +9312,7 @@ $third_providers = [
     ['name' => 'zhongst_doubi', 'cfg' => $zhongst_doubi_third],
     ['name' => 'weixue_doubi', 'cfg' => $weixue_doubi_third],
     ['name' => 'bingguang', 'cfg' => $bingguang_third],
+    ['name' => 'bingguang_third', 'cfg' => $bingguang_third_third],
 ];
 $config['third_providers'] = $third_providers;
 

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

@@ -7328,6 +7328,32 @@ $youjunyinys_phone = ['name' => 'youjunyinys', 'store_id' => 275, 'qualitys' =>
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$youjuntf_phone = ['name' => 'youjuntf', 'store_id' => 277, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 8280, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 8281, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 8282, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8283, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8284, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8285, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 8286, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 8287, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$youlaitf_phone = ['name' => 'youlaitf', 'store_id' => 278, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 8288, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 8289, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 8290, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8291, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8292, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8293, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 8294, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 8295, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -7561,6 +7587,8 @@ $phone_providers = [
     ['name' => 'coapi_trd', 'cfg' => $coapi_trd_phone],
     ['name' => 'youjunnoy', 'cfg' => $youjunnoy_phone],
     ['name' => 'youjunyinys', 'cfg' => $youjunyinys_phone],
+    ['name' => 'youjuntf', 'cfg' => $youjuntf_phone],
+    ['name' => 'youlaitf', 'cfg' => $youlaitf_phone],
 
 ];
 $config['phone_providers'] = $phone_providers;

+ 8 - 1
helper/rbridge/fulu_ylyw/product.php

@@ -23,7 +23,6 @@ $fulu_ylyw_product = [
 
 // 椰林
     10326 => [
-        //移动
         502540719 => [4, 5, 6],
         503196622 => [4, 5, 6],
         508604768 => [4, 5, 6],
@@ -32,5 +31,13 @@ $fulu_ylyw_product = [
         507996947 => [5],
         504279529 => [4],
     ],
+
+    10335 => [
+        504804589 => [4, 5, 6],
+        504213504 => [4, 5, 6],
+        501457830 => [4, 5, 6],
+        508509957 => [4, 5, 6],
+        501826627 => [4, 5, 6],
+    ],
 ];
 

+ 9 - 1
helper/rbridge/fulu_ylyw/readme.txt

@@ -45,4 +45,12 @@ https://ylapi.xyzshops.cn/mobile/bridge/fulu_ylyw.php
 2023.4.27
 501089659  电信10
 507996947  联通10
-504279529 移动10
+504279529 移动10
+
+2023.5.12
+10335 fuluyoucomeyin 66579 带票:福禄-游来(银)
+504804589 50
+504213504 100
+501457830 200
+508509957 300
+501826627 500

+ 67 - 0
helper/refill/api/xyz/bingguang_third/RefillCallBack.php

@@ -0,0 +1,67 @@
+<?php
+namespace refill\bingguang_third;
+
+require_once(BASE_HELPER_RAPI_PATH . '/bingguang_third/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+
+    private function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['outOrderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 2) {
+            $data['official_sn'] = strtolower($params['ext1']) == 'null' ? '' : $params['ext1'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif ($status === 3) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 171 - 0
helper/refill/api/xyz/bingguang_third/RefillPhone.php

@@ -0,0 +1,171 @@
+<?php
+
+namespace refill\bingguang_third;
+
+require_once(BASE_HELPER_RAPI_PATH . '/bingguang_third/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillThird
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function getProductCode($goods_id, $sys_pcode)
+    {
+        $thrid_refill = Model('thrid_refill');
+        $product = $thrid_refill->getProviderProduct($this->mStoreID,$goods_id,$sys_pcode);
+        if (empty($product)) {
+            return false;
+        } else {
+            return $product['channel_code'];
+        }
+    }
+
+    private function req_params($phone, string $order_sn, $product_code)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $order_sn;
+        $params['uuid'] = $phone;
+        $params['itemId'] = $product_code;
+        $params['amount'] = 1;
+        $params['callbackUrl'] = config::NOTIFY_URL;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $goods_id = intval($params['goods_id']);
+
+        $product_code = $this->getProductCode($goods_id, $params['product_code']);
+        Model('thrid_refill')->edit_third($params['order_id'], ['chcode' => $product_code]);
+
+        $params = $this->req_params($card_no, $order_sn, $product_code);
+        if(empty($params['itemId'])) {
+            return [false, '商品编号错误', false];
+        }
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['code'] === '00') {
+                return [true, $resp['orderId'], false];
+            } elseif (in_array($resp['code'], config::ERRCODES, true)) {
+                return [false, $resp['msg'], false];
+            } elseif (in_array($resp['code'], ['-22', '-23', '-99'], true)) {
+                $net_errno = "HTTP-{$resp['code']}";
+                return [false, $resp['msg'], true];
+            } else {
+                $net_errno = "HTTP-998";
+                return [false, $resp['msg'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $refill_info['order_sn'];
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['code'] === '00')
+            {
+                $status = $resp['orderStatus'];
+                if ($status === '2') {
+                    $updata['official_sn'] = $resp['ext1'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '3') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '1') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '4' && (time() - $refill_info['commit_time'] >= 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $resp['msg']];
+                }
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['appId'] = config::APP_ID;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['code'] === '00') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function get_millisecond()
+    {
+        list($usec, $sec) = explode(" ", microtime());
+        return round($usec*1000);
+    }
+
+    private function sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+}

+ 18 - 0
helper/refill/api/xyz/bingguang_third/config.php

@@ -0,0 +1,18 @@
+<?php
+
+
+namespace refill\bingguang_third;
+
+class config
+{
+    const ORDER_URL = 'http://120.79.190.232:8911/api/order/submit';
+    const QUERY_URL = 'http://120.79.190.232:8911/api/order/query';
+    const BALANCE_URL = 'http://120.79.190.232:8911/api/account/balance';
+
+    const APP_ID = 'lMIQD9hkWG';
+    const APP_SECRET = 'nKFiCyiTcZAIXXvx';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_bingguang_third.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+    const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+}

+ 14 - 0
helper/refill/api/xyz/bingguang_third/开户信息.txt

@@ -0,0 +1,14 @@
+后台地址:http://120.79.190.232:8888
+帐号:bjgyqyzcxy
+密码:159447
+二级密码:fcFv4104
+appId:lMIQD9hkWG
+appSecret:nKFiCyiTcZAIXXvx
+后台-商品列表,可查看已配置商品信息
+后台-安全中心,可配置IP白名单
+接口文档:https://www.showdoc.com.cn/2167197494741781/9729864782737996
+通用直充接口地址:http://120.79.190.232:8911/api/order/submit
+话费直充接口地址:http://120.79.190.232:8911/api/hf/order/submit
+卡密提取接口地址:http://120.79.190.232:8911/api/card/get
+查询接口接口地址:http://120.79.190.232:8911/api/order/query
+余额查询接口地址:http://120.79.190.232:8911/api/account/balance

+ 1 - 1
helper/refill/api/xyz/by_online/RefillPhone.php

@@ -121,7 +121,7 @@ class RefillPhone extends refill\IRefillPhone
             if (empty($resp)) {
                 return [false, '系统错误'];
             } elseif ($resp['code'] === 1000) {
-                return [true, $resp['data']['balance'] * 100];
+                return [true, $resp['data']['balance'] / 100];
             } else {
                 return [false, $resp['msg']];
             }

+ 5 - 0
helper/refill/api/xyz/dazhanggui_fs/api.txt

@@ -184,3 +184,8 @@
 1420050 话费 湖北移动50元
 1420100 话费 湖北移动100元
 1420200 话费 湖北移动200元
+
+2023.5.14
+新疆移动50元 1650050
+新疆移动100元 1650100
+新疆移动200元 1650200

+ 7 - 0
helper/refill/api/xyz/dazhanggui_fs/config.php

@@ -119,6 +119,12 @@ class config
                 100 => 1420100,
                 200 => 1420200,
             ],
+            //新疆
+            31 => [
+                50  => 1650050,
+                100 => 1650100,
+                200 => 1650200,
+            ],
         ],
         mtopcard\ChinaTelecomCard => [
             //湖南
@@ -232,6 +238,7 @@ class config
         "4-50-22" => 47, "4-100-22" => 94, "4-200-22" => 188,//重庆 22
         "4-30-6" => 28.05, "4-50-6" => 46.75, "4-100-6" => 93.5, "4-200-6" => 187,//辽宁 6
         "4-50-17" => 47, "4-100-17" => 94, "4-200-17" => 188,//湖北 17
+        "4-50-31" => 46.75, "4-100-31" => 93.5, "4-200-31" => 187,//新疆 31
 
         //电信
         "6-30-18" => 28.35, "6-50-18" => 47.25, "6-100-18" => 94.5, "6-200-18" => 189,//湖南 18

二进制
helper/refill/api/xyz/guochuang/20230515广东移动调价函.jpg


二进制
helper/refill/api/xyz/guochuang/20230517广东移动调价函.jpg


二进制
helper/refill/api/xyz/guochuang/20230519辽宁移动调价函.png


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

@@ -64,7 +64,7 @@ class config
     const Price = [
         //移动
         "4-10-2" => 10.18, "4-20-2" => 20.36, "4-30-2" => 30.18, "4-50-2" => 50.3, "4-100-2" => 100.3, "4-200-2" => 200.6, "4-300-2" => 300.9, "4-500-2" => 501.5,//天津 2
-        "4-10-6" => 9.7, "4-20-6" => 19.4, "4-30-6" => 29.1, "4-50-6" => 48.5, "4-100-6" => 97, "4-200-6" => 194, "4-300-6" => 291, "4-500-6" => 485,//辽宁 6
+        "4-10-6" => 9.69, "4-20-6" => 19.38, "4-30-6" => 29.07, "4-50-6" => 48.45, "4-100-6" => 96.9, "4-200-6" => 193.8, "4-300-6" => 290.7, "4-500-6" => 484.5,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 9.98, "4-20-8" => 19.96, "4-30-8" => 29.94, "4-50-8" => 49.9, "4-100-8" => 99.8, "4-200-8" => 199.6, "4-300-8" => 299.4, "4-500-8" => 499,//黑龙江 8
         "4-10-29" => 9.88, "4-20-29" => 19.76, "4-30-29" => 29.64, "4-50-29" => 49.4, "4-100-29" => 98.8, "4-200-29" => 197.6, "4-300-29" => 296.4, "4-500-29" => 494,//青海 29

+ 7 - 0
helper/refill/api/yl/dazhanggui_fs/config.php

@@ -119,6 +119,12 @@ class config
                 100 => 1420100,
                 200 => 1420200,
             ],
+            //新疆
+            31 => [
+                50  => 1650050,
+                100 => 1650100,
+                200 => 1650200,
+            ],
         ],
         mtopcard\ChinaTelecomCard => [
             //湖南
@@ -232,6 +238,7 @@ class config
         "4-50-22" => 47, "4-100-22" => 94, "4-200-22" => 188,//重庆 22
         "4-30-6" => 28.05, "4-50-6" => 46.75, "4-100-6" => 93.5, "4-200-6" => 187,//辽宁 6
         "4-50-17" => 47, "4-100-17" => 94, "4-200-17" => 188,//湖北 17
+        "4-50-31" => 46.75, "4-100-31" => 93.5, "4-200-31" => 187,//新疆 31
 
         //电信
         "6-30-18" => 28.35, "6-50-18" => 47.25, "6-100-18" => 94.5, "6-200-18" => 189,//湖南 18

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

@@ -64,7 +64,7 @@ class config
     const Price = [
         //移动
         "4-10-2" => 10.18, "4-20-2" => 20.36, "4-30-2" => 30.18, "4-50-2" => 50.3, "4-100-2" => 100.3, "4-200-2" => 200.6, "4-300-2" => 300.9, "4-500-2" => 501.5,//天津 2
-        "4-10-6" => 9.7, "4-20-6" => 19.4, "4-30-6" => 29.1, "4-50-6" => 48.5, "4-100-6" => 97, "4-200-6" => 194, "4-300-6" => 291, "4-500-6" => 485,//辽宁 6
+        "4-10-6" => 9.69, "4-20-6" => 19.38, "4-30-6" => 29.07, "4-50-6" => 48.45, "4-100-6" => 96.9, "4-200-6" => 193.8, "4-300-6" => 290.7, "4-500-6" => 484.5,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 9.98, "4-20-8" => 19.96, "4-30-8" => 29.94, "4-50-8" => 49.9, "4-100-8" => 99.8, "4-200-8" => 199.6, "4-300-8" => 299.4, "4-500-8" => 499,//黑龙江 8
         "4-10-29" => 9.88, "4-20-29" => 19.76, "4-30-29" => 29.64, "4-50-29" => 49.4, "4-100-29" => 98.8, "4-200-29" => 197.6, "4-300-29" => 296.4, "4-500-29" => 494,//青海 29

+ 76 - 0
helper/refill/api/yl/youjuntf/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\youjuntf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/youjuntf/config.php');
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params)
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_sn'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/yl/youjuntf/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\youjuntf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/youjuntf/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['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $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 , [] , $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 200) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === 200)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message']];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 200) {
+                return [true, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

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

@@ -0,0 +1,7 @@
+https://co-data.zylife.co//merchant/#/login
+
+youjuntf
+shasfo-hd
+
+49
+5a0dc9a1a2f9042d5ed2a7c8518f9390

+ 13 - 0
helper/refill/api/yl/youjuntf/config.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace refill\youjuntf;
+
+class config
+{
+    const ORDER_URL = 'https://co-api.zylife.co/mobile/index.php';
+
+    const MCH_ID = 49;
+    const KEY = '5a0dc9a1a2f9042d5ed2a7c8518f9390';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_youjuntf.php";
+
+}

+ 76 - 0
helper/refill/api/yl/youlaitf/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\youlaitf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/youlaitf/config.php');
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params)
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_sn'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/yl/youlaitf/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\youlaitf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/youlaitf/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['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $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 , [] , $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 200) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === 200)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message']];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 200) {
+                return [true, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

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

@@ -0,0 +1,7 @@
+https://co-data.zylife.co//merchant/#/login
+
+youlai-tf
+dgbuQ-BGh
+
+50
+1b85fa5f9e69b6c4cbf9c205b60a0991

+ 13 - 0
helper/refill/api/yl/youlaitf/config.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace refill\youlaitf;
+
+class config
+{
+    const ORDER_URL = 'https://co-api.zylife.co/mobile/index.php';
+
+    const MCH_ID = 50;
+    const KEY = '1b85fa5f9e69b6c4cbf9c205b60a0991';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_youlaitf.php";
+
+}

+ 4 - 0
mobile/callback/refill_bingguang_third.php

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

+ 4 - 0
mobile/callback/refill_youjuntf.php

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

+ 4 - 0
mobile/callback/refill_youlaitf.php

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

+ 0 - 2
plot/refill/ChannelReader.py

@@ -186,6 +186,4 @@ class ChannelReader(DataReadStream):
         else:
             return None
 
-
-
     pass

+ 34 - 2
test/TestCommand.php

@@ -6,19 +6,51 @@
  * Time: 下午5:19
  */
 
+define('APP_ID', 'test');
 define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
 
+require_once(BASE_ROOT_PATH . '/global.php');
+require_once(BASE_CORE_PATH . '/lrlz.php');
 require_once(BASE_ROOT_PATH . '/fooder.php');
+
 require_once(BASE_ROOT_PATH . '/helper/search/tcp_client.php');
 require_once(BASE_ROOT_PATH . '/helper/message/publisher.php');
 
-class TestCommand extends PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+
+class TestCommand extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass() : void
     {
         Base::run_util();
     }
 
+    //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestCommand::testExportCard)( .*)?$/" --test-suffix TestCommand.php /var/www/html/test
+    public function testExportCard()
+    {
+        $filename = BASE_DATA_PATH . "/log/cards.csv";
+        $fcards = fopen($filename,'w+');
+
+        $mod_member = Model('card_info');
+        $start = 0;
+        while (true)
+        {
+            $items = $mod_member->field('card_no,using_times')->where(['card_no' => ['gt', $start], 'card_type' => 4])->limit("0,1000")->select();
+            if (empty($items)) {
+                break;
+            }
+
+            foreach ($items as $item) {
+                $card_no = $item['card_no'];
+                $start = $card_no;
+                $using_times = $item['using_times'] + 1;
+                fputcsv($fcards, [$card_no,$using_times]);
+            }
+        }
+
+        fclose($fcards);
+    }
+
     public function testInit_reward()
     {
         $mod_member = Model('member');

+ 13 - 0
test/TestRefill.php

@@ -3391,7 +3391,20 @@ class TestRefill extends TestCase
         $provider = $this->getProvider('zhongst_oil', 'RefillCallBack');
         $ret = $provider->verify($params);
         $resp = $provider->notify($params);
+    }
+
+    public function testBingguang_third()
+    {
+//        $provider = $this->getProvider('bingguang_third');
+//        $resp = $provider->balance();
+//        $resp = $provider->add(608168539, 7, 30, [ 'order_sn' => $this->make_sn(), 'product_code' => 'XYZ100777', 'goods_id' => '6978', ]);
+//        $resp = $provider->query(['order_sn' => '92481683880348681476']);
 
+        $body = ' {"orderId":"230512163238675676","appId":"lMIQD9hkWG","outOrderId":"92481683880348681476","sign":"37a3b416c25f4272b4375a544168033b","orderStatus":"3","completeTime":"20230512164216","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('bingguang_third','RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
     }
 
     public function testAmingjd()

+ 29 - 0
test/TestRefillYl.php

@@ -1030,4 +1030,33 @@ class TestRefillYl extends TestCase
         $resp = $provider->add(18074608795, 4, 200, ['order_sn' => $this->make_sn(), 'product_code' => 'XYZ100777', 'goods_id' => 6978]);
         $resp = $provider->query(['order_sn' => '38371683618172040780']);
     }
+
+    public function testyoujuntf()
+    {
+//        $provider = $this->getProvider('youjuntf');
+//        $resp = $provider->balance();
+//        $resp = $provider->add(15811535608, 4, 100, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
+//        $resp = $provider->query(['order_sn' => '21451684394298374822']);
+
+        $body = '{"mchid":"49","order_sn":"21451684394298374822","amount":"100.0000","cardno":"15811535608","trade_no":"6386480737738308639213","idcard":"","card_name":"","official_sn":"","message":"fail","state":"CANCEL","sign":"46d1f2b3fd712810b89b680571b70496"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('youjuntf', 'RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
+    }
+
+    public function testyoulaitf()
+    {
+//        $provider = $this->getProvider('youlaitf');
+//        $resp = $provider->balance();
+//        $resp = $provider->add(15811535608, 4, 100, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
+//        $resp = $provider->query(['order_sn' => '80441684396453923189']);
+
+        $body = '{"mchid":"50","order_sn":"80441684396453923189","amount":"100.0000","cardno":"15811535608","trade_no":"0379320737740458239201","idcard":"","card_name":"","official_sn":"","message":"fail","state":"CANCEL","sign":"15d30000960fde053fabad4255b7ade1"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('youlaitf', 'RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
+
+    }
 }