Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHo3ein <ho3ein.sanaei@gmail.com>2023-05-13 12:48:36 +0300
committerGitHub <noreply@github.com>2023-05-13 12:48:36 +0300
commit5468069befd602a7ae51deb5b76150ee16d426d6 (patch)
treea41b4492b37e52e033b2f4e027da05ce8893ae50 /web/service/sub.go
parent3bec9ee2737d0a8c49f4d705f1d8c8925bb8a2a8 (diff)
parent0cce35784eb2ab8ce42e88bdf63e0284254d2e14 (diff)
Merge pull request #420 from hamid-gh98/main
[fix] russia domains in settings and More....
Diffstat (limited to 'web/service/sub.go')
-rw-r--r--web/service/sub.go4
1 files changed, 2 insertions, 2 deletions
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
}