修复 IP 地址查询失败的问题
This commit is contained in:
1 parent
6488c9155d
commit
87207cb159
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user