调整当日在线时长取值为今天之前最后一次开机时长

This commit is contained in:
mgw
2025-04-25 10:13:42 +08:00
parent e3e5fcc378
commit bdef852b98

View File

@@ -1327,8 +1327,8 @@ class Sf_Dashboard_Connect(http.Controller):
cur.execute("""
SELECT * FROM device_data
WHERE device_name = %s
AND device_state in ('待机', '警告', '运行中') AND time >= %s AND process_time IS NOT NULL
ORDER BY time ASC
AND device_state in ('待机', '警告', '运行中') AND time <= %s AND process_time IS NOT NULL
ORDER BY time DESC
LIMIT 1;
""", (item, time_threshold))
last_24_time = fetch_result_as_dict(cur)