Bladeren bron

yunchonggongfs update price 贵州941 其他省份947

xiaoyu 3 jaren geleden
bovenliggende
commit
d55b634656

+ 14 - 0
helper/refill/api/xyz/yunchonggongfs/RefillPhone.php

@@ -14,6 +14,20 @@ class RefillPhone extends refill\IRefillPhone
         parent::__construct($cfgs);
     }
 
+    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
+    {
+        [$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)];
+        }
+    }
+
     private function req_params(int $phone, int $amount, string $order_sn, $regin_no)
     {
         $params['appId'] = config::APP_ID;

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

@@ -65,4 +65,15 @@ class config
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+    //key格式 卡类型-面值-regin_no
+    const Price = [
+        "4-10-24" => 9.41, "4-20-24" => 18.82, "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2, "4-300-24" => 282.3, "4-500-24" => 470.5,//贵州 24
+        "4-10-15" => 9.47, "4-20-15" => 18.94, "4-30-15" => 28.41, "4-50-15" => 47.35, "4-100-15" => 94.7, "4-200-15" => 189.4, "4-300-15" => 284.1, "4-500-15" => 473.5,//山东 15
+        "4-10-25" => 9.47, "4-20-25" => 18.94, "4-30-25" => 28.41, "4-50-25" => 47.35, "4-100-25" => 94.7, "4-200-25" => 189.4, "4-300-25" => 284.1, "4-500-25" => 473.5,//云南 25
+        "4-10-28" => 9.47, "4-20-28" => 18.94, "4-30-28" => 28.41, "4-50-28" => 47.35, "4-100-28" => 94.7, "4-200-28" => 189.4, "4-300-28" => 284.1, "4-500-28" => 473.5,//甘肃 28
+        "4-10-4" => 9.47, "4-20-4" => 18.94, "4-30-4" => 28.41, "4-50-4" => 47.35, "4-100-4" => 94.7, "4-200-4" => 189.4, "4-300-4" => 284.1, "4-500-4" => 473.5,//山西 4
+        "4-10-10" => 9.47, "4-20-10" => 18.94, "4-30-10" => 28.41, "4-50-10" => 47.35, "4-100-10" => 94.7, "4-200-10" => 189.4, "4-300-10" => 284.1, "4-500-10" => 473.5,//江苏 10
+        "4-10-11" => 9.47, "4-20-11" => 18.94, "4-30-11" => 28.41, "4-50-11" => 47.35, "4-100-11" => 94.7, "4-200-11" => 189.4, "4-300-11" => 284.1, "4-500-11" => 473.5,//浙江 11
+        "4-10-13" => 9.47, "4-20-13" => 18.94, "4-30-13" => 28.41, "4-50-13" => 47.35, "4-100-13" => 94.7, "4-200-13" => 189.4, "4-300-13" => 284.1, "4-500-13" => 473.5,//福建 13
+    ];
 }