fix(distribution): 统一分销订单租户管理口径

This commit is contained in:
yml
2026-11-24 22:12:52 +08:00
parent 3ac4052ac5
commit 3cc61615f9
20 changed files with 462 additions and 101 deletions
@@ -17,14 +17,13 @@ func (r *Repository) OrderPayments(ctx context.Context, orderID uint64) ([]Admin
}
var order struct {
BuyerTenantID uint64
SourceTenantID uint64
PaymentTenantID uint64
DistributionSiteID *uint64
BuyerTenantID uint64
SourceTenantID uint64
PaymentTenantID uint64
}
if err := r.db.WithContext(ctx).
Model(&model.RentalOrder{}).
Select("buyer_tenant_id, source_tenant_id, payment_tenant_id, distribution_site_id").
Select("buyer_tenant_id, source_tenant_id, payment_tenant_id").
Where("id = ?", orderID).
Take(&order).Error; err != nil {
if err == gorm.ErrRecordNotFound {
@@ -37,9 +36,6 @@ func (r *Repository) OrderPayments(ctx context.Context, orderID uint64) ([]Admin
if tenantID > 0 && order.BuyerTenantID != tenantID && order.SourceTenantID != tenantID {
return nil, ErrPaymentNotFound
}
if order.DistributionSiteID != nil && *order.DistributionSiteID > 0 {
return nil, ErrPaymentNotFound
}
paymentTenantID := order.PaymentTenantID
if paymentTenantID == 0 {