fix(tenant): 收紧双站后台边界并补齐货架管理
This commit is contained in:
@@ -546,7 +546,9 @@ func applyTenantOrderScope(query *gorm.DB, ctx context.Context) *gorm.DB {
|
||||
if tenantID == 0 {
|
||||
return query
|
||||
}
|
||||
return query.Where("(o.buyer_tenant_id = ? OR o.source_tenant_id = ?)", tenantID, tenantID)
|
||||
return query.
|
||||
Where("(o.buyer_tenant_id = ? OR o.source_tenant_id = ?)", tenantID, tenantID).
|
||||
Where("(o.distribution_site_id IS NULL OR o.distribution_site_id = 0)")
|
||||
}
|
||||
|
||||
func applyBuyerTenantOrderScope(query *gorm.DB, ctx context.Context) *gorm.DB {
|
||||
@@ -554,7 +556,9 @@ func applyBuyerTenantOrderScope(query *gorm.DB, ctx context.Context) *gorm.DB {
|
||||
if tenantID == 0 {
|
||||
return query
|
||||
}
|
||||
return query.Where("o.buyer_tenant_id = ?", tenantID)
|
||||
return query.
|
||||
Where("o.buyer_tenant_id = ?", tenantID).
|
||||
Where("(o.distribution_site_id IS NULL OR o.distribution_site_id = 0)")
|
||||
}
|
||||
|
||||
func tenantOrderRole(ctx context.Context, order model.RentalOrder) string {
|
||||
|
||||
Reference in New Issue
Block a user