EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/

Promise.all map



const arr = {};

await Promise.all(
  UsersQuery.map(async function (data) {
    const city = await db.sequelize.query(`
      select * from city
    `, 
      type: db.sequelize.QueryTypes.SELECT 
    });

    arr[data.user_id] = city[0].name;

  })
}


UsersQuery.forEach(async function (data, index) {
  this[index].name = arr[data.user_id];
}, UsersQuery);