From 725a97f62a30c53f7b2ca6ec69854b674d68e504 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 22 八月 2024 19:27:39 +0800
Subject: [PATCH] 修复楼层方向判断

---
 models/positions.go |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/models/positions.go b/models/positions.go
index b957033..a2f4a75 100644
--- a/models/positions.go
+++ b/models/positions.go
@@ -23,8 +23,8 @@
 	return db.Table(d.TableName()).Where("device_id = ? AND create_time <= ?", devId, timestamp).Order("id desc").First(&d).Error
 }
 
-func (d *Positions) FindMovePosition(id uint, pos string) error {
-	return db.Table(d.TableName()).Where("id > ? AND pos != ?", id, pos).First(&d).Error
+func (d *Positions) FindMovePosition(timestamp int64, pos string) error {
+	return db.Table(d.TableName()).Where("create_time <= ? AND pos != ?", timestamp, pos).First(&d).Error
 }
 
 func (d *Positions) FindPositionByTime(timestamp int64) error {

--
Gitblit v1.8.0