|
|
|
@ -160,14 +160,15 @@ class Heytrip {
|
|
|
|
|
const today = new Date();
|
|
|
|
|
today.setHours(0, 0, 0, 0); // set the time to 00:00:00.000
|
|
|
|
|
|
|
|
|
|
let lastPageIndex; let pageIndex;
|
|
|
|
|
lastPageIndex = await this.getFirstPageIndex({ last_modify_time: { [Op.lt]: today }, page_index: { [Op.lt]: 9999 } });
|
|
|
|
|
pageIndex = lastPageIndex;
|
|
|
|
|
let lastPageIndex;
|
|
|
|
|
let pageIndex;
|
|
|
|
|
// lastPageIndex = await this.getFirstPageIndex({ last_modify_time: { [Op.lt]: today }, page_index: { [Op.lt]: 9999 } });
|
|
|
|
|
// pageIndex = lastPageIndex;
|
|
|
|
|
if (isEmpty(lastPageIndex)) {
|
|
|
|
|
lastPageIndex = await this.getLastPageIndex({ last_modify_time: { [Op.gt]: today }, page_index: { [Op.lt]: 9999 } });
|
|
|
|
|
lastPageIndex = await this.getLastPageIndex({ last_modify_time: { [Op.gt]: today }, page_index: { [Op.gt]: 0 } });
|
|
|
|
|
// console.log('syncAidState', 'lastPageIndex', lastPageIndex);
|
|
|
|
|
|
|
|
|
|
pageIndex = lastPageIndex + 1;
|
|
|
|
|
pageIndex = (lastPageIndex || 0) + 1;
|
|
|
|
|
}
|
|
|
|
|
console.log('syncAidState', lastPageIndex, pageIndex);
|
|
|
|
|
|
|
|
|
@ -180,7 +181,7 @@ class Heytrip {
|
|
|
|
|
raw: true, logging: false,
|
|
|
|
|
where: {
|
|
|
|
|
update_flag: 99,
|
|
|
|
|
page_index: { [Op.gt]: 9999 },
|
|
|
|
|
page_index: { [Op.lt]: 0 },
|
|
|
|
|
last_modify_time: { [Op.gt]: today },
|
|
|
|
|
},
|
|
|
|
|
attributes: ['hotel_id'],
|
|
|
|
@ -220,7 +221,7 @@ class Heytrip {
|
|
|
|
|
// 页码滚动
|
|
|
|
|
const oldToNext = savedPageIds.filter((item) => !validIds.includes((item.hotel_id))).map((item) => item.hotel_id);
|
|
|
|
|
if (!isEmpty(oldToNext)) {
|
|
|
|
|
await HeytripIds.update({ page_index: Number(pageIndex)+9999, update_flag: 99 }, { where: { hotel_id: oldToNext },logging: false, });
|
|
|
|
|
await HeytripIds.update({ page_index: -Number(pageIndex), update_flag: 99 }, { where: { hotel_id: oldToNext },logging: false, });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|