feat(quality-owner): 增加优质号主、极品专区与无忧租号保险
- 支持保证金余额支付、在线支付开通及后台手动设置审计 - 新增极品专区发布权限、赔付方案与保险结算费率快照 - 优化首页、商品卡和个人中心的优质号主身份展示
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package listing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -57,6 +58,20 @@ func (r *Repository) syncPublishedShelf(tx *gorm.DB, listing *model.RentalListin
|
||||
return r.shelfSyncer.EnsureListingShelvedTx(tx, listing.ID, listing.AccountID)
|
||||
}
|
||||
|
||||
func (r *Repository) IsQualityOwner(ctx context.Context, userID uint64) (bool, error) {
|
||||
if r == nil || r.db == nil {
|
||||
return false, ErrDependencyUnavailable
|
||||
}
|
||||
var status string
|
||||
err := r.db.WithContext(ctx).Model(&model.User{}).
|
||||
Where("id = ?", userID).
|
||||
Pluck("quality_owner_status", &status).Error
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return status == "active", nil
|
||||
}
|
||||
|
||||
type publicZoneCountCache struct {
|
||||
Counts map[string]int64
|
||||
ExpiresAt time.Time
|
||||
|
||||
Reference in New Issue
Block a user