pre_develop
daiao 6 years ago
parent dce940523a
commit 257f55ec00

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

Loading…
Cancel
Save