Procházet zdrojové kódy

Merge branch 'rquality' of 39.97.239.116:gyfl/xyzshop into rquality

stanley-king před 4 roky
rodič
revize
df469e4f3d

+ 5 - 8
admin/control/merchant.php

@@ -1041,6 +1041,7 @@ class merchantControl extends SystemControl
                 if(!array_key_exists($key,$cur)) {
                     $insert['name'] = $key;
                     $insert['store_id'] = $value['cfg']['store_id'];
+                    $insert['qualitys'] = $value['cfg']['qualitys'];
                     $inserts[] = $insert;
                 }
             }
@@ -1050,7 +1051,7 @@ class merchantControl extends SystemControl
         $inserter = function ($mod,$type,$names)
         {
             foreach ($names as $name) {
-                $data = ['name' => $name['name'],'type' => $type,'store_id' => $name['store_id']];
+                $data = ['name' => $name['name'],'type' => $type,'store_id' => $name['store_id'] , 'qualitys' => $name['qualitys']];
                 $mod->insert($data);
             }
         };
@@ -1175,6 +1176,7 @@ class merchantControl extends SystemControl
         $type = $_GET['type'] ?? $_POST['type'];
         $form = $_GET['form'] ?? $_POST['form'];
         $rkey = $this->speed_key($type , $form);
