Browse Source

df api update refill_amount

haru haru 2 years ago
parent
commit
73d7e0c5a3

+ 8 - 1
helper/refill/api/xyz/chending_df/RefillPhone.php

@@ -37,6 +37,12 @@ class RefillPhone extends refill\IRefillThird
         return $params;
         return $params;
     }
     }
 
 
+    private function getProduct($product_code)
+    {
+        $thrid_refill = Model('thrid_refill');
+        return $thrid_refill->getProduct(['system_code' => $product_code,'opened' => 1]);
+    }
+
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
     {
         $order_sn = $params['order_sn'];
         $order_sn = $params['order_sn'];
@@ -48,7 +54,8 @@ class RefillPhone extends refill\IRefillThird
         if($province <= 0) {
         if($province <= 0) {
             return [false, '省份获取错误', false];
             return [false, '省份获取错误', false];
         }
         }
-        $params = $this->req_params($card_no, $amount, $company_type, $order_sn, $province, $card_id, $use_type, $city);
+        $product = $this->getProduct($params['product_code']);
+        $params = $this->req_params($card_no, $product['refill_amount'], $company_type, $order_sn, $province, $card_id, $use_type, $city);
         if(empty($params['itemId'])) {
         if(empty($params['itemId'])) {
             return [false, '商品编号错误', false];
             return [false, '商品编号错误', false];
         }
         }

+ 8 - 1
helper/refill/api/xyz/youhedf/RefillPhone.php

@@ -38,6 +38,12 @@ class RefillPhone extends refill\IRefillThird
         return $params;
         return $params;
     }
     }
 
 
+    private function getProduct($product_code)
+    {
+        $thrid_refill = Model('thrid_refill');
+        return $thrid_refill->getProduct(['system_code' => $product_code,'opened' => 1]);
+    }
+
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
     {
         $order_sn = $params['order_sn'];
         $order_sn = $params['order_sn'];
@@ -47,7 +53,8 @@ class RefillPhone extends refill\IRefillThird
         if($province <= 0) {
         if($province <= 0) {
             return [false, '省份获取错误', false];
             return [false, '省份获取错误', false];
         }
         }
-        $params = $this->req_params($card_no, $amount, $company_type, $order_sn, $province, $card_id);
+        $product = $this->getProduct($params['product_code']);
+        $params = $this->req_params($card_no, $product['refill_amount'], $company_type, $order_sn, $province, $card_id);
 
 
         $sign = $this->sign($params);
         $sign = $this->sign($params);
         $params['szVerifyString'] = $sign;
         $params['szVerifyString'] = $sign;

+ 8 - 1
helper/refill/api/xyz/yunchonggongdf/RefillPhone.php

@@ -37,6 +37,12 @@ class RefillPhone extends refill\IRefillThird
         return $params;
         return $params;
     }
     }
 
 
+    private function getProduct($product_code)
+    {
+        $thrid_refill = Model('thrid_refill');
+        return $thrid_refill->getProduct(['system_code' => $product_code,'opened' => 1]);
+    }
+
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
     {
         $order_sn = $params['order_sn'];
         $order_sn = $params['order_sn'];
@@ -47,7 +53,8 @@ class RefillPhone extends refill\IRefillThird
         if($province <= 0) {
         if($province <= 0) {
             return [false, '省份获取错误', false];
             return [false, '省份获取错误', false];
         }
         }
-        $params = $this->req_params($card_no, $amount, $company_type, $order_sn, $province, $card_id, $use_type);
+        $product = $this->getProduct($params['product_code']);
+        $params = $this->req_params($card_no, $product['refill_amount'], $company_type, $order_sn, $province, $card_id, $use_type);
         if(empty($params['itemId'])) {
         if(empty($params['itemId'])) {
             return [false, '商品编号错误', false];
             return [false, '商品编号错误', false];
         }
         }

+ 8 - 1
helper/refill/api/xyz/yunlingdf/RefillPhone.php

@@ -35,6 +35,12 @@ class RefillPhone extends refill\IRefillThird
         return $params;
         return $params;
     }
     }
 
 
+    private function getProduct($product_code)
+    {
+        $thrid_refill = Model('thrid_refill');
+        return $thrid_refill->getProduct(['system_code' => $product_code,'opened' => 1]);
+    }
+
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
     {
         $order_sn = $params['order_sn'];
         $order_sn = $params['order_sn'];
@@ -45,7 +51,8 @@ class RefillPhone extends refill\IRefillThird
         if($province <= 0) {
         if($province <= 0) {
             return [false, '省份获取错误', false];
             return [false, '省份获取错误', false];
         }
         }
-        $params = $this->req_params($card_no, $amount, $company_type, $order_sn, $province, $card_id, $use_type);
+        $product = $this->getProduct($params['product_code']);
+        $params = $this->req_params($card_no, $product['refill_amount'], $company_type, $order_sn, $province, $card_id, $use_type);
 
 
         if(empty($params['productid'])) {
         if(empty($params['productid'])) {
             return [false, '商品编号获取失败', false];
             return [false, '商品编号获取失败', false];