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:
authorHamidreza <70919649+hamid-gh98@users.noreply.github.com>2023-07-01 15:26:43 +0300
committerGitHub <noreply@github.com>2023-07-01 15:26:43 +0300
commit10283193862e7bd36b20e6b2c41411d251961c27 (patch)
tree892d133611c08e01db4b372645d8bcf579635739 /web/service/inbound.go
parentf726474a5db3fa68eeb78729a58629382f6d2699 (diff)
🚀 Some improvements for x-ui.sh and ip job (#665)
Diffstat (limited to 'web/service/inbound.go')
-rw-r--r--web/service/inbound.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 802e753d..b278eb57 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"time"
+
"x-ui/database"
"x-ui/database/model"
"x-ui/logger"
@@ -74,7 +75,6 @@ func (s *InboundService) getAllEmails() ([]string, error) {
FROM inbounds,
JSON_EACH(JSON_EXTRACT(inbounds.settings, '$.clients')) AS client
`).Scan(&emails).Error
-
if err != nil {
return nil, err
}
@@ -816,7 +816,8 @@ func (s *InboundService) UpdateClientStat(email string, client *model.Client) er
"enable": true,
"email": client.Email,
"total": client.TotalGB,
- "expiry_time": client.ExpiryTime})
+ "expiry_time": client.ExpiryTime,
+ })
err := result.Error
if err != nil {
return err
@@ -1068,8 +1069,8 @@ func (s *InboundService) ResetClientIpLimitByEmail(clientEmail string, count int
return err
}
return nil
-
}
+
func (s *InboundService) ResetClientExpiryTimeByEmail(clientEmail string, expiry_time int64) error {
_, inbound, err := s.GetClientInboundByEmail(clientEmail)
if err != nil {
@@ -1126,7 +1127,6 @@ func (s *InboundService) ResetClientExpiryTimeByEmail(clientEmail string, expiry
return err
}
return nil
-
}
func (s *InboundService) ResetClientTrafficByEmail(clientEmail string) error {
@@ -1137,7 +1137,6 @@ func (s *InboundService) ResetClientTrafficByEmail(clientEmail string) error {
Updates(map[string]interface{}{"enable": true, "up": 0, "down": 0})
err := result.Error
-
if err != nil {
return err
}
@@ -1209,7 +1208,6 @@ func (s *InboundService) ResetAllClientTraffics(id int) error {
Updates(map[string]interface{}{"enable": true, "up": 0, "down": 0})
err := result.Error
-
if err != nil {
return err
}
@@ -1224,7 +1222,6 @@ func (s *InboundService) ResetAllTraffics() error {
Updates(map[string]interface{}{"up": 0, "down": 0})
err := result.Error
-
if err != nil {
return err
}
@@ -1411,7 +1408,6 @@ func (s *InboundService) ClearClientIps(clientEmail string) error {
Where("client_email = ?", clientEmail).
Update("ips", "")
err := result.Error
-
if err != nil {
return err
}