fix(tenant): 收紧双站后台边界并补齐货架管理

This commit is contained in:
yml
2026-11-15 22:28:40 +08:00
parent a68eb815a9
commit 0cb385d84f
42 changed files with 831 additions and 97 deletions
+6 -2
View File
@@ -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 {