xiaoyu %!s(int64=3) %!d(string=hai) anos
pai
achega
b7630c2b75

+ 10 - 10
data/config/win/refill.ini.php

@@ -1935,16 +1935,16 @@ $xinyang_phone = ['name' => 'xinyang', 'store_id' => 105, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$guochuang_phone = ['name' => 'guochuang', 'store_id' => 104, 'qualitys' => '1',
-    'amount' => [
-        10 => [['goods_id' => 6925, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6926, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6927, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6928, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6929, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6930, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6931, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6932, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+$guochuang_phone = ['name' => 'guochuang', 'store_id' => 106, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6941, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6942, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6943, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6944, 'price' => 49.95, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6945, 'price' => 99.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6946, 'price' => 199.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6947, 'price' => 299.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6948, 'price' => 499.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 15 - 1
data/config/xyz/refill.ini.php

@@ -1935,6 +1935,19 @@ $xinyang_phone = ['name' => 'xinyang', 'store_id' => 105, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$guochuang_phone = ['name' => 'guochuang', 'store_id' => 106, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6941, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6942, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6943, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6944, 'price' => 49.95, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6945, 'price' => 99.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6946, 'price' => 199.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6947, 'price' => 299.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6948, 'price' => 499.5, '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],
@@ -2011,7 +2024,8 @@ $phone_providers = [
     ['name' => 'yunsuoyaoman', 'cfg' => $yunsuoyaoman_phone],
     ['name' => 'youhe', 'cfg' => $youhe_phone],
     ['name' => 'wenye', 'cfg' => $wenye_phone],
-    ['name' => 'xinyang', 'cfg' => $xinyang_phone]
+    ['name' => 'xinyang', 'cfg' => $xinyang_phone],
+    ['name' => 'guochuang', 'cfg' => $guochuang_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 15 - 1
data/config/xyzadm/refill.ini.php

@@ -1935,6 +1935,19 @@ $xinyang_phone = ['name' => 'xinyang', 'store_id' => 105, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$guochuang_phone = ['name' => 'guochuang', 'store_id' => 106, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6941, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6942, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6943, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6944, 'price' => 49.95, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6945, 'price' => 99.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6946, 'price' => 199.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6947, 'price' => 299.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6948, 'price' => 499.5, '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],
@@ -2011,7 +2024,8 @@ $phone_providers = [
     ['name' => 'yunsuoyaoman', 'cfg' => $yunsuoyaoman_phone],
     ['name' => 'youhe', 'cfg' => $youhe_phone],
     ['name' => 'wenye', 'cfg' => $wenye_phone],
-    ['name' => 'xinyang', 'cfg' => $xinyang_phone]
+    ['name' => 'xinyang', 'cfg' => $xinyang_phone],
+    ['name' => 'guochuang', 'cfg' => $guochuang_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 8 - 3
helper/refill/api/xyz/guochuang/RefillPhone.php

@@ -18,9 +18,14 @@ class RefillPhone extends refill\IRefillPhone
     {
         [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
         if($goods_id <= 0) return [0,0];
-
-
-
+        $key = "{$card_type}-{$amount}-{$regin_no}";
+        $price = config::Price[$key];
+        if(empty($price)) {
+            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($price)];
+        }
 
     }
 

+ 11 - 0
helper/refill/api/xyz/guochuang/config.php

@@ -58,6 +58,7 @@ class config
 
     //key格式 卡类型-面值-regin_no
     const Price = [
+        //移动
         "4-10-2" => 9.95, "4-20-2" => 19.9, "4-30-2" => 29.85, "4-50-2" => 49.75, "4-100-2" => 99.5, "4-200-2" => 199, "4-300-2" => 298.5, "4-500-2" => 497.5,//天津
         "4-10-6" => 9.71, "4-20-6" => 19.42, "4-30-6" => 29.13, "4-50-6" => 48.55, "4-100-6" => 97.1, "4-200-6" => 194.2, "4-300-6" => 291.3, "4-500-6" => 485.5,//辽宁
         "4-10-9" => 9.9, "4-20-9" => 19.8, "4-30-9" => 29.7, "4-50-9" => 49.5, "4-100-9" => 99,//上海
@@ -73,5 +74,15 @@ class config
         "4-20-22" => 20, "4-30-22" => 30, "4-50-22" => 50, "4-100-22" => 100, "4-200-22" => 200, "4-300-22" => 300, "4-500-22" => 500,//重庆
         "4-10-15" => 9.96, "4-20-15" => 19.92, "4-30-15" => 29.88, "4-50-15" => 49.8, "4-100-15" => 99.6, "4-200-15" => 199.2, "4-300-15" => 298.8, "4-500-15" => 498,//山东
         "4-10-10" => 9.96, "4-20-10" => 19.92, "4-30-10" => 29.88, "4-50-10" => 49.8, "4-100-10" => 99.6, "4-200-10" => 199.2, "4-300-10" => 298.8, "4-500-10" => 498,//江苏
+        "4-10-11" => 9.96, "4-20-11" => 19.92, "4-30-11" => 29.88, "4-50-11" => 49.8, "4-100-11" => 99.6, "4-200-11" => 199.2, "4-300-11" => 298.8, "4-500-11" => 498,//浙江
+        "4-10-17" => 9.96, "4-20-17" => 19.92, "4-30-17" => 29.88, "4-50-17" => 49.8, "4-100-17" => 99.6, "4-200-17" => 199.2, "4-300-17" => 298.8, "4-500-17" => 498,//湖北
+        "4-30-16" => 29.82, "4-50-16" => 49.7, "4-100-16" => 99.4, "4-200-16" => 198.8,//河南
+        //联通
+        "5-10-19" => 10.01, "5-20-19" => 20.02, "5-30-19" => 30.03, "5-50-19" => 50.05, "5-100-19" => 100.1, "5-200-19" => 200.2, "5-300-19" => 300.3, "5-500-19" => 500.5,//广东
+        "5-10-1" => 9.99, "5-20-1" => 19.98, "5-30-1" => 29.97, "5-50-1" => 49.95, "5-100-1" => 99.9, "5-200-1" => 199.8, "5-300-1" => 299.7, "5-500-1" => 499.5,//北京
+        "5-20-22" => 20, "5-30-22" => 30, "5-50-22" => 50, "5-100-22" => 100, "5-200-22" => 200, "5-300-22" => 300, "5-500-22" => 500,//重庆
+        //电信
+        "6-10-27" => 9.94, "6-20-27" => 19.88, "6-30-27" => 29.82, "6-50-27" => 49.7, "6-100-27" => 99.4, "6-200-27" => 198.8, "6-300-27" => 298.2, "6-500-27" => 497,//陕西
+        "6-10-4" => 9.93, "6-20-4" => 19.86, "6-30-4" => 29.79, "6-50-4" => 49.65, "6-100-4" => 99.3, "6-200-4" => 198.6, "6-300-4" => 297.9, "6-500-4" => 496.5,//山西
     ];
 }

+ 6 - 5
test/TestRefill.php

@@ -670,11 +670,12 @@ class TestRefill extends TestCase
 //        $resp = $providers->add(18074608795, 6, 10, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
 //        $resp = $providers->query(['order_sn' => '82951628231038096078']);
 //        $resp = $providers->balance();
-        $body = '{"account":"18074608795","evidence":"1000000083421080614310024563","evidenceType":"","id":"D2021080614235942044","inTime":"2021/08/06 14:26:22","money":"10","outerId":"82951628231038096078","status":"SUCCESS"}';
-        $params['ts'] = 1628231182;
-        $params['sign'] = '545F7024870B145915934CA36C6D341E';
-        $params['body'] = $body;
-        refill\RefillFactory::instance()->notify('guochuang', $params);
+//        $body = '{"account":"18074608795","evidence":"1000000083421080614310024563","evidenceType":"","id":"D2021080614235942044","inTime":"2021/08/06 14:26:22","money":"10","outerId":"82951628231038096078","status":"SUCCESS"}';
+//        $params['ts'] = 1628231182;
+//        $params['sign'] = '545F7024870B145915934CA36C6D341E';
+//        $params['body'] = $body;
+//        refill\RefillFactory::instance()->notify('guochuang', $params);
+        [$goods_id,$price] = $providers->goods(2,10,4,1,[]);
     }
 
     public function testAmingjd()