From 33e227dac8173af832a71e0fabd226f7e15e6ba1 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 13 Aug 2019 18:26:02 +0800 Subject: [PATCH] rake --- lib/tasks/publick_course.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/publick_course.rake b/lib/tasks/publick_course.rake index 20a9a5d3a..532e32369 100644 --- a/lib/tasks/publick_course.rake +++ b/lib/tasks/publick_course.rake @@ -12,8 +12,8 @@ namespace :public_course do puts "subject_id is #{subject_id}" puts "course_id is #{course_id}" - user_ids = Myshixun.find_by_sql("select user_id from myshixuns where shixun_id in (select shixun_id from stage_shixuns - where stage_id in (select id from stages where subject_id=#{subject_id}))").try(:user_id) + user_ids = Myshixun.find_by_sql("select distinct(user_id) from myshixuns where shixun_id in (select shixun_id from stage_shixuns + where stage_id in (select id from stages where subject_id=#{subject_id}))").map(&:user_id) puts user_ids if user_ids.present? user_ids.each do |user_id|