Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
591685c296
@ -0,0 +1,12 @@
|
||||
$(document).on('turbolinks:load', function(){
|
||||
$(document).on('click', '.batch-all-check-box', function(){
|
||||
var $checkAll = $(this);
|
||||
|
||||
$('.batch-check-box').prop('checked', $checkAll.is(':checked'));
|
||||
})
|
||||
|
||||
$(document).on('click', '.batch-check-box', function(){
|
||||
var allChecked = $('.batch-check-box:checked').length === $('.batch-check-box').length
|
||||
$('.batch-all-check-box').prop('checked', allChecked);
|
||||
})
|
||||
});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
class SubjectAppointment < ApplicationRecord
|
||||
belongs_to :subject
|
||||
belongs_to :user
|
||||
end
|
@ -0,0 +1,26 @@
|
||||
class Admins::IdentityAuths::RevokeApplyService < ApplicationService
|
||||
attr_reader :apply, :user
|
||||
|
||||
def initialize(apply)
|
||||
@apply = apply
|
||||
@user = apply.user
|
||||
end
|
||||
|
||||
def call
|
||||
ActiveRecord::Base.transaction do
|
||||
apply.revoke!
|
||||
user.update!(authentication: false)
|
||||
|
||||
deal_tiding!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def deal_tiding!
|
||||
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||
container_id: apply.id, container_type: 'CancelUserAuthentication',
|
||||
belong_container_id: apply.user_id, belong_container_type: 'User',
|
||||
status: 1, tiding_type: 'System')
|
||||
end
|
||||
end
|
@ -0,0 +1,26 @@
|
||||
class Admins::ProfessionalAuths::RevokeApplyService < ApplicationService
|
||||
attr_reader :apply, :user
|
||||
|
||||
def initialize(apply)
|
||||
@apply = apply
|
||||
@user = apply.user
|
||||
end
|
||||
|
||||
def call
|
||||
ActiveRecord::Base.transaction do
|
||||
apply.revoke!
|
||||
user.update!(professional_certification: false)
|
||||
|
||||
deal_tiding!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def deal_tiding!
|
||||
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||
container_id: apply.id, container_type: 'CancelUserProCertification',
|
||||
belong_container_id: apply.user_id, belong_container_type: 'User',
|
||||
status: 1, tiding_type: 'System')
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
class AddCourseMemberToSubjects < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :subjects, :student_count, :integer, :default => 0
|
||||
add_column :subjects, :participant_count, :integer, :default => 0
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class CreateSubjectAppointments < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :subject_appointments do |t|
|
||||
t.references :subject, index: true
|
||||
t.references :user, index: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SubjectAppointment, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in new issue