hcmp/dbop/georedis.go
2024-07-31 15:47:18 +08:00

32 lines
688 B
Go

package dbop
import (
"github.com/shockliu/logger"
)
const (
Location = "dqkposition"
Maintain = "maintain"
)
func GetPlace(client int) (place int) {
err := MDb.QueryRow("select location from dqk_client where id=?;", client).Scan(&place)
if err != nil {
logger.Debugf("获取设备位置错误%s\n", err)
return 0
}
return
}
// func GetDistance(place int, Lat, Long float64) float64 {
// var plat, plong float64
// err := MDb.QueryRow("select lon,lat from place_table where id=?;", place).Scan(&plong, &plat)
// if err != nil {
// logger.Debugf("获取定位%d信息失败%s\n", place, err)
// return -1
// }
// return dmap.Distance(plat, Lat, plong, Long)
// }