第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) {
|
async function doCreditAdjustScore(target, currentScore, isDeduct) {
|
||||||
const amountStr = document.getElementById('creditAdjustAmount')?.value?.trim() || '';
|
const amountStr = document.getElementById('creditAdjustAmount')?.value?.trim() || '';
|
||||||
if (!amountStr) { glassAlert('请输入积分变动值'); return; }
|
if (!amountStr) { glassAlert('请输入积分变动值'); return; }
|
||||||
const amount = parseInt(amountStr, 10);
|
const amount = parseFloat(amountStr);
|
||||||
if (isNaN(amount) || amount === 0) { glassAlert('请输入有效的非零整数'); return; }
|
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 sign = isDeduct ? -1 : 1;
|
||||||
const finalValue = sign * finalAmount;
|
const finalValue = sign * finalAmount;
|
||||||
// 检查是否超出范围
|
// 检查是否超出范围
|
||||||
|
|||||||
+3
-2
@@ -487,8 +487,9 @@ switch ($action) {
|
|||||||
$content = $rec['content'] ?? '';
|
$content = $rec['content'] ?? '';
|
||||||
$status = $rec['status'] ?? 'approved';
|
$status = $rec['status'] ?? 'approved';
|
||||||
$scoreChange = (float)($rec['score_change'] ?? 0);
|
$scoreChange = (float)($rec['score_change'] ?? 0);
|
||||||
$createdAt = (int)($rec['created_at'] ?? 0);
|
// ★ 第65批修复:Java 推送毫秒时间戳,PHP 统一用秒
|
||||||
$approvedAt = (int)($rec['approved_at'] ?? 0);
|
$createdAt = (int)(($rec['created_at'] ?? 0) / 1000);
|
||||||
|
$approvedAt = (int)(($rec['approved_at'] ?? 0) / 1000);
|
||||||
$reason = $rec['approve_reason'] ?? '';
|
$reason = $rec['approve_reason'] ?? '';
|
||||||
$source = $rec['source'] ?? 'game';
|
$source = $rec['source'] ?? 'game';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user