调整统计

main
岩仔88 13 hours ago
parent 8672a42684
commit afe9f86b3e

@ -408,8 +408,12 @@ class AppointmentController extends Controller
$alias = $matched ? $clinic_alias_map[$clinic_id] : '未匹配科室'; $alias = $matched ? $clinic_alias_map[$clinic_id] : '未匹配科室';
$price = floatval($item['价格']); $price = floatval($item['价格']);
if (isset($item['优惠方式']) && $item['优惠方式'] === '打折') { if (isset($item['优惠方式'])) {
$price = round($price * floatval($item['优惠值']), 2); if ($item['优惠方式'] === '打折') {
$price = round($price * floatval($item['优惠值']), 2);
} elseif ($item['优惠方式'] === '优惠') {
$price = round($price - floatval($item['优惠值']), 2);
}
} }
$key = $matched ? $alias : '__unmatched__'; $key = $matched ? $alias : '__unmatched__';
@ -439,10 +443,6 @@ class AppointmentController extends Controller
$categories[] = $item; $categories[] = $item;
} }
// 合计金额取分类汇总,确保合计与各项之和一致
if ($category_total > 0) {
$charge_amount = $category_total;
}
$total_amount = round($charge_amount - $refund_amount, 2); $total_amount = round($charge_amount - $refund_amount, 2);
return Yo::echo([ return Yo::echo([

Loading…
Cancel
Save