|
|
|
@ -1128,11 +1128,11 @@ class CoursesController < ApplicationController
|
|
|
|
|
return normal_status(-1, "邀请码不能为空") if params[:invite_code].blank?
|
|
|
|
|
invite_code = params[:invite_code]
|
|
|
|
|
course = Course.find_by(invite_code: invite_code, is_delete: 0, invite_code_halt: 0, laboratory_id: current_laboratory.id)
|
|
|
|
|
course_group = CourseGroup.find_by(invite_code: invite_code)
|
|
|
|
|
course_group = CourseGroup.find_by(invite_code: invite_code, invite_code_halt: 0)
|
|
|
|
|
if course.blank?
|
|
|
|
|
return normal_status(-1, "邀请码无效") if course_group.blank?
|
|
|
|
|
|
|
|
|
|
course = Course.find_by(id: course_group.course_id, is_delete: 0, invite_code_halt: 0, laboratory_id: current_laboratory.id)
|
|
|
|
|
course = Course.find_by(id: course_group.course_id, is_delete: 0, laboratory_id: current_laboratory.id)
|
|
|
|
|
return normal_status(-1, "邀请码无效") if course.blank?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|