第58批续24: PHP端信誉积分(credit_score)接收+管理界面

1. core.php: users表加 credit_score 列 INTEGER DEFAULT 100
2. api/sync.php: syncLogin INSERT加credit_score字段,bindValue默认100
3. api/credit.php(新): 信誉积分API
   - ensureCreditTables建credit_records/credit_rules表+users加列
   - 用户端: submit_good/submit_bad上报, my_score/user_score查积分, my_records查记录
   - 管理员: pending_list/approve/reject/approved_list审批流程, rules/update_rule规则管理
   - approve审批通过更新users.credit_score
4. player.php: 侧边栏加⭐信誉积分入口+renderCredit页面+creditSubmitFlow上报引导
This commit is contained in:
ypsdf1
2026-10-28 14:29:20 +08:00
parent dfd3a6fd92
commit 0bf1cd8248
4 changed files with 332 additions and 1 deletions
+2 -1
View File
@@ -1848,7 +1848,7 @@ function syncLogin() {
if ($registerTime > 1000000000000) { $registerTime = intval($registerTime / 1000); }
if ($lastLoginTime > 1000000000000) { $lastLoginTime = intval($lastLoginTime / 1000); }
$stmt = $db->prepare("INSERT OR REPLACE INTO users (player_name, register_time, last_login_time, email, points, gift_stage, total_online_time) VALUES (:name, :rt, :lt, :email, :pts, :gs, :tot)");
$stmt = $db->prepare("INSERT OR REPLACE INTO users (player_name, register_time, last_login_time, email, points, gift_stage, total_online_time, credit_score) VALUES (:name, :rt, :lt, :email, :pts, :gs, :tot, :cs)");
$stmt->bindValue(':name', $name, SQLITE3_TEXT);
$stmt->bindValue(':rt', $registerTime, SQLITE3_INTEGER);
$stmt->bindValue(':lt', $lastLoginTime, SQLITE3_INTEGER);
@@ -1856,6 +1856,7 @@ function syncLogin() {
$stmt->bindValue(':pts', (int)($user['points'] ?? 0), SQLITE3_INTEGER);
$stmt->bindValue(':gs', (int)($user['gift_stage'] ?? 0), SQLITE3_INTEGER);
$stmt->bindValue(':tot', (int)($user['total_online_time'] ?? 0), SQLITE3_INTEGER);
$stmt->bindValue(':cs', (int)($user['credit_score'] ?? 100), SQLITE3_INTEGER);
$stmt->execute();
$count++;
}