fix: update order by for session and events
This commit is contained in:
@@ -628,8 +628,7 @@ export async function getEventList(options: GetEventListOptions) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.orderBy.created_at =
|
sb.orderBy.created_at = 'created_at DESC';
|
||||||
'toDate(created_at) DESC, created_at DESC, profile_id DESC, name DESC';
|
|
||||||
|
|
||||||
if (custom) {
|
if (custom) {
|
||||||
custom(sb);
|
custom(sb);
|
||||||
|
|||||||
@@ -203,9 +203,9 @@ export async function getSessionList({
|
|||||||
const cId = sqlstring.escape(cursor.id);
|
const cId = sqlstring.escape(cursor.id);
|
||||||
sb.where.cursor = `(created_at < toDateTime64(${cAt}, 3) OR (created_at = toDateTime64(${cAt}, 3) AND id < ${cId}))`;
|
sb.where.cursor = `(created_at < toDateTime64(${cAt}, 3) OR (created_at = toDateTime64(${cAt}, 3) AND id < ${cId}))`;
|
||||||
sb.where.cursorWindow = `created_at >= toDateTime64(${cAt}, 3) - INTERVAL ${dateIntervalInDays} DAY`;
|
sb.where.cursorWindow = `created_at >= toDateTime64(${cAt}, 3) - INTERVAL ${dateIntervalInDays} DAY`;
|
||||||
sb.orderBy.created_at = 'toDate(created_at) DESC, created_at DESC, id DESC';
|
sb.orderBy.created_at = 'created_at DESC';
|
||||||
} else {
|
} else {
|
||||||
sb.orderBy.created_at = 'toDate(created_at) DESC, created_at DESC, id DESC';
|
sb.orderBy.created_at = 'created_at DESC';
|
||||||
sb.where.created_at = `created_at > now() - INTERVAL ${dateIntervalInDays} DAY`;
|
sb.where.created_at = `created_at > now() - INTERVAL ${dateIntervalInDays} DAY`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user