From 83617f8475ee36f2b7a2f1a60aef40be461c995d Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 5 Jul 2016 16:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=B5=84=E6=BA=90--=E3=80=8B?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E4=B8=8B=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=B7=B2=E5=88=A0=E9=99=A4=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1fbee6fbb..f96056457 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2767,8 +2767,8 @@ class UsersController < ApplicationController # 获取我的课程资源 def get_course_resources author_id, user_course_ids, order, score - attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+ - "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) + attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and container_type = 'Course')"+ + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}") end