| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 
 | const res = await ctx.model.Guarantee.findAll({// where,
 // where: {
 //   guarantee_num: '111',
 //   '$project.project_name$': '龙岗街道育贤小学教学楼等楼宇整治改造工程'
 // },
 where: {
 guarantee_num: '111',
 // '$project.project_name$': '龙岗街道育贤小学教学楼等楼宇整治改造工程'
 },
 limit,
 offset,
 include: [{
 model: ctx.model.Project,
 include: [{
 //展示所有嵌套
 all: true,
 //深度递归嵌套,出来嵌套内容
 // nested: true
 }],
 }],
 // 用于返回唯一不同的值
 distinct: true,
 //如果 plain 是 TRUE ,则 sequelize 将只返回结果集的第一条记录。如果是 FALSE, 则是全部记录。
 plain: false,
 // 设置为 true,即可返回源数据
 raw: false,
 order: [
 ['created_at', 'DESC']
 ]
 })
 
 |