feat: 接入旧站管理端并完整迁移后台能力
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user