fix(distribution): 统一分销订单租户管理口径
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user