From 1fa07b97e3b35c1ad17b149a19e9197882c4cdb6 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 8 Oct 2016 14:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E8=AF=BE=E7=A8=8B=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=BA=94=E5=8C=85=E5=90=AB=E6=89=80=E5=9C=A8=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=95=99=E5=B8=88=E5=9B=A2=E9=98=9F=E7=9A=84=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef606c0cb..27e90b356 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3578,7 +3578,9 @@ def get_group_member_names work end def course_syllabus_option user = User.current - syllabuses = user.syllabuses + syllabus_members = SyllabusMember.where("user_id = #{user.id}") + syllabus_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|mem| mem.syllabus_id}.join(',') + ")" + syllabuses = Syllabus.where("id in #{syllabus_ids}") type = [] option1 = [] option1 << "请选择课程"