shilin2724 2016-12-23 14:36 采纳率: 0%
浏览 4940

Sequelize关联查询是左连接,我想要内连接怎么做

model:
图片说明

data:
exports.findAll = function *(query) {
let where = {};
if (query.sodHStoreId && query.sodHStoreId != '') where.sodHStoreId = query.sodHStoreId
let page = yield db.sequelize.Sod.findAndCountAll({
attributes: {exclude: ['createdAt', 'updatedAt']},
where: where,
include: [
{model: db.sequelize.Shop, as: 'hshop', attributes: ['store_id']},
{model: db.sequelize.Sct, as: 'scts', attributes: ['sctid','sctstoreuserid','sctcontents','sctcreatetime','sctstoreuserid',],
include:{model: db.sequelize.StoreUser, as: 'storeuser', attributes: ['store_user_id','store_user_name']}}
],
order: [['sodid', 'ASC']]
})
return page;
}

  • 写回答

1条回答 默认 最新

  • devmiao 2016-12-23 16:51
    关注
    评论

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败