修复 IP 地址查询失败的问题

This commit is contained in:
dushixiang committed 2026-01-17 17:19:17 +08:00
1 parent 6488c9155d
commit 87207cb159
1 file changed
+1 -1
+1 -1
View File
@@ -48,7 +48,7 @@ func (r *AgentRepo) FindOnlineAgents(ctx context.Context) ([]models.Agent, error
func (r *AgentRepo) FindByIP(ctx context.Context, ip string) (*models.Agent, error) {
var agent models.Agent
err := r.db.WithContext(ctx).
Where("ip = ? or ipv4 = ? OR ipv6 = ?", ip, ip).
Where("ip = ? or ipv4 = ? OR ipv6 = ?", ip, ip, ip).
First(&agent).Error
if err != nil {
return nil, err