mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-31 07:27:13 +00:00
Add new hourly reset traffic (#3966)
* Add new hourly reset traffic * fix
This commit is contained in:
@@ -1891,6 +1891,16 @@ func (s *InboundService) ResetAllTraffics() error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *InboundService) ResetInboundTraffic(id int) error {
|
||||
db := database.GetDB()
|
||||
|
||||
result := db.Model(model.Inbound{}).
|
||||
Where("id = ?", id).
|
||||
Updates(map[string]any{"up": 0, "down": 0})
|
||||
|
||||
return result.Error
|
||||
}
|
||||
|
||||
func (s *InboundService) DelDepletedClients(id int) (err error) {
|
||||
db := database.GetDB()
|
||||
tx := db.Begin()
|
||||
|
||||
Reference in New Issue
Block a user