更新服务器信息为新的 IP 地址,调整相关文档和代码中的默认配置,确保部署和连接的一致性。同时,优化订单管理界面,增强商品信息的格式化逻辑,提升用户体验。

This commit is contained in:
乘风
2026-02-05 21:08:28 +08:00
parent 1a95aee112
commit 3ccf331e12
61 changed files with 11231 additions and 311 deletions

View File

@@ -2,7 +2,7 @@
* 用户绑定关系API
* 获取指定用户的所有绑定用户列表
*
* 优先从referral_bindings表查询,同时兼容users表的referred_by字段
* 从 referral_bindings 表查询(已弃用 users.referred_by
*/
import { NextResponse } from 'next/server'
import { query } from '@/lib/db'
@@ -59,25 +59,8 @@ export async function GET(request: Request) {
referrals = bindingsReferrals
}
} catch (e) {
console.log('[Referrals] referral_bindings表查询失败使用users表')
}
// 2. 如果referral_bindings表没有数据再从users表查询
if (referrals.length === 0 && code) {
referrals = await query(`
SELECT
id, nickname, avatar, phone, open_id,
has_full_book, purchased_sections,
created_at, updated_at,
NULL as binding_status,
NULL as binding_date,
NULL as expiry_date,
NULL as days_remaining,
NULL as commission_amount
FROM users
WHERE referred_by = ?
ORDER BY created_at DESC
`, [code]) as any[]
console.log('[Referrals] referral_bindings表查询失败:', e)
// 注意:已弃用 users.referred_by只使用 referral_bindings
}
// 统计信息