1
0

fix stupid loop event generator (1/inf)

This commit is contained in:
2021-02-10 21:18:47 +08:00
parent ba87ff481c
commit 6809faf429
3 changed files with 13 additions and 12 deletions

View File

@@ -203,7 +203,7 @@ class CalendarDatabase(object):
username = self.tokenOper_get_username(token)
self.cursor.execute('SELECT calendar.* FROM calendar INNER JOIN collection \
ON collection.ccn_uuid = calendar.ccn_belongTo \
WHERE (collection.ccn_user = ? AND calendar.ccn_loopDateTimeEnd >= ? AND calendar.ccn_loopDateTimeStart <= ?);',
WHERE (collection.ccn_user = ? AND calendar.ccn_loopDateTimeEnd >= ? AND calendar.ccn_loopDateTimeStart - (calendar.ccn_eventDateTimeEnd - calendar.ccn_eventDateTimeStart) <= ?);',
(username, startDateTime, endDateTime))
return self.cursor.fetchall()
@@ -212,7 +212,7 @@ class CalendarDatabase(object):
username = self.tokenOper_get_username(token)
self.cursor.execute('SELECT calendar.ccn_uuid FROM calendar INNER JOIN collection \
ON collection.ccn_uuid = calendar.ccn_belongTo \
WHERE (collection.ccn_user = ? AND calendar.ccn_loopDateTimeEnd >= ? AND calendar.ccn_loopDateTimeStart <= ?);',
WHERE (collection.ccn_user = ? AND calendar.ccn_loopDateTimeEnd >= ? AND calendar.ccn_loopDateTimeStart - (calendar.ccn_eventDateTimeEnd - calendar.ccn_eventDateTimeStart) <= ?);',
(username, startDateTime, endDateTime))
return tuple(map(lambda x: x[0], self.cursor.fetchall()))