Skip to content

Commit

Permalink
fix support geo query (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhiran authored Jan 13, 2025
1 parent 7f2f621 commit 5857895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/device_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (d *DB) QueryDeviceRecord(latitude, longitude string) (*DeviceRecord, error
);`

ids := []string{}
if err := d.db.Exec(fmt.Sprintf(sql, longitude, latitude)).Find(&ids).Error; err != nil {
if err := d.db.Raw(fmt.Sprintf(sql, longitude, latitude)).Scan(&ids).Error; err != nil {
return nil, errors.Wrap(err, "failed to query device record geo data")
}
if len(ids) == 0 {
Expand Down

0 comments on commit 5857895

Please sign in to comment.