From 257f55ec006bc6a1ecfecab5aacdd23d6729fde7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 28 May 2019 21:26:41 +0800 Subject: [PATCH] 1 --- app/services/cnmoocs_service.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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