1
This commit is contained in:
parent
a1fc3c3015
commit
0a169c4ce1
@ -791,7 +791,8 @@ class PatientOrderService extends BaseService
|
|||||||
$result = array();
|
$result = array();
|
||||||
$result['amount_total'] = 0; // 订单总额
|
$result['amount_total'] = 0; // 订单总额
|
||||||
$result['payment_amount_total'] = 0; // 实际订单金额
|
$result['payment_amount_total'] = 0; // 实际订单金额
|
||||||
$result['coupon_amount_total'] = 0; // 优惠金额
|
$result['coupon_amount_total'] = 0; // 优惠卷金额
|
||||||
|
$result['discount_amount'] = 0; // 优惠金额
|
||||||
$result['order_no'] = $order_no; // 订单编号
|
$result['order_no'] = $order_no; // 订单编号
|
||||||
$result['order_id'] = ""; // 订单主键id(问诊订单:order_inquiry_id 药品订单:order_product_id)
|
$result['order_id'] = ""; // 订单主键id(问诊订单:order_inquiry_id 药品订单:order_product_id)
|
||||||
$result['created_at'] = ""; // 创建时间
|
$result['created_at'] = ""; // 创建时间
|
||||||
@ -800,6 +801,7 @@ class PatientOrderService extends BaseService
|
|||||||
$result['pay_config'] = []; // 小程序支付配置
|
$result['pay_config'] = []; // 小程序支付配置
|
||||||
$result['cannot_use_coupon_reason'] = ""; // 不可使用优惠卷原因
|
$result['cannot_use_coupon_reason'] = ""; // 不可使用优惠卷原因
|
||||||
|
|
||||||
|
|
||||||
// 问诊订单
|
// 问诊订单
|
||||||
if ($order_type == 1) {
|
if ($order_type == 1) {
|
||||||
$params = array();
|
$params = array();
|
||||||
@ -852,13 +854,13 @@ class PatientOrderService extends BaseService
|
|||||||
// 获取订单金额
|
// 获取订单金额
|
||||||
$result['amount_total'] = $order_inquiry['amount_total']; // 订单金额
|
$result['amount_total'] = $order_inquiry['amount_total']; // 订单金额
|
||||||
$result['payment_amount_total'] = $order_inquiry['payment_amount_total']; // 实际订单金额
|
$result['payment_amount_total'] = $order_inquiry['payment_amount_total']; // 实际订单金额
|
||||||
$result['coupon_amount_total'] = $order_inquiry['coupon_amount_total'];; // 优惠金额
|
$result['coupon_amount_total'] = $order_inquiry['coupon_amount_total']; // 优惠卷金额
|
||||||
|
$result['discount_amount'] = 0; // 优惠金额
|
||||||
|
|
||||||
if ($order_inquiry['payment_amount_total'] > 0) {
|
if ($order_inquiry['payment_amount_total'] > 0) {
|
||||||
// 发起支付
|
// 发起支付
|
||||||
$WechatPay = new WechatPay(1, 1);
|
$WechatPay = new WechatPay(1, 1);
|
||||||
|
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_inquiry['payment_amount_total'] * 100), $user_info['open_id'], "问诊服务");
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_inquiry['payment_amount_total'] * 100), $user_info['open_id'], "问诊服务");
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
@ -921,6 +923,7 @@ class PatientOrderService extends BaseService
|
|||||||
$result['amount_total'] = $order_product['amount_total']; // 订单金额
|
$result['amount_total'] = $order_product['amount_total']; // 订单金额
|
||||||
$result['payment_amount_total'] = $order_product['payment_amount_total']; // 实际订单金额
|
$result['payment_amount_total'] = $order_product['payment_amount_total']; // 实际订单金额
|
||||||
$result['coupon_amount_total'] = $order_product['coupon_amount_total']; // 优惠金额
|
$result['coupon_amount_total'] = $order_product['coupon_amount_total']; // 优惠金额
|
||||||
|
$result['discount_amount'] = $order_product['amount_total'] - $order_product['coupon_amount_total'] - $order_product['payment_amount_total']; // 优惠金额
|
||||||
|
|
||||||
// 获取优惠卷不可用原因。存在优惠卷,但是未使用-暂时废弃
|
// 获取优惠卷不可用原因。存在优惠卷,但是未使用-暂时废弃
|
||||||
/*if ($order_product['coupon_amount_total'] == 0){
|
/*if ($order_product['coupon_amount_total'] == 0){
|
||||||
@ -1033,6 +1036,7 @@ class PatientOrderService extends BaseService
|
|||||||
$result['amount_total'] = $order_detection['amount_total']; // 订单金额
|
$result['amount_total'] = $order_detection['amount_total']; // 订单金额
|
||||||
$result['payment_amount_total'] = $order_detection['amount_total'] - 0; // 实际订单金额
|
$result['payment_amount_total'] = $order_detection['amount_total'] - 0; // 实际订单金额
|
||||||
$result['coupon_amount_total'] = 0; // 优惠金额
|
$result['coupon_amount_total'] = 0; // 优惠金额
|
||||||
|
$result['discount_amount'] = 0;
|
||||||
|
|
||||||
if ($order_detection['payment_amount_total'] > 0) {
|
if ($order_detection['payment_amount_total'] > 0) {
|
||||||
// 发起支付
|
// 发起支付
|
||||||
@ -1047,7 +1051,6 @@ class PatientOrderService extends BaseService
|
|||||||
// 获取小程序支付配置
|
// 获取小程序支付配置
|
||||||
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 服务包订单
|
// 服务包订单
|
||||||
@ -1110,6 +1113,7 @@ class PatientOrderService extends BaseService
|
|||||||
$result['amount_total'] = $order_service_package['amount_total']; // 订单金额
|
$result['amount_total'] = $order_service_package['amount_total']; // 订单金额
|
||||||
$result['payment_amount_total'] = $order_service_package['amount_total'] - 0; // 实际订单金额
|
$result['payment_amount_total'] = $order_service_package['amount_total'] - 0; // 实际订单金额
|
||||||
$result['coupon_amount_total'] = 0; // 优惠金额
|
$result['coupon_amount_total'] = 0; // 优惠金额
|
||||||
|
$result['discount_amount'] = 0;
|
||||||
|
|
||||||
// 检测是否存在同类型未完成的问诊订单
|
// 检测是否存在同类型未完成的问诊订单
|
||||||
$PatientOrderService = new PatientOrderService();
|
$PatientOrderService = new PatientOrderService();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user