IRefillThird.php 994 B

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