mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
Fix delete bug
This commit is contained in:
parent
025f559460
commit
738a771b87
1 changed files with 4 additions and 3 deletions
|
@ -188,7 +188,7 @@ func (s *InboundService) DelInbound(id int) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, client := range clients {
|
for _, client := range clients {
|
||||||
err := db.Where("client_email = ?", client.Email).Delete(model.InboundClientIps{}).Error
|
err := s.DelClientIPs(db, client.Email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -523,11 +523,12 @@ func (s *InboundService) UpdateClientIPs(tx *gorm.DB, oldEmail string, newEmail
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *InboundService) DelClientStat(tx *gorm.DB, email string) error {
|
func (s *InboundService) DelClientStat(tx *gorm.DB, email string) error {
|
||||||
return tx.Where("client_email = ?", email).Delete(xray.ClientTraffic{}).Error
|
return tx.Where("email = ?", email).Delete(xray.ClientTraffic{}).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *InboundService) DelClientIPs(tx *gorm.DB, email string) error {
|
func (s *InboundService) DelClientIPs(tx *gorm.DB, email string) error {
|
||||||
return tx.Where("email = ?", email).Delete(model.InboundClientIps{}).Error
|
logger.Warning(email)
|
||||||
|
return tx.Where("client_email = ?", email).Delete(model.InboundClientIps{}).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *InboundService) ResetClientTraffic(id int, clientEmail string) error {
|
func (s *InboundService) ResetClientTraffic(id int, clientEmail string) error {
|
||||||
|
|
Loading…
Reference in a new issue