|
@@ -14,16 +14,20 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
parent::__construct($cfgs);
|
|
|
}
|
|
|
|
|
|
- public function goods($quality,int $amount,int $card_type)
|
|
|
+ public function goods($quality,int $amount,int $card_type,$other)
|
|
|
{
|
|
|
- $maps = $this->mAmountTypes[$quality] ?? [];
|
|
|
- $key = "{$amount}-{$card_type}";
|
|
|
- if(array_key_exists($key,$maps)) {
|
|
|
- $params = $maps[$key];
|
|
|
- return [$params['goods_id'], round($params['price'],2)];
|
|
|
- }
|
|
|
- else {
|
|
|
- return [];
|
|
|
+ [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$other);
|
|
|
+ if($goods_id <= 0) return [0,0];
|
|
|
+
|
|
|
+ $store_id = $this->mStoreID;
|
|
|
+ $pcode = $other['product_code'];
|
|
|
+ $thrid_refill = Model('thrid_refill');
|
|
|
+ $product = $thrid_refill->getProviderProduct($store_id,$goods_id,$pcode);
|
|
|
+ if(empty($product)) {
|
|
|
+ Log::record("cannot find provider's produce where name={$this->mName}, goods_id = {$goods_id} pcode={$pcode}",Log::ERR);
|
|
|
+ return [0,0];
|
|
|
+ } else {
|
|
|
+ return [$goods_id,ncPriceFormat($product['channel_amount'])];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -169,4 +173,5 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
$content .= $params['ProductCode'] . $params['TimesTamp'] . $params['Version'] . config::App_Secret;
|
|
|
return strtoupper(md5($content));
|
|
|
}
|
|
|
+
|
|
|
}
|