|
|
|
@ -2967,7 +2967,7 @@ end
|
|
|
|
|
member = course.course_members.where(:user_id => user.id, :role => member_role).first
|
|
|
|
|
# 如果已是课堂成员且是学生身份and不在指定的分班则移动到该分班
|
|
|
|
|
if member.present? && member.role == 4 && member.course_group_id != course_group.try(:id).to_i
|
|
|
|
|
member.update_column("course_group_id", course_group.try(:id).to_i)
|
|
|
|
|
member.update_attributes(course_group_id: course_group.try(:id).to_i)
|
|
|
|
|
member_count += 1
|
|
|
|
|
elsif !member.present?
|
|
|
|
|
member = CourseMember.new(:role => member_role, :user_id => user.id)
|
|
|
|
@ -2988,9 +2988,9 @@ end
|
|
|
|
|
@status = 1
|
|
|
|
|
@message = "已导入/更新#{member_count}个成员"
|
|
|
|
|
end
|
|
|
|
|
rescue
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
@status = 0
|
|
|
|
|
@message = "文件内容无法读取"
|
|
|
|
|
@message = e.message
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
@status = 0
|
|
|
|
|