Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
imoonkin committed Dec 20, 2023
1 parent cdb8cc5 commit 2b16063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ func addNote(n note) error {
}
func rangeFetch(lat1, lng1, lat2, lng2 float64) ([]note, error) {
ret := []note{}
rows, err := db.Query("select latitude,longitude,title,address,content,updateTime,visible from sharedNote where latitude between ? and ? and longitude between ? and ? limit 100", lat1, lat2, lng1, lng2)
rows, err := db.Query("select id,latitude,longitude,title,address,content,updateTime,visible from sharedNote where latitude between ? and ? and longitude between ? and ? limit 100", lat1, lat2, lng1, lng2)
if err != nil {
return ret, err
}
defer rows.Close()
for rows.Next() {
var n note
if err = rows.Scan(&n.Latitude, &n.Longitude, &n.Title, &n.Address, &n.Content, &n.UpdateTime, &n.Visible); err != nil {
if err = rows.Scan(&n.Id, &n.Latitude, &n.Longitude, &n.Title, &n.Address, &n.Content, &n.UpdateTime, &n.Visible); err != nil {
return ret, err
}
ret = append(ret, n)
Expand Down

0 comments on commit 2b16063

Please sign in to comment.