diff --git a/admin/finance.php b/admin/finance.php index 355b80c..0e681eb 100644 --- a/admin/finance.php +++ b/admin/finance.php @@ -251,7 +251,7 @@ $requests = $stmt->fetchAll(); - + @@ -264,7 +264,9 @@ $requests = $stmt->fetchAll(); - + + 等待用户转账... + + + diff --git a/db/config.php b/db/config.php index 20a5c27..c0d1cb2 100644 --- a/db/config.php +++ b/db/config.php @@ -74,8 +74,16 @@ function ensureSchema() { // --- finance_requests table --- $stmt = $db->query("DESCRIBE finance_requests"); - $columns = $stmt->fetchAll(PDO::FETCH_COLUMN); + $columns = $stmt->fetchAll(PDO::FETCH_ASSOC); + $column_names = array_column($columns, 'Field'); + // Ensure status is VARCHAR to avoid 0 vs "0" issues + foreach ($columns as $c) { + if ($c['Field'] === 'status' && strpos(strtolower($c['Type']), 'int') !== false) { + $db->exec("ALTER TABLE finance_requests MODIFY COLUMN status VARCHAR(50) DEFAULT '0'"); + } + } + $finance_needed = [ 'account_bank' => "VARCHAR(255) DEFAULT NULL", 'account_name' => "VARCHAR(255) DEFAULT NULL", @@ -88,7 +96,7 @@ function ensureSchema() { ]; foreach ($finance_needed as $col => $type) { - if (!in_array($col, $columns)) { + if (!in_array($col, $column_names)) { $db->exec("ALTER TABLE finance_requests ADD COLUMN $col $type"); } } diff --git a/recharge.php b/recharge.php index a037479..f7a200f 100644 --- a/recharge.php +++ b/recharge.php @@ -579,7 +579,9 @@ function startStatusPolling(order_id) { function renderRechargeUI(data) { const side = document.querySelector('.info-side'); if (!side) return; - const status = String(data.status); + + // Normalize status to string + const status = String(data.status || '0'); if (status === 'completed' || status === '3') { finishTransferUI(); @@ -656,7 +658,7 @@ function renderRechargeUI(data) {
-
+
`; } else if (status === 'account_sent' || status === '2') { @@ -666,7 +668,7 @@ function renderRechargeUI(data) { side.innerHTML = `
-
匹配成功
+
账户已送达

请按照以下账户信息进行转账

@@ -706,7 +708,7 @@ function renderRechargeUI(data) {
-

请严格按照页面展示的收款账户信息进行转账。
请勿分笔转账或修改信息,转账完成后,请点击“完成转账”按钮。
转账完成后请提交转账凭证给在线客服,方便第一时间为你确认到账。

+

请严格按照页面展示的收款账户信息进行转账。
请勿分笔转账或修改信息,转账完成后,请点击“完成转账”按钮。
转账完成后请提交转账凭证给在线客服,方便第一时间为您确认到账。

`; } else if (status === 'finished') {