commit
						5ba7fcc061
					
				| @ -0,0 +1,21 @@ | ||||
| 
 | ||||
| json.members @members do |member| | ||||
|   json.partial! 'subject_member', locals: { user: member.user } | ||||
|   json.role member.role | ||||
| end | ||||
| 
 | ||||
| # 技能标签 | ||||
| json.tags @tags do |tag| | ||||
|   unless tag.blank? | ||||
|     json.tag_name tag | ||||
|     json.status @user_tags.include?(tag) | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| # 我的进展 | ||||
| json.progress do | ||||
|   json.my_score @subject.my_subject_score | ||||
|   json.all_score @subject.all_score | ||||
|   json.learned @subject.my_subject_progress | ||||
|   json.time  @subject.my_consume_time | ||||
| end | ||||
| @ -0,0 +1,19 @@ | ||||
| desc "开放课程开课前通知报名用户" | ||||
| namespace :public_course_notice do | ||||
|   task :tiding => :environment do | ||||
|     Course.where(excellent: 1).where("start_date is not null and start_date = '#{Date.today}'").each do |course| | ||||
|       attrs = %i[user_id trigger_user_id status container_id container_type belong_container_id | ||||
|               belong_container_type tiding_type created_at updated_at] | ||||
| 
 | ||||
|       same_attrs = { | ||||
|         trigger_user_id: 0, container_id: course.id, container_type: 'PublicCourseStart', | ||||
|         belong_container_id: course.id, belong_container_type: 'Course', tiding_type: 'System', status: 0 | ||||
|       } | ||||
|       Tiding.bulk_insert(*attrs) do |worker| | ||||
|         course.students.each do |student| | ||||
|           worker.add same_attrs.merge(user_id: student.user_id) | ||||
|         end | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
					Loading…
					
					
				
		Reference in new issue