|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
#coding=utf-8
|
|
|
|
|
# 执行示例 bundle exec rake public_course:student args=1,2
|
|
|
|
|
# 执行示例 bundle exec rake public_course:student args=149,2903
|
|
|
|
|
# args 第一个参数是subject_id,第二个参数是课程course_id
|
|
|
|
|
|
|
|
|
|
desc "同步精品课数据"
|
|
|
|
@ -13,7 +13,7 @@ namespace :public_course do
|
|
|
|
|
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=1))").try(:user_id)
|
|
|
|
|
where stage_id in (select id from stages where subject_id=#{subject_id}))").try(:user_id)
|
|
|
|
|
puts user_ids
|
|
|
|
|
if user_ids.present?
|
|
|
|
|
user_ids.each do |user_id|
|
|
|
|
|