Top n 动态查询

2015-12-14 0 738
Top n 动态查询
def bjSectionInstance = BjSection.get(params.id)
if (!bjSectionInstance) {
    flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'bjSection.label', default: 'BjSection'), params.id])}"
    redirect(action: "list")
}
else {
  bjSectionInstance.bjSubjects.each {
    //查询效率???         n+1 ~
     it.bjArticles = BjArticle.findAllByAuditAndBjSubject('true',it, [max:10,order:'asc' ,sort: 'dateIssued'])
  }
    [bjSectionInstance: bjSectionInstance]
}

遇见资源网 groovy Top n 动态查询 http://www.ox520.com/13770.html

上一篇:

已经没有上一篇了!

下一篇:

已经没有下一篇了!

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务