|
@@ -87,6 +87,12 @@ class RefillPhone extends refill\IRefillThird
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private function getProduct($product_code)
|
|
|
+ {
|
|
|
+ $thrid_refill = Model('thrid_refill');
|
|
|
+ return $thrid_refill->getProduct(['system_code' => $product_code,'opened' => 1]);
|
|
|
+ }
|
|
|
+
|
|
|
private function req_params(int $phone, $supplier_origin, $product_id, string $order_sn, $sku)
|
|
|
{
|
|
|
$params['supplier_origin'] = $supplier_origin;
|
|
@@ -131,7 +137,8 @@ class RefillPhone extends refill\IRefillThird
|
|
|
if(empty($supplier_origin)) {
|
|
|
return [false, '该省份不支持', false];
|
|
|
}
|
|
|
- [$state, $product] = $this->match_product($supplier_origin, $amount);
|
|
|
+ $third_product = $this->getProduct($params['product_code']);
|
|
|
+ [$state, $product] = $this->match_product($supplier_origin, $third_product['refill_amount']);
|
|
|
if($state === false) {
|
|
|
return [false, $product, false];
|
|
|
}
|