Merge branch 'bigchange' of 10.0.47.245:/home/trustie2 into bigchange

This commit is contained in:
nieguanghui 2014-01-13 21:32:40 +08:00
commit db60ece59f
1 changed files with 16 additions and 16 deletions

View File

@ -9,15 +9,15 @@ class StoresController < ApplicationController
# include ActsAsTaggableOn::TagsHelper # include ActsAsTaggableOn::TagsHelper
LIMIT = 20 unless const_defined?(:LIMIT) LIMIT = 20 unless const_defined?(:LIMIT)
def index def index
@projects_attach = project_classification(0).take(LIMIT) # @projects_attach = project_classification(0).take(LIMIT)
@courses_attach = project_classification(1).take(LIMIT) # @courses_attach = project_classification(1).take(LIMIT)
# @projects_attach = Attachment.includes(:projects).where("projects.project_type=?", 0). @projects_attach = Attachment.includes(:project).where("projects.project_type=?", 0).
# reorder("#{Attachment.table_name}.created_on DESC"). reorder("#{Attachment.table_name}.downloads DESC").
# limit(LIMIT) limit(LIMIT)
# @courses_attach = Attachment.includes(:projects).where("projects.project_type=?", 1). @courses_attach = Attachment.includes(:project).where("projects.project_type=?", 1).
# reorder("#{Attachment.table_name}.created_on DESC"). reorder("#{Attachment.table_name}.downloads DESC").
# limit(LIMIT) limit(LIMIT)
@homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'"). @homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'").
reorder("created_on DESC"). reorder("created_on DESC").
limit(LIMIT) limit(LIMIT)
@ -33,7 +33,7 @@ class StoresController < ApplicationController
def project_classification project_type=0 def project_classification project_type=0
pro_attach = Attachment.joins("LEFT JOIN projects ON attachments.container_id = projects.id"). pro_attach = Attachment.joins("LEFT JOIN projects ON attachments.container_id = projects.id").
where("projects.project_type=#{project_type}"). where("projects.project_type=#{project_type}").
reorder("downloads"). reorder("downloads DESC").
limit(LIMIT) limit(LIMIT)
doc_attach = join_tools_project "documents", project_type doc_attach = join_tools_project "documents", project_type
issue_attach = join_tools_project "issues", project_type issue_attach = join_tools_project "issues", project_type