IRefillThird.php 985 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace refill;
  3. abstract class IRefillThird extends IRefill
  4. {
  5. public function __construct($cfgs)
  6. {
  7. parent::__construct($cfgs);
  8. }
  9. public function balance()
  10. {
  11. return [false, 'RefillPhone 暂无余额接口'];
  12. }
  13. public function goods($quality,int $amount,int $card_type,$regin_no,$other)
  14. {
  15. [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
  16. if($goods_id <= 0) return [0,0];
  17. $store_id = $this->mStoreID;
  18. $pcode = $other['product_code'];
  19. $thrid_refill = Model('thrid_refill');
  20. $product = $thrid_refill->getProviderProduct($store_id,$goods_id,$pcode);
  21. if(empty($product)) {
  22. Log::record("cannot find provider's produce where name={$this->mName}, goods_id = {$goods_id} pcode={$pcode}",Log::ERR);
  23. return [0,0];
  24. } else {
  25. return [$goods_id,ncPriceFormat($product['channel_amount'])];
  26. }
  27. }
  28. }