修正支付金额为0的情况
This commit is contained in:
parent
29965b14af
commit
fe369784f8
@ -145,7 +145,7 @@ class OrderPrescriptionService extends BaseService
|
|||||||
$user_entity_id = "491925054435950592";
|
$user_entity_id = "491925054435950592";
|
||||||
} else{
|
} else{
|
||||||
$user_pharmacist_info = UserPharmacistInfo::getOne($params);
|
$user_pharmacist_info = UserPharmacistInfo::getOne($params);
|
||||||
if (!empty($user_pharmacist_info)){
|
if (empty($user_pharmacist_info)){
|
||||||
throw new BusinessException("用户数据错误");
|
throw new BusinessException("用户数据错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -659,17 +659,22 @@ class PatientOrderService extends BaseService
|
|||||||
$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'];; // 优惠金额
|
||||||
|
|
||||||
// 发起支付
|
if ($order_inquiry['payment_amount_total'] > 0){
|
||||||
$WechatPay = new WechatPay(1,1);
|
// 发起支付
|
||||||
|
$WechatPay = new WechatPay(1,1);
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, $order_inquiry['payment_amount_total'] * 100, $user_info['open_id']);
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, $order_inquiry['payment_amount_total'] * 100, $user_info['open_id']);
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序支付配置
|
||||||
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取小程序支付配置
|
|
||||||
$result['pay_config'] = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
|
||||||
} elseif ($order_type == 2) {
|
} elseif ($order_type == 2) {
|
||||||
// 药品订单
|
// 药品订单
|
||||||
$params = array();
|
$params = array();
|
||||||
@ -704,21 +709,26 @@ class PatientOrderService extends BaseService
|
|||||||
$result['payment_amount_total'] = $order_product['payment_amount_total']; // 实际订单金额
|
$result['payment_amount_total'] = $order_product['payment_amount_total']; // 实际订单金额
|
||||||
$result['coupon_amount_total'] = 0; // 优惠金额
|
$result['coupon_amount_total'] = 0; // 优惠金额
|
||||||
|
|
||||||
// 发起支付
|
if ($order_product['payment_amount_total'] > 0 ){
|
||||||
$WechatPay = new WechatPay(1,2);
|
// 发起支付
|
||||||
|
$WechatPay = new WechatPay(1,2);
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, $order_product['payment_amount_total'] * 100, $user_info['open_id']);
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, $order_product['payment_amount_total'] * 100, $user_info['open_id']);
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序支付配置
|
||||||
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取小程序支付配置
|
|
||||||
$result['pay_config'] = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
|
||||||
} else {
|
} else {
|
||||||
return fail();
|
return fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result['pay_config'] = $pay_config ?? [];
|
||||||
|
|
||||||
return success($result);
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1078,6 +1078,7 @@ class UserDoctorService extends BaseService
|
|||||||
OrderPrescriptionProduct::deleteOrderPrescriptionProduct($params);
|
OrderPrescriptionProduct::deleteOrderPrescriptionProduct($params);
|
||||||
|
|
||||||
// 处方商品数据
|
// 处方商品数据
|
||||||
|
$product_name = "";
|
||||||
foreach ($prescription_product as $item) {
|
foreach ($prescription_product as $item) {
|
||||||
// 获取商品数据
|
// 获取商品数据
|
||||||
$params = array();
|
$params = array();
|
||||||
@ -1121,6 +1122,7 @@ class UserDoctorService extends BaseService
|
|||||||
return fail();
|
return fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$product_name = $product_name . ";" . $product['product_name'];
|
||||||
unset($product);
|
unset($product);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1160,7 +1162,7 @@ class UserDoctorService extends BaseService
|
|||||||
$message_content_data['desc'] = "";
|
$message_content_data['desc'] = "";
|
||||||
$message_content_data['data']['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id'];
|
$message_content_data['data']['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id'];
|
||||||
$message_content_data['data']['order_prescription_id'] = (string)$order_prescription['order_prescription_id'];
|
$message_content_data['data']['order_prescription_id'] = (string)$order_prescription['order_prescription_id'];
|
||||||
$message_content_data['data']['product_name'] = $product_name ?? "药品";
|
$message_content_data['data']['product_name'] = $product_name ?: "药品";
|
||||||
$message_content_data['data']['pharmacist_verify_time'] = date('Y-m-d H:i:s',time());;
|
$message_content_data['data']['pharmacist_verify_time'] = date('Y-m-d H:i:s',time());;
|
||||||
$message_content = [
|
$message_content = [
|
||||||
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
|
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
|
||||||
@ -1300,6 +1302,7 @@ class UserDoctorService extends BaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 商品数据
|
// 商品数据
|
||||||
|
$product_name = "";
|
||||||
foreach ($prescription_product as $item) {
|
foreach ($prescription_product as $item) {
|
||||||
// 获取商品数据
|
// 获取商品数据
|
||||||
$params =array();
|
$params =array();
|
||||||
@ -1350,6 +1353,7 @@ class UserDoctorService extends BaseService
|
|||||||
return fail();
|
return fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$product_name = $product_name . ";" . $product['product_name'];
|
||||||
unset($product);
|
unset($product);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1390,7 +1394,7 @@ class UserDoctorService extends BaseService
|
|||||||
$message_content_data['desc'] = "";
|
$message_content_data['desc'] = "";
|
||||||
$message_content_data['data']['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id'];
|
$message_content_data['data']['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id'];
|
||||||
$message_content_data['data']['order_prescription_id'] = (string)$order_prescription['order_prescription_id'];
|
$message_content_data['data']['order_prescription_id'] = (string)$order_prescription['order_prescription_id'];
|
||||||
$message_content_data['data']['product_name'] = $product_name ?? "药品";
|
$message_content_data['data']['product_name'] = $product_name ?: "药品";
|
||||||
$message_content_data['data']['pharmacist_verify_time'] = date('Y-m-d H:i:s',time());;
|
$message_content_data['data']['pharmacist_verify_time'] = date('Y-m-d H:i:s',time());;
|
||||||
$message_content = [
|
$message_content = [
|
||||||
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
|
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user