悲剧 下面竞赛里没文件, 作业不能让人搜

This commit is contained in:
yanxd 2014-01-16 21:05:04 +08:00
parent 6edfda3a95
commit 9d1940427f
1 changed files with 10 additions and 5 deletions

View File

@ -34,9 +34,14 @@ class StoresController < ApplicationController
# @courses_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 1, 1). # @courses_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 1, 1).
# reorder("#{Attachment.table_name}.downloads DESC"). # reorder("#{Attachment.table_name}.downloads DESC").
# limit(LIMIT) # limit(LIMIT)
@homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'"). # 悲剧 下面竞赛里没文件
reorder("downloads DESC"). # @homeworks_attach = Attachment.
limit(LIMIT) # joins("LEFT JOIN homework_attaches ON homework_attaches.id=attachments.container_id
# LEFT JOIN bids ON homework_attaches.bid_id=bids.id").
# where("container_type = 'HomeworkAttach' AND bids.reward_type <> 3").
# reorder("downloads DESC").
# limit(LIMIT)
@homeworks_attach = join_tools_project Message, 0
@memos_attach = Attachment.where("container_type = 'Memo'"). @memos_attach = Attachment.where("container_type = 'Memo'").
reorder("downloads DESC"). reorder("downloads DESC").
limit(LIMIT) limit(LIMIT)
@ -44,7 +49,7 @@ class StoresController < ApplicationController
@attach_array.push(@projects_attach, @courses_attach, @homeworks_attach, @memos_attach) @attach_array.push(@projects_attach, @courses_attach, @homeworks_attach, @memos_attach)
@str_arr = [ l(:label_project_deposit), @str_arr = [ l(:label_project_deposit),
l(:label_course_practice), l(:label_course_practice),
l(:label_contest_innovate), l(:label_borad_project), #l(:label_contest_innovate),
l(:label_forum) ] l(:label_forum) ]
end end
@ -58,7 +63,7 @@ class StoresController < ApplicationController
pro_attach = join_tools_project Project, project_type pro_attach = join_tools_project Project, project_type
doc_attach = join_tools_project Document, project_type doc_attach = join_tools_project Document, project_type
issue_attach = join_tools_project Issue, project_type issue_attach = join_tools_project Issue, project_type
mess_attach = join_tools_project Message, project_type mess_attach = []#join_tools_project Message, project_type
news_attach = join_tools_project News, project_type news_attach = join_tools_project News, project_type
vers_attach = join_tools_project Version, project_type vers_attach = join_tools_project Version, project_type
wiki_attach = join_tools_project WikiPage, project_type wiki_attach = join_tools_project WikiPage, project_type