+        $quality = [ 'common' => 1 , 'fast' => 2 , 'card' => 3 , 'third' => 4 , 'slow' => 5];
         if (chksubmit())
         {
             $pids = $_POST['pid'];
@@ -1225,7 +1227,7 @@ class merchantControl extends SystemControl
                 ->field('refill_provider.*,store.store_name')
                 ->join('inner')
                 ->on('store.store_id=refill_provider.store_id')
-                ->where(['type' => $type])
+                ->where(['type' => $type , 'qualitys' => ['like', '%' . $quality[$form] . '%']])
                 ->limit(100)
                 ->order('opened asc , provider_id desc')
                 ->select();
@@ -1245,12 +1247,7 @@ class merchantControl extends SystemControl
             $ProviderManager = new \refill\ProviderManager();
             $ProviderManager->load();
             $QPTA = $ProviderManager->getQPTA();
-            if($form == 'common') {
-                $QPTA = $QPTA[1];
-            }
-            if($form == 'fast') {
-                $QPTA = $QPTA[2];
-            }
+            $QPTA = $QPTA[$quality[$form]];
 
             foreach ($providers as $key => $provider)
             {

+ 4 - 0
admin/templates/default/provider.amount.control.php

@@ -125,6 +125,10 @@
                 <li><a href="index.php?act=merchant&op=provider"><span><?php echo $lang['nc_manage'] ?></span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common" class="classA" data-type="2-common"><span>普通话费单量控制</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast" class="classA" data-type="2-fast"><span>快充话费单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=card" class="classA" data-type="1-common"><span>卡密话费单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=third" class="classA" data-type="1-fast"><span>三方话费单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow" class="classA" data-type="1-fast"><span>慢充话费单量控制</span></a></li>
+
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common" class="classA" data-type="1-common"><span>普通油卡单量控制</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast" class="classA" data-type="1-fast"><span>普通油卡单量控制</span></a></li>
             </ul>

+ 4 - 0
admin/templates/default/provider.index.php

@@ -8,6 +8,10 @@
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_manage'] ?></span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common"><span>普通话费单量控制</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast"><span>快充话费单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=card"><span>卡密话费单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=third"><span>三方话费单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow"><span>慢充话费单量控制</span></a></li>
+
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common"><span>普通油卡单量控制</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast"><span>普通油卡单量控制</span></a></li>
             </ul>

+ 78 - 30
data/config/win/refill.ini.php

@@ -16,7 +16,7 @@ $config['refill_specs'] = [
 
 //充值渠道配置表
 //速汇充京东加油通道
-$tianjt_oil = ['name' => 'tianjt', 'store_id' => 7,
+$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']],
@@ -26,7 +26,7 @@ $tianjt_oil = ['name' => 'tianjt', 'store_id' => 7,
     'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
 
 //速汇充天猫加油通道
-$suhctm_oil = ['name' => 'suhctm', 'store_id' => 7,
+$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']],
@@ -35,7 +35,7 @@ $suhctm_oil = ['name' => 'suhctm', 'store_id' => 7,
     ],
     'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
 
-$suhcpdd_oil = ['name' => 'suhcpdd', 'store_id' => 7,
+$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']],
@@ -45,7 +45,7 @@ $suhcpdd_oil = ['name' => 'suhcpdd', 'store_id' => 7,
     'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
 
 //赵梓暄提供的加油通道
-$zzx_oil = ['name' => 'zzx', 'store_id' => 13,
+$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']],
@@ -55,7 +55,7 @@ $zzx_oil = ['name' => 'zzx', 'store_id' => 13,
     'refill_type' => 'api'];
 
 //赵梓暄提供的加油通道
-$lx_oil = ['name' => 'lx', 'store_id' => 14,
+$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']] //,
@@ -64,7 +64,7 @@ $lx_oil = ['name' => 'lx', 'store_id' => 14,
     'period' => ['start' => '14:00', 'end' => '19:00'], 'official_sn' => true, 'refill_type' => 'inner_store'];
 
 //赛虎
-$saihu_oil = ['name' => 'saihu', 'store_id' => 15,
+$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']],
@@ -75,7 +75,7 @@ $saihu_oil = ['name' => 'saihu', 'store_id' => 15,
     'refill_type' => 'api'];
 
 #官方中石油通道
-$gftd_oil = ['name' => 'gftd', 'store_id' => 19,
+$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']],
@@ -85,7 +85,7 @@ $gftd_oil = ['name' => 'gftd', 'store_id' => 19,
     'period' => [], 'refill_type' => 'api'];
 
 #官方中石化通道
-$gftdsinop_oil = ['name' => 'gftdsinop', 'store_id' => 20,
+$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']],
@@ -106,7 +106,7 @@ $oil_providers = [
 ];
 $config['oil_providers'] = $oil_providers;
 
-$beixt_phone = ['name' => 'beixt', 'store_id' => 8,
+$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']],
@@ -114,7 +114,7 @@ $beixt_phone = ['name' => 'beixt', 'store_id' => 8,
     ],
     'refill_type' => 'api'];
 
-$bxtwt_phone = ['name' => 'bxtwt', 'store_id' => 10,
+$bxtwt_phone = ['name' => 'bxtwt', 'store_id' => 10, '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']],
@@ -122,7 +122,7 @@ $bxtwt_phone = ['name' => 'bxtwt', 'store_id' => 10,
     ],
     'refill_type' => 'api'];
 
-$bjb_phone = ['name' => 'bjb', 'store_id' => 12,
+$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']],
@@ -134,7 +134,7 @@ $bjb_phone = ['name' => 'bjb', 'store_id' => 12,
         500 => [['goods_id' => 6328, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
-$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,
+$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28, 'qualitys' => '1',
     'amount' => [
         10 => [['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile']],
         20 => [['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile']],
@@ -147,7 +147,7 @@ $lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzhdl_phone = ['name' => 'lingzhdl', 'store_id' => 29, 'card_type' => ['chinaunicom', 'chinatelecom'],
+$lingzhdl_phone = ['name' => 'lingzhdl', 'store_id' => 29, 'card_type' => ['chinaunicom', 'chinatelecom'], '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']],
@@ -160,7 +160,7 @@ $lingzhdl_phone = ['name' => 'lingzhdl', 'store_id' => 29, 'card_type' => ['chin
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$bjbyd_phone = ['name' => 'bjbyd', 'store_id' => 24,
+$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']],
@@ -169,7 +169,7 @@ $bjbyd_phone = ['name' => 'bjbyd', 'store_id' => 24,
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$afandnew_phone = ['name' => 'afandnew', 'store_id' => 25,
+$afandnew_phone = ['name' => 'afandnew', 'store_id' => 25, 'qualitys' => '1',
     'amount' => [
         30 => [['goods_id' => 6386, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']],
         50 => [['goods_id' => 6371, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']],
@@ -180,7 +180,7 @@ $afandnew_phone = ['name' => 'afandnew', 'store_id' => 25,
     ],
     'refill_type' => 'api'];
 
-$tianx_phone = ['name' => 'tianx', 'store_id' => 25,
+$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']],
@@ -188,7 +188,7 @@ $tianx_phone = ['name' => 'tianx', 'store_id' => 25,
     ],
     'refill_type' => 'api'];
 
-$yifa_phone = ['name' => 'yifa', 'store_id' => 16,
+$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']],
@@ -197,7 +197,7 @@ $yifa_phone = ['name' => 'yifa', 'store_id' => 16,
     ],
     'refill_type' => 'api'];
 
-$jiec_phone = ['name' => 'jiec', 'store_id' => 17,
+$jiec_phone = ['name' => 'jiec', 'store_id' => 17, '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']],
@@ -208,7 +208,7 @@ $jiec_phone = ['name' => 'jiec', 'store_id' => 17,
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$weit_phone = ['name' => 'weit', 'store_id' => 18,
+$weit_phone = ['name' => 'weit', 'store_id' => 18, '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']],
@@ -221,7 +221,7 @@ $weit_phone = ['name' => 'weit', 'store_id' => 18,
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$afand_phone = ['name' => 'afand', 'store_id' => 26,
+$afand_phone = ['name' => 'afand', 'store_id' => 26, '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']],
@@ -232,7 +232,7 @@ $afand_phone = ['name' => 'afand', 'store_id' => 26,
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$afandeng_phone = ['name' => 'afandeng', 'store_id' => 27,
+$afandeng_phone = ['name' => 'afandeng', 'store_id' => 27, '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']],
@@ -245,20 +245,68 @@ $afandeng_phone = ['name' => 'afandeng', 'store_id' => 27,
     ],
     '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],
+$tongy_phone = ['name' => 'tongy', 'store_id' => 31, 'qualitys' => '2',
+    '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']],
 
-//    ['name' => 'yifa', 'cfg' => $yifa_phone],
-//    ['name' => 'jiec', 'cfg' => $jiec_phone],
-//    ['name' => 'weit', 'cfg' => $weit_phone],
+        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']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$weiyi_phone = ['name' => 'weiyi', 'store_id' => 32, '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']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$tonglu_phone = ['name' => 'tonglu', 'store_id' => 33, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6422, 'price' => 9.4, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6423, 'price' => 18.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6424, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6425, 'price' => 47, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6426, 'price' => 94, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6427, 'price' => 188, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6428, 'price' => 282, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6429, 'price' => 470, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$phone_providers = [
     ['name' => 'afand', 'cfg' => $afand_phone],
     ['name' => 'afandeng', 'cfg' => $afandeng_phone],
     ['name' => 'afandnew', 'cfg' => $afandnew_phone],
     ['name' => 'lingzh', 'cfg' => $lingzh_phone],
-    ['name' => 'lingzhdl', 'cfg' => $lingzhdl_phone]
+    ['name' => 'lingzhdl', 'cfg' => $lingzhdl_phone],
+    ['name' => 'tongy', 'cfg' => $tongy_phone],
+    ['name' => 'weiyi', 'cfg' => $weiyi_phone],
+    ['name' => 'tonglu', 'cfg' => $tonglu_phone],
 ];
 $config['phone_providers'] = $phone_providers;

+ 18 - 0
helper/mtopcard/mtopcard.php

@@ -226,3 +226,21 @@ function oil_type($cardno)
     }
 }
 
+
+function check_phone($phone){
+    $url = 'https://mobileempty.shumaidata.com/mobileempty';
+    $params['mobile'] = $phone;
+    $headers = array();
+    array_push($headers, "Authorization:APPCODE " . '8f92d951293f4d2ea48ff86d5a70c537');
+    $resp = http_request($url,$params,'GET',false,$headers);
+    $resp = json_decode($resp , true);
+    if($resp['success'] == true && $resp['code'] == 200) {
+        Log::record("data phone:{$phone} , status : {$resp['data']['status']}" , Log::DEBUG);
+        if(in_array($resp['data']['status'] , [0,3,4,5])){
+            return false;
+        }
+    }else{
+        Log::record("data phone:{$phone} , 不支持的号段" , Log::DEBUG);
+        return true;
+    }
+};

+ 0 - 1
helper/refill/RefillBase.php

@@ -339,7 +339,6 @@ class RefillBase
                 $logic_vr_order = Logic("vr_order");
                 $order_info = Model('vr_order')->getOrderInfo(['order_id' => $order_id]);
                 $logic_vr_order->changeOrderStateCancel($order_info, '', "调用{$channel_name}接口失败");
-
                 $mod_refill->edit($order_id, ['commit_time' => time()]);
             }
         }

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

@@ -79,7 +79,7 @@ class RefillPhone extends refill\IRefillPhone
                     $order_state = ORDER_STATE_SEND;
                 }
                 if ($order_state == -1) {
-                    return [false, $resp['desc']];
+                    return [false, $resp['msg']];
                 }
                 return [true, $order_state];
             }else{

+ 3 - 0
rdispatcher/proxy.php

@@ -72,6 +72,9 @@ class proxy
                         $order_id = $order_info['order_id'];
                     }
                 }
+                else {
+                    $refill_order->edit($order_id, ['notify_time' => time(), 'notify_state' => 1]);
+                }
 
                 QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
             }

+ 75 - 5
test/TestRefill.php

@@ -325,9 +325,9 @@ class TestRefill extends TestCase
     public function testAfandengPhone()
     {
         $providers = new refill\afandeng\RefillPhone([]);
-        for ($i = 5; $i > 0; --$i) {
+//        for ($i = 5; $i > 0; --$i) {
             $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
-        }
+//        }
 //        $resp = $providers->query(['order_sn' => '20941616115610023539']);
 //        $params['usr'] = 'afandeng';
 //        $params['ord'] = '20941616115610023539';
@@ -714,6 +714,76 @@ class TestRefill extends TestCase
         return false;
     }
 
+    public function testcreateSign()
+    {
+        $params['act'] = 'refill';
+        $params['amount'] = '100';
+        $params['cardno'] = '1000111200006005872';
+        $params['mchid'] = '1092';
+        $params['notifyurl'] = 'http://202.85.213.156:8080//YeZiYKCallBackOrderServlet';
+        $params['op'] = 'balance';
+        $params['order_sn'] = 'jftest0000123';
+        $sign = $this->md5_sign($params);
+    }
+
+    public function testCheckphone()
+    {
+        $check = function($phone){
+            $url = 'https://mobileempty.shumaidata.com/mobileempty';
+            $params['mobile'] = $phone;
+            $headers = array();
+            array_push($headers, "Authorization:APPCODE " . '8f92d951293f4d2ea48ff86d5a70c537');
+            $resp = http_request($url,$params,'GET',false,$headers);
+            $resp = json_decode($resp , true);
+            if($resp['success'] == true && $resp['code'] == 200) {
+                Log::record("data phone:{$phone} , status : {$resp['data']['status']}" , Log::DEBUG);
+                if(in_array($resp['data']['status'] , [0,3,4,5])){
+                    return false;
+                }
+            }else{
+                Log::record("data phone:{$phone} , 不支持的号段" , Log::DEBUG);
+            }
+        };
+
+        $phone_data = [18257939501,
+            13972748464,
+            18804840184,
+            13502425355,
+            13556439026,
+            13886396292,
+            13423847565,
+            15027241848,
+            13720147356,
+            19847641519,
+            13566127267,
+            13566127267,
+            13566127267,
+            13566127267,
+            13725375875,
+            15802795200,
+            15908618099,
+            13597965447,
+            13667173026,
+            13409875787,
+            13517990683,
+            13972431922,
+            15902769986,
+            13796242526,
+            15245806675,
+            15846255524,
+            18333061403,
+            15931693241,
+            15146725715,
+            13945133691,
+            15046744787,
+            18745128978,
+            15711015722];
+        foreach ($phone_data as $phone) {
+//            $check($phone);
+        }
+        $check(17801048874);
+    }
+
     private function md5_sign($params)
     {
         ksort($params);
@@ -723,15 +793,15 @@ class TestRefill extends TestCase
         foreach ($params as $k => $v) {
             if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
                 if ($i == 0) {
-                    $body .= "{$k}" . "=" . urldecode($v);
+                    $body .= "{$k}" . "=" . urlencode($v);
                 } else {
-                    $body .= "&" . "{$k}" . "=" . urldecode($v);
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
                 }
                 $i++;
             }
         }
 
-        $body .= "&key=7yDCLS6S2KzSAJQOUc3vsa";
+        $body .= "&key=af7145fc9e2d8dc3d20b341c3fa582b8";
 
         return md5($body);
     }