feat(admin): Add filter by ip and username (#172)

This commit is contained in:
lejianwen
2025-03-15 19:49:49 +08:00
parent caea60c732
commit 6ed75bc517
2 changed files with 8 additions and 0 deletions

View File

@@ -108,6 +108,12 @@ func (ct *Peer) List(c *gin.Context) {
if query.Uuids != "" {
tx.Where("uuid in (?)", query.Uuids)
}
if query.Username != "" {
tx.Where("username like ?", "%"+query.Username+"%")
}
if query.Ip != "" {
tx.Where("last_online_ip like ?", "%"+query.Ip+"%")
}
})
response.Success(c, res)
}