zhangzengfei
2024-03-29 7ff4611f4052a59c8506fb272c61831576b9c71c
修复位置查找的bug
1个文件已修改
4 ■■■■ 已修改文件
models/positions.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/positions.go
@@ -4,7 +4,7 @@
    Id         uint   `gorm:"column:id;primary_key;auto_increment;unique;not null;"`
    DeviceId   string `gorm:"column:device_id;" json:"device_id"`
    Pos        string `gorm:"column:pos" json:"pos"`
    CreateTime int64  `gorm:"column:create_time;autoCreateTime;"`
    CreateTime int64  `gorm:"column:create_time;"`
}
func (d *Positions) TableName() string {
@@ -12,5 +12,5 @@
}
func (d *Positions) FindDevicePosition(devId string, timestamp int64) error {
    return db.Table(d.TableName()).Where(&d, "device_id = ? AND create_time < ?", devId, timestamp).Order("create_time desc").First(&d).Error
    return db.Table(d.TableName()).Where("device_id = ? AND create_time < ?", devId, timestamp).Order("create_time desc").First(&d).Error
}