修复: green_discount折扣率(折数)语义——前端/后端计算ecoAmt改为×折数/10,管理面板max=10默认值10,校验与文案全改

This commit is contained in:
ypsdf1
2026-07-08 00:18:47 +08:00
parent ac79628076
commit 28c7aa119e
5 changed files with 21 additions and 18 deletions
+2 -2
View File
@@ -329,11 +329,11 @@ function adminSaveShopConfig() {
$saved['packmoney'] = $pm;
}
// 环保单减免百分比(0=不减免;命令 setgreen 10 亦为不减免)
// 环保单折扣率(折数):10=不打折,9.9=9.9折;命令 setgreen 10 亦为不打折
$gd = getParam('green_discount');
if ($gd !== null) {
$gd = (float)$gd;
if ($gd < 0 || $gd > 9.99) error('环保单减免需介于 0 ~ 9.99 之间');
if ($gd < 0 || $gd > 10) error('环保单折扣(折数)需介于 0 ~ 10 之间');
$upsert->bindValue(':k', 'green_discount', SQLITE3_TEXT);
$upsert->bindValue(':v', number_format($gd, 2, '.', ''), SQLITE3_TEXT);
$upsert->execute();