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';