修改 获取处方订单支付页详情 金额、优惠卷问题1

This commit is contained in:
wucongxing8150 2024-04-18 15:28:47 +08:00
parent 2903407977
commit 0a089aff4c
2 changed files with 15 additions and 7 deletions

View File

@ -1268,7 +1268,7 @@ class OrderServicePackageService extends BaseService
$remaining_quantity = 0; $remaining_quantity = 0;
$params = array(); $params = array();
$params['order_service_id'] = $$order_service_id; $params['order_service_id'] = $order_service_id;
$params['product_id'] = $product_id; $params['product_id'] = $product_id;
$order_service_package_product = OrderServicePackageProduct::getOne($params); $order_service_package_product = OrderServicePackageProduct::getOne($params);
if (!empty($order_service_package_product)){ if (!empty($order_service_package_product)){

View File

@ -1751,7 +1751,8 @@ class PatientOrderService extends BaseService
$order_prescription_id = $this->request->route('order_prescription_id'); $order_prescription_id = $this->request->route('order_prescription_id');
$fields = [ $fields = [
"order_prescription_id" "order_prescription_id",
"order_inquiry_id"
]; ];
$params = array(); $params = array();
@ -1840,15 +1841,26 @@ class PatientOrderService extends BaseService
// 处理商品数量 // 处理商品数量
$OrderServicePackageService = new OrderServicePackageService(); $OrderServicePackageService = new OrderServicePackageService();
$amount_total = 0;
foreach ($product_datas as &$product_data){ foreach ($product_datas as &$product_data){
// 获取服务包剩余药品数量
$remaining_quantity = $OrderServicePackageService->getOrderServiceProductRemainingQuantity($order_service_package_inquiry['order_service_id'],$product_data['product_id']); $remaining_quantity = $OrderServicePackageService->getOrderServiceProductRemainingQuantity($order_service_package_inquiry['order_service_id'],$product_data['product_id']);
// 可用数量大于处方商品数量此情况把商品数量置为0 // 可用数量大于处方商品数量此情况把商品数量置为0
if ($remaining_quantity >= $product_data['product_num']){ if ($remaining_quantity >= $product_data['product_num']){
$product_data['product_num'] = 0; $product_data['product_num'] = 0;
} }
// 此处重新计算药品总金额 // 此处重新计算药品总金额
$amount_total = bcadd($amount_total,($product_data['product_price'] * $product_data['product_num']),2); $amount_total = bcadd(
$amount_total,
bcmul(
$product_data['product_price'],
$product_data['product_num'],
2
),
2
);
} }
} }
@ -1871,16 +1883,12 @@ class PatientOrderService extends BaseService
// 实际支付金额=商品总金额-优惠卷金额+运费金额 // 实际支付金额=商品总金额-优惠卷金额+运费金额
$payment_amount_total = bcadd(bcsub($amount_total , $coupon_amount_total,2), $logistics_fee, 2); $payment_amount_total = bcadd(bcsub($amount_total , $coupon_amount_total,2), $logistics_fee, 2);
if (env("APP_ENV") == "dev") {
$payment_amount_total = 0.01;
}
// 获取收货地址 // 获取收货地址
$params = array(); $params = array();
$params['user_id'] = $user_info['user_id']; $params['user_id'] = $user_info['user_id'];
$user_ship_addresss = UserShipAddress::getList($params); $user_ship_addresss = UserShipAddress::getList($params);
unset($item);
foreach ($user_ship_addresss as $item) { foreach ($user_ship_addresss as $item) {
if ($item['is_default'] == 1) { if ($item['is_default'] == 1) {
$user_ship_address = $item; $user_ship_address = $item;