app.model.Article.hasMany(app.model.ArticleComment);
app.model.User.hasMany(app.model.ArticleComment);
ctx.model.Article.findById(id,{include:[{model:ctx.model.ArticleComment}]});
查出了文章和文章的评论。但我还想查出评论对应的会员信息。
ctx.model.Article.findById(id,{include:[{model:ctx.model.ArticleComment,include:[ctx.model.User]}]});
我这样查又会报user is not associated to article_comment!
但我的article_comment表明明有userId啊
一级model怎么include,子级就怎么include