perf: 搜索

main
Lei OT 10 months ago
parent af142a0809
commit f179f0e6b7

@ -5,7 +5,7 @@
"scripts": { "scripts": {
"start": "node bin/www", "start": "node bin/www",
"dev": "nodemon bin/www", "dev": "nodemon bin/www",
"prd": "pm2 start bin/www", "prd": "pm2 start",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies": { "dependencies": {

@ -66,7 +66,7 @@ class Heytrip {
const { count, rows } = await Hotelinfo.findAndCountAll({ const { count, rows } = await Hotelinfo.findAndCountAll({
// const [ rows ] = await Hotelinfo.findAll({ // const [ rows ] = await Hotelinfo.findAll({
include: [ include: [
{ model: HeytripIds, as: 'aid', attributes: ['hotel_id', 'update_flag'], where: { update_flag: { [Op.ne]: 99 } } }, { model: HeytripIds, as: 'aid', attributes: [], where: { update_flag: { [Op.ne]: 99 } } },
{ {
model: Hotelinfo2, model: Hotelinfo2,
as: 'locale_info', as: 'locale_info',
@ -314,7 +314,7 @@ class Heytrip {
if (isEmpty(rows)) { if (isEmpty(rows)) {
return { next: !isEmpty(allIds), data: allIds }; return { next: !isEmpty(allIds), data: allIds };
} }
const _BaseInfoExists = await Hotelinfo.findAll({ where: { hotel_id: allIds }, logging: false }); const _BaseInfoExists = await Hotelinfo.findAll({ where: { hotel_id: allIds }, });
const updateIds = _BaseInfoExists.map((item) => `${item.hotel_id}`); const updateIds = _BaseInfoExists.map((item) => `${item.hotel_id}`);
// console.log('updateIds', updateIds); // console.log('updateIds', updateIds);

Loading…
Cancel
Save