diff --git a/server/services/heytripService.js b/server/services/heytripService.js index 1b07c5e..8f7fcf3 100644 --- a/server/services/heytripService.js +++ b/server/services/heytripService.js @@ -191,7 +191,7 @@ class Heytrip { if (!isEmpty(stateOffIds)) { // await HeytripIds.update({ update_flag: 99, priority: 99 }, { where: { hotel_id: stateOffIds }, logging: false, }); // console.log('updated stateOff', stateOffIds.length); - await HeytripIds.update({ update_flag: 99, priority: 99, page_index: Sequelize.literal('-page_index') }, { where: { last_modify_time: { [Op.lt]: today }, }, logging: false, }); + await HeytripIds.update({ update_flag: 99, priority: 99, page_index: Sequelize.literal('-page_index'), last_modify_time: Sequelize.fn('NOW') }, { where: { last_modify_time: { [Op.lt]: today }, }, logging: false, }); } return { nextPage: false, @@ -223,7 +223,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), update_flag: 99, }, { where: { hotel_id: oldToNext },logging: false, }); + await HeytripIds.update({ page_index: -Number(pageIndex), update_flag: 99, last_modify_time: Sequelize.fn('NOW') }, { where: { hotel_id: oldToNext },logging: false, }); } return { @@ -400,12 +400,12 @@ class Heytrip { if (!isEmpty(offInfo)) { const flag = Number(lgcObj.lgc) === 1 ? 2 : 99; // 等待获取中文数据 const priority = Number(lgcObj.lgc) === 1 ? 10 : 99; - await HeytripIds.update({ update_flag: flag, priority }, { where: { hotel_id: offInfo }, ...sequelizeOptions }); + await HeytripIds.update({ update_flag: flag, priority, last_modify_time: Sequelize.fn('NOW') }, { where: { hotel_id: offInfo }, ...sequelizeOptions }); } const updateInfo = insertData.info.filter((iitem) => existsIds.includes(`${iitem.hotel_id}`)); if (!isEmpty(updateInfo)) { - await HeytripIds.update({ update_flag: 0, priority: 0 }, { where: { hotel_id: updateInfo.map((x) => x.hotel_id) }, ...sequelizeOptions }); + await HeytripIds.update({ update_flag: 0, priority: 0, last_modify_time: Sequelize.fn('NOW') }, { where: { hotel_id: updateInfo.map((x) => x.hotel_id) }, ...sequelizeOptions }); for await (const updateRow of updateInfo) { // 有中英文的, 把名称合并, eg.上海意家人酒店Yijiaren Hotel const _BaseName = _BaseInfoExistsMapped[`${updateRow.hotel_id}`].hotel_name; @@ -439,8 +439,8 @@ class Heytrip { if (!isEmpty(insertData.reviews_summaries)) await ReviewsSummaries.bulkCreate(insertData.reviews_summaries, sequelizeOptions); if (!isEmpty(insertData.locations)) await Locations.bulkCreate(insertData.locations, sequelizeOptions); - if (!isEmpty(newInfo)) await HeytripIds.update({ update_flag: 0, priority: 0 }, { where: { hotel_id: newInfo.map((x) => x.hotel_id) }, ...sequelizeOptions }); - if (!isEmpty(updateInfo)) await HeytripIds.update({ update_flag: 0, priority: 0 }, { where: { hotel_id: updateInfo.map((x) => x.hotel_id) }, ...sequelizeOptions }); + if (!isEmpty(newInfo)) await HeytripIds.update({ update_flag: 0, priority: 0, last_modify_time: Sequelize.fn('NOW') }, { where: { hotel_id: newInfo.map((x) => x.hotel_id) }, ...sequelizeOptions }); + if (!isEmpty(updateInfo)) await HeytripIds.update({ update_flag: 0, priority: 0, last_modify_time: Sequelize.fn('NOW') }, { where: { hotel_id: updateInfo.map((x) => x.hotel_id) }, ...sequelizeOptions }); return Info; });