dev_forum
daiao 6 years ago
parent 2dc3122645
commit c3ef1d85a4

@ -20,10 +20,9 @@ class DiscussesController < ApplicationController
@manger = @container.has_manager?(current_user)
if @manger
@discusses = disscusses.limit(LIMIT).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).offset(offset)
logger.info("------#{@discusses.to_sql}")
.select("discusses.*, games.identifier").includes(:praise_treads).offset(offset)
else
@discusses = disscusses.limit(LIMIT).includes(:user, :praise_treads).offset(offset)
@discusses = disscusses.limit(LIMIT).includes(:praise_treads).offset(offset)
end
@current_user = current_user

@ -9,8 +9,8 @@ json.shixun_id discuss.dis_id
json.hidden discuss.hidden
json.manage current_user.manager_of_shixun?(container)
json.reward discuss.reward
#json.game_url discuss.game_url(container, current_user)
json.game_url "/tasks/#{discuss.identifier}" if @manger && !children
json.game_url discuss.game_url(container, current_user)
#json.game_url "/tasks/#{discuss.identifier}" if @manger && !children
# 主贴和回复有一些不同点
if discuss.parent_id
json.can_delete discuss.can_deleted?(current_user)

Loading…
Cancel
Save