From 160b4e155da361bdb18b0afef5072e06c1305ec9 Mon Sep 17 00:00:00 2001 From: ypsdf1 Date: Mon, 2 Nov 2026 00:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC66=E6=89=B9-PHP=E4=BF=A1=E8=AA=89?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E4=BF=AE=E5=A4=8D=20-=20credit.php:=20Java?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=97=B6=E9=97=B4=E6=88=B3=E6=98=AF=E6=AF=AB?= =?UTF-8?q?=E7=A7=92=EF=BC=8CPHP=E7=BB=9F=E4=B8=80=E8=BD=AC=E7=A7=92?= =?UTF-8?q?=EF=BC=88/1000=EF=BC=89=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E4=B8=BA58000?= =?UTF-8?q?=E5=B9=B4=20-=20admin.php:=20=E4=BF=A1=E8=AA=89=E5=88=86?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=8EparseInt=E6=94=B9parseFloat=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B0=8F=E6=95=B0=E6=89=A3=E5=88=86=E4=B8=8E?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin.php | 6 +++--- api/credit.php | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/admin.php b/admin.php index 8cbe2a7..4ddd342 100644 --- a/admin.php +++ b/admin.php @@ -3764,10 +3764,10 @@ async function creditQueryScore() { async function doCreditAdjustScore(target, currentScore, isDeduct) { const amountStr = document.getElementById('creditAdjustAmount')?.value?.trim() || ''; if (!amountStr) { glassAlert('请输入积分变动值'); return; } - const amount = parseInt(amountStr, 10); - if (isNaN(amount) || amount === 0) { glassAlert('请输入有效的非零整数'); return; } + const amount = parseFloat(amountStr); + if (isNaN(amount) || amount === 0) { glassAlert('请输入有效的非零数值(支持小数如 0.5)'); return; } // 扣分模式强制取负 - const finalAmount = isDeduct ? Math.abs(amount) : Math.abs(amount); + const finalAmount = Math.abs(amount); const sign = isDeduct ? -1 : 1; const finalValue = sign * finalAmount; // 检查是否超出范围 diff --git a/api/credit.php b/api/credit.php index aea0cac..96d3235 100644 --- a/api/credit.php +++ b/api/credit.php @@ -487,8 +487,9 @@ switch ($action) { $content = $rec['content'] ?? ''; $status = $rec['status'] ?? 'approved'; $scoreChange = (float)($rec['score_change'] ?? 0); - $createdAt = (int)($rec['created_at'] ?? 0); - $approvedAt = (int)($rec['approved_at'] ?? 0); + // ★ 第65批修复:Java 推送毫秒时间戳,PHP 统一用秒 + $createdAt = (int)(($rec['created_at'] ?? 0) / 1000); + $approvedAt = (int)(($rec['approved_at'] ?? 0) / 1000); $reason = $rec['approve_reason'] ?? ''; $source = $rec['source'] ?? 'game';