|
@@ -7,30 +7,13 @@ require_once(BASE_HELPER_RAPI_PATH . '/xiaoniu_doubi/config.php');
|
|
use refill;
|
|
use refill;
|
|
use Log;
|
|
use Log;
|
|
|
|
|
|
-class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
+class RefillPhone extends refill\IRefillThird
|
|
{
|
|
{
|
|
public function __construct($cfgs)
|
|
public function __construct($cfgs)
|
|
{
|
|
{
|
|
parent::__construct($cfgs);
|
|
parent::__construct($cfgs);
|
|
}
|
|
}
|
|
|
|
|
|
- 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'])];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private function getProductAmount($sys_pcode)
|
|
private function getProductAmount($sys_pcode)
|
|
{
|
|
{
|
|
$thrid_refill = Model('thrid_refill');
|
|
$thrid_refill = Model('thrid_refill');
|
|
@@ -79,8 +62,8 @@ class RefillPhone extends refill\IRefillPhone
|
|
return [false, '系统错误', true];
|
|
return [false, '系统错误', true];
|
|
} elseif ($resp['code'] === '0') {
|
|
} elseif ($resp['code'] === '0') {
|
|
return [true, $resp['orderNo'], false];
|
|
return [true, $resp['orderNo'], false];
|
|
- } elseif ($resp['code'] === 'XN_1000'){
|
|
|
|
- $net_errno = 'HTTP-XN_1000';
|
|
|
|
|
|
+ } elseif ($resp['code'] === 'JB_1000'){
|
|
|
|
+ $net_errno = 'HTTP-JB_1000';
|
|
return [false, $net_errno, true];
|
|
return [false, $net_errno, true];
|
|
} else {
|
|
} else {
|
|
return [false, $resp['msg'], false];
|
|
return [false, $resp['msg'], false];
|
|
@@ -122,6 +105,10 @@ class RefillPhone extends refill\IRefillPhone
|
|
}
|
|
}
|
|
return [true, $order_state];
|
|
return [true, $order_state];
|
|
}
|
|
}
|
|
|
|
+ elseif ($resp['code'] === 'JB_0007' && (time() - $refill_info['commit_time'] >= 600))
|
|
|
|
+ {
|
|
|
|
+ return [true, ORDER_STATE_NOEXIST];
|
|
|
|
+ }
|
|
else {
|
|
else {
|
|
return [false, $resp['msg']];
|
|
return [false, $resp['msg']];
|
|
}
|
|
}
|
|
@@ -169,4 +156,4 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
return md5($content);
|
|
return md5($content);
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|