include: [
{
model: ActorImageModel,
- as: 'Banner',
+ as: 'Banners',
required: false
}
]
where
}
- return UserModel.findAndCountAll(query)
- .then(({ rows, count }) => {
- return {
- data: rows,
- total: count
- }
- })
+ return Promise.all([
+ UserModel.unscoped().count(query),
+ UserModel.findAll(query)
+ ]).then(([ total, data ]) => ({ total, data }))
}
static listWithRight (right: UserRight): Promise<MUserDefault[]> {