From f63ea194e15be4259a2e98f51adfff9e951cf924 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 16 Aug 2019 07:46:56 +0800 Subject: [PATCH] rake .. --- lib/tasks/publick_course.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/publick_course.rake b/lib/tasks/publick_course.rake index 7e6f53a91..1e663067b 100644 --- a/lib/tasks/publick_course.rake +++ b/lib/tasks/publick_course.rake @@ -6,11 +6,13 @@ desc "同步精品课数据" namespace :public_course do task :student => :environment do - + if ENV['args'] subject_id = ENV['args'].split(",").first course_id = ENV['args'].split(",").last puts "subject_id is #{subject_id}" puts "course_id is #{course_id}" + end + 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)