diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index a30e2ef2..9ec02bfd 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -126,9 +126,7 @@ class CnmoocsService def get_students_data params shixun = Shixun.find_by_id params[:resouceId] return {error: -1, messages: "资源id不对,请使用资源的id查找"} if shixun.blank? - # shixun_ids = StageShixun.where(:stage_id => subject.stages).pluck(:shixun_id) - #myshixuns = Myshixun.where(:user_id => params[:userId], shixun_id: shixun_ids).includes(:games) - myshixun = shixun.myshixuns.where(:user_id => params[:userId]).includes(:games) + myshixun = shixun.myshixuns.where(:user_id => params[:userId]).includes(:games).first if myshixun.present? score = myshixun.total_score time = 0