|
@@ -0,0 +1,34 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+
|
|
|
+namespace refill;
|
|
|
+
|
|
|
+abstract class IRefillThird extends IRefill
|
|
|
+{
|
|
|
+ public function __construct($cfgs)
|
|
|
+ {
|
|
|
+ parent::__construct($cfgs);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function balance()
|
|
|
+ {
|
|
|
+ return [false, 'RefillPhone 暂无余额接口'];
|
|
|
+ }
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ $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'])];
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|