|
@@ -37,6 +37,12 @@ class RefillPhone extends refill\IRefillThird
|
|
|
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)
|
|
|
{
|
|
|
$order_sn = $params['order_sn'];
|
|
@@ -48,7 +54,8 @@ class RefillPhone extends refill\IRefillThird
|
|
|
if($province <= 0) {
|
|
|
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'])) {
|
|
|
return [false, '商品编号错误', false];
|
|
|
}
|