diff --git a/web/service/sub.go b/web/service/sub.go index 9a86c3eb..bc34366f 100644 --- a/web/service/sub.go +++ b/web/service/sub.go @@ -38,7 +38,7 @@ func (s *SubService) GetSubs(subId string, host string) ([]string, string, error continue } for _, client := range clients { - if client.SubID == subId { + if client.Enable && client.SubID == subId { link := s.getLink(inbound, client.Email) result = append(result, link) clientTraffics = append(clientTraffics, s.getClientTraffics(inbound.ClientStats, client.Email)) @@ -73,7 +73,7 @@ func (s *SubService) GetSubs(subId string, host string) ([]string, string, error func (s *SubService) getInboundsBySubId(subId string) ([]*model.Inbound, error) { db := database.GetDB() var inbounds []*model.Inbound - err := db.Model(model.Inbound{}).Preload("ClientStats").Where("settings like ?", fmt.Sprintf(`%%"subId": "%s"%%`, subId)).Find(&inbounds).Error + err := db.Model(model.Inbound{}).Preload("ClientStats").Where("settings like ? and enable = ?", fmt.Sprintf(`%%"subId": "%s"%%`, subId), true).Find(&inbounds).Error if err != nil && err != gorm.ErrRecordNotFound { return nil, err }