|
|
|
@ -11,9 +11,9 @@ class DiscussesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
# 总数,分页使用
|
|
|
|
|
if @manger
|
|
|
|
|
@disscuss_count = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s, :root_id => nil).count
|
|
|
|
|
disscusses = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s,
|
|
|
|
|
:root_id => nil)
|
|
|
|
|
@disscuss_count = disscusses.count
|
|
|
|
|
@discusses = disscusses.joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id")
|
|
|
|
|
.select("discusses.*, games.identifier").includes(:user, :praise_treads).limit(LIMIT).offset(offset)
|
|
|
|
|
else
|
|
|
|
|