feat: 接入旧站管理端并完整迁移后台能力

This commit is contained in:
yml
2026-11-12 22:03:01 +08:00
parent e5f923706b
commit a4441bba9a
509 changed files with 140714 additions and 1068 deletions
+10
View File
@@ -105,6 +105,15 @@ func (r *Repository) applyAdminListFilters(db *gorm.DB, query AdminListQuery) *g
if query.ReviewStatus != "" {
db = db.Where("l.review_status = ?", query.ReviewStatus)
}
if query.CompensationPlan != "" {
db = db.Where("l.compensation_plan = ?", query.CompensationPlan)
}
switch query.Zone {
case "premium":
db = db.Where("l.is_premium = ?", true)
case "normal":
db = db.Where("l.is_premium = ?", false)
}
if query.MinCoin != nil {
db = db.Where(
"EXISTS (SELECT 1 FROM game_accounts AS coin_account WHERE coin_account.id = l.account_id AND coin_account.haf_coin_amount >= ?)",
@@ -200,6 +209,7 @@ func (r *Repository) baseQuery(ctx context.Context) *gorm.DB {
return r.db.WithContext(ctx).Table("rental_listings AS l").
Select(`l.*, a.title, a.description, a.game_name, a.server_region, a.login_platform, a.rank_level,
a.haf_coin_amount, a.asset_summary, a.screenshot_urls, COALESCE(u.phone, '') AS owner_phone, COALESCE(u.nickname, '') AS owner_nickname,
COALESCE(u.quality_owner_status = 'active', 0) AS owner_is_quality_owner,
CASE WHEN lu.id IS NULL THEN 0 ELSE 1 END AS is_external_upload,
COALESCE(src_site.site_code, '') AS distribution_site_code,
COALESCE(src_site.site_name, '') AS distribution_site_name,