项目社区首页,点击动态选项“论坛动态”报500问题

This commit is contained in:
daiao 2016-12-23 11:12:05 +08:00
parent a40b7f6fd0
commit 1f10a75150
3 changed files with 22 additions and 1 deletions

View File

@ -63,6 +63,14 @@ module UsersHelper
end
# 作业待匿评的次数
def work_anonymous_num homework
# student_work_ids = StudentWork.where(:homework_common_id => homework.id)
# total_eva_count = StudentWorksEvaluationDistribution.where(:student_work_id => student_work_ids).count
# already_eva_count = StudentWorksScore.where("SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id in #{student_work_ids} AND reviewer_role = 3 ) AS t GROUP BY user_id")
# unfinished_eva_count = total_eva_count - already_eva_count
end
def get_resource_type type
case type
when 'Course'

View File

@ -76,7 +76,7 @@
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
<%# end %>
<% when 'Message' %>
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id => user_activity.id, :is_course => 0, :is_board => 0} %>
<% when 'Project'%>
<%# cache (act) do %>
<%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>

View File

@ -0,0 +1,13 @@
class Delete15550userData < ActiveRecord::Migration
def up
error_user_activity = Message.where(:author_id => 15550)
if error_user_activity.count > 0
error_user_activity.each do |eua|
eua.delete
end
end
end
def down
end
end