商城订单支付问题修复
This commit is contained in:
@@ -189,42 +189,53 @@ class ProductOrderSubmitForm extends BaseModel
|
||||
$orderInfo['businessType'] = '100007';
|
||||
$orderInfo['goodsList'] = $goods;
|
||||
|
||||
if ($productOrder->prescription->category === 2) {
|
||||
if ($productOrder->delivery_method === 0) {
|
||||
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
|
||||
'order_no' => $pay_order_no,
|
||||
'openId' => \Yii::$app->user->identity->openid,
|
||||
'orderInfo' => $orderInfo,
|
||||
// 'total_pay_price' => $productOrder['total_pay_price'], // 只支付快递费用
|
||||
'total_pay_price' => $productOrder['trans_expenses'],
|
||||
]);
|
||||
} else {
|
||||
// 无需支付
|
||||
$t = \Yii::$app->db->beginTransaction();
|
||||
try {
|
||||
$this->paid([
|
||||
'order_no' => $productOrder->order_no,
|
||||
'pay_order_no' => $paymentProductOrder->pay_order_no,
|
||||
]);
|
||||
$t->commit();
|
||||
}catch (Exception $exception){
|
||||
$t->rollback();
|
||||
throw $exception;
|
||||
}
|
||||
return [
|
||||
'is_paid' => 1,
|
||||
'order_id' => $productOrder['id'],
|
||||
'timestamp' => time(),
|
||||
'is_pay' => 1
|
||||
];
|
||||
}
|
||||
} else {
|
||||
|
||||
if ($productOrder['p_id'] !== 0 && $productOrder['order_type'] !== 2) {
|
||||
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
|
||||
'order_no' => $pay_order_no,
|
||||
'openId' => \Yii::$app->user->identity->openid,
|
||||
'orderInfo' => $orderInfo,
|
||||
'total_pay_price' => $productOrder['total_pay_price'],
|
||||
]);
|
||||
} else {
|
||||
|
||||
if ($productOrder->prescription->category === 2) {
|
||||
if ($productOrder->delivery_method === 0) {
|
||||
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
|
||||
'order_no' => $pay_order_no,
|
||||
'openId' => \Yii::$app->user->identity->openid,
|
||||
'orderInfo' => $orderInfo,
|
||||
// 'total_pay_price' => $productOrder['total_pay_price'], // 只支付快递费用
|
||||
'total_pay_price' => $productOrder['trans_expenses'],
|
||||
]);
|
||||
} else {
|
||||
// 无需支付
|
||||
$t = \Yii::$app->db->beginTransaction();
|
||||
try {
|
||||
$this->paid([
|
||||
'order_no' => $productOrder->order_no,
|
||||
'pay_order_no' => $paymentProductOrder->pay_order_no,
|
||||
]);
|
||||
$t->commit();
|
||||
}catch (Exception $exception){
|
||||
$t->rollback();
|
||||
throw $exception;
|
||||
}
|
||||
return [
|
||||
'is_paid' => 1,
|
||||
'order_id' => $productOrder['id'],
|
||||
'timestamp' => time(),
|
||||
'is_pay' => 1
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
|
||||
'order_no' => $pay_order_no,
|
||||
'openId' => \Yii::$app->user->identity->openid,
|
||||
'orderInfo' => $orderInfo,
|
||||
'total_pay_price' => $productOrder['total_pay_price'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($eplResult['returnCode']) || $eplResult['returnCode'] != '0000'){
|
||||
|
||||
Reference in New Issue
Block a user