|
@@ -28,11 +28,12 @@ class order
|
|
|
private $mIsValidate;
|
|
|
private $mFirstCommit;
|
|
|
|
|
|
+ //mCardType等于7的时候,需要这些参数
|
|
|
private $mProductCode;
|
|
|
- private $mQuantity;
|
|
|
+ private $mQuantity; //数量
|
|
|
private $mThirdPorductType;
|
|
|
private $mThirdCardType; // 三方充值账号类型
|
|
|
- private $mElecticExtes = [];
|
|
|
+ private $mThirdExtes = []; //三方扩展参数
|
|
|
|
|
|
public function __construct()
|
|
|
{
|
|
@@ -195,7 +196,8 @@ class order
|
|
|
$this->mOriginQuality = intval($params['org_quality']) ?? 0;
|
|
|
|
|
|
$card_type = intval($params['card_type']) ?? 0;
|
|
|
- if($card_type == 7) {
|
|
|
+ if($card_type == mtopcard\ThirdRefillCard)
|
|
|
+ {
|
|
|
$this->mCurQuality = $this->mOriginQuality;
|
|
|
$this->mProductCode = $params['product_code'];
|
|
|
$this->mThirdPorductType = $params['third_product_type'];
|
|
@@ -209,11 +211,15 @@ class order
|
|
|
|
|
|
if($this->mThirdPorductType == mtopcard\ThirdElectricProduct)
|
|
|
{
|
|
|
- $this->mElecticExtes['company_type'] = $params['company_type'];
|
|
|
- $this->mElecticExtes['use_type'] = $params['use_type'];
|
|
|
- $this->mElecticExtes['province'] = $params['province'];
|
|
|
- $this->mElecticExtes['city'] = $params['city'];
|
|
|
- $this->mElecticExtes['card_id'] = $params['card_id'];
|
|
|
+ $this->mThirdExtes['company_type'] = $params['company_type'];
|
|
|
+ $this->mThirdExtes['use_type'] = $params['use_type'];
|
|
|
+ $this->mThirdExtes['province'] = $params['province'];
|
|
|
+ $this->mThirdExtes['city'] = $params['city'];
|
|
|
+ $this->mThirdExtes['card_id'] = $params['card_id'];
|
|
|
+ }
|
|
|
+ elseif($this->mThirdPorductType == mtopcard\ThirdElectricProduct)
|
|
|
+ {
|
|
|
+ $this->mThirdExtes['province'] = $params['province'];
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -262,6 +268,7 @@ class order
|
|
|
|
|
|
return $params;
|
|
|
}
|
|
|
+
|
|
|
public function refill_params($order_id,$order_sn,$spec,$channel_name,$channel_amout,$mch_amount)
|
|
|
{
|
|
|
$refill_amount = $spec * $this->mQuantity;
|
|
@@ -276,6 +283,7 @@ class order
|
|
|
'card_no' => $this->mCardNo, 'quality' => $this->mCurQuality, 'org_quality' => $this->mOriginQuality];
|
|
|
return $params;
|
|
|
}
|
|
|
+
|
|
|
public function third_extparams($order_id,$order_sn)
|
|
|
{
|
|
|
$ext = ['order_id' => $order_id, 'order_sn' => $order_sn, 'product_type' => $this->mThirdPorductType,
|
|
@@ -284,13 +292,17 @@ class order
|
|
|
'add_time' => time()
|
|
|
];
|
|
|
|
|
|
- if($this->is_third() && $this->mThirdPorductType == mtopcard\ThirdElectricProduct) {
|
|
|
- $ext['company_type'] = $this->mElecticExtes['company_type'];
|
|
|
- $ext['use_type'] = $this->mElecticExtes['use_type'];
|
|
|
- $ext['province'] = $this->mElecticExtes['province'];
|
|
|
- $ext['city'] = $this->mElecticExtes['city'];
|
|
|
- $ext['card_id'] = $this->mElecticExtes['card_id'];
|
|
|
+ if($this->is_third())
|
|
|
+ {
|
|
|
+ if($this->mThirdPorductType == mtopcard\ThirdElectricProduct) {
|
|
|
+ $ext['company_type'] = $this->mThirdExtes['company_type'];
|
|
|
+ $ext['use_type'] = $this->mThirdExtes['use_type'];
|
|
|
+ $ext['province'] = $this->mThirdExtes['province'];
|
|
|
+ $ext['city'] = $this->mThirdExtes['city'];
|
|
|
+ $ext['card_id'] = $this->mThirdExtes['card_id'];
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
return $ext;
|
|
|
}
|
|
|
public function channel_params($order_id,$order_sn,$goods_id)
|
|
@@ -309,11 +321,14 @@ class order
|
|
|
$params['goods_id'] = $goods_id;
|
|
|
|
|
|
if($this->mThirdPorductType == mtopcard\ThirdElectricProduct) {
|
|
|
- $params['company_type'] = $this->mElecticExtes['company_type'];
|
|
|
- $params['use_type'] = $this->mElecticExtes['use_type'];
|
|
|
- $params['province'] = $this->mElecticExtes['province'];
|
|
|
- $params['city'] = $this->mElecticExtes['city'];
|
|
|
- $params['card_id'] = $this->mElecticExtes['card_id'];
|
|
|
+ $params['company_type'] = $this->mThirdExtes['company_type'];
|
|
|
+ $params['use_type'] = $this->mThirdExtes['use_type'];
|
|
|
+ $params['province'] = $this->mThirdExtes['province'];
|
|
|
+ $params['city'] = $this->mThirdExtes['city'];
|
|
|
+ $params['card_id'] = $this->mThirdExtes['card_id'];
|
|
|
+ }
|
|
|
+ elseif ($this->mThirdPorductType == mtopcard\ThirdSinopecECouponPoroduct) {
|
|
|
+ $params['province'] = $this->mThirdExtes['province'];
|
|
|
}
|
|
|
}
|
|
|
|