第66批-PHP信誉积分修复
- credit.php: Java推送时间戳是毫秒,PHP统一转秒(/1000),修复后台时间显示为58000年 - admin.php: 信誉分调整从parseInt改parseFloat,支持小数扣分与游戏一致
This commit is contained in:
@@ -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;
|
||||
// 检查是否超出范围
|
||||
|
||||
Reference in New Issue
Block a user