这是我的代码示例,我想让用户竞标一份工作,并希望其信息与用户信息一起获得每个用户的技能计数
models.job_biding.findAll({
attributes: ['id', 'description', 'bidAmount', 'createdAt'],
include: [
{
model: models.app_user,
attributes: ['id', [models.sequelize.fn('COUNT', models.sequelize.col('skills.id')), 'matchingSkills']],
include: [{
attributes: [],
model: models.skill,
required: false,
as: 'skills',
through: {
model: models.user_skill,
attributes: []
}
}],
group: ['app_user.id']
}]