feat(quality-owner): 增加优质号主、极品专区与无忧租号保险
- 支持保证金余额支付、在线支付开通及后台手动设置审计 - 新增极品专区发布权限、赔付方案与保险结算费率快照 - 优化首页、商品卡和个人中心的优质号主身份展示
This commit is contained in:
@@ -20,6 +20,10 @@ type UserDTO struct {
|
||||
RenterGrowthLevelName string `json:"renter_growth_level_name"`
|
||||
AvailableBalanceCent int64 `json:"available_balance_cent"`
|
||||
FrozenBalanceCent int64 `json:"frozen_balance_cent"`
|
||||
QualityOwnerStatus string `json:"quality_owner_status"`
|
||||
QualityOwnerDepositCent int64 `json:"quality_owner_deposit_cent"`
|
||||
QualityOwnerDepositSource string `json:"quality_owner_deposit_source"`
|
||||
QualityOwnerActivatedAt *time.Time `json:"quality_owner_activated_at"`
|
||||
Status string `json:"status"`
|
||||
OrderCount int64 `json:"order_count"`
|
||||
ListingCount int64 `json:"listing_count"`
|
||||
@@ -65,6 +69,7 @@ type ListQuery struct {
|
||||
Keyword string
|
||||
Status string
|
||||
HasDepositFreeQuota bool
|
||||
QualityOwnerOnly bool
|
||||
}
|
||||
|
||||
type PaginatedResult struct {
|
||||
|
||||
@@ -41,6 +41,7 @@ func (h *Handler) List(c *gin.Context) {
|
||||
Keyword: strings.TrimSpace(c.Query("keyword")),
|
||||
Status: strings.TrimSpace(c.Query("status")),
|
||||
HasDepositFreeQuota: parseBoolQuery(c.Query("has_deposit_free_quota")),
|
||||
QualityOwnerOnly: parseBoolQuery(c.Query("quality_owner_only")),
|
||||
}
|
||||
result, err := h.service.List(c.Request.Context(), page, pageSize, query)
|
||||
if err != nil {
|
||||
|
||||
@@ -106,6 +106,9 @@ func applyUserFilter(tx *gorm.DB, query ListQuery, growthConfig rentergrowth.Con
|
||||
tx = tx.Where("u.deposit_free_quota_cent > 0")
|
||||
}
|
||||
}
|
||||
if query.QualityOwnerOnly {
|
||||
tx = tx.Where("u.quality_owner_status = ?", "active")
|
||||
}
|
||||
if keyword := strings.TrimSpace(query.Keyword); keyword != "" {
|
||||
if len(keyword) == 11 && keyword[0] == '1' && isAllDigits(keyword) {
|
||||
// 11 位手机号:命中 users(phone) 唯一索引
|
||||
@@ -563,6 +566,10 @@ func (row userRow) toDTO(growthConfig rentergrowth.Config) UserDTO {
|
||||
RenterGrowthLevelName: level.Name,
|
||||
AvailableBalanceCent: row.AvailableBalanceCent,
|
||||
FrozenBalanceCent: row.FrozenBalanceCent,
|
||||
QualityOwnerStatus: row.QualityOwnerStatus,
|
||||
QualityOwnerDepositCent: row.QualityOwnerDepositCent,
|
||||
QualityOwnerDepositSource: row.QualityOwnerDepositSource,
|
||||
QualityOwnerActivatedAt: row.QualityOwnerActivatedAt,
|
||||
Status: row.Status,
|
||||
OrderCount: row.OrderCount,
|
||||
ListingCount: row.ListingCount,
|
||||
|
||||
Reference in New Issue
Block a user