fix(distribution): 统一分销订单租户管理口径
This commit is contained in:
@@ -116,19 +116,15 @@ func applyAdminDisputeTenantScope(ctx context.Context, db *gorm.DB) *gorm.DB {
|
||||
if tenantID == 0 {
|
||||
return db
|
||||
}
|
||||
return db.Where("o.buyer_tenant_id = ?", tenantID).
|
||||
Where("(o.distribution_site_id IS NULL OR o.distribution_site_id = 0)")
|
||||
return db.Where("o.buyer_tenant_id = ?", tenantID)
|
||||
}
|
||||
|
||||
func currentTenantCanAdminDisputeOrder(ctx context.Context, orderBuyerTenantID uint64, distributionSiteID *uint64) bool {
|
||||
func currentTenantCanAdminDisputeOrder(ctx context.Context, orderBuyerTenantID uint64) bool {
|
||||
tenantID := tenancy.IDFromContext(ctx)
|
||||
if tenantID == 0 {
|
||||
return true
|
||||
}
|
||||
if orderBuyerTenantID != tenantID {
|
||||
return false
|
||||
}
|
||||
return distributionSiteID == nil || *distributionSiteID == 0
|
||||
return orderBuyerTenantID == tenantID
|
||||
}
|
||||
|
||||
func (r *Repository) adminFilterQuery(ctx context.Context) *gorm.DB {
|
||||
|
||||
Reference in New Issue
Block a user