Merge branch 'develop' into dev_aliyun

sso
jingquan huang 5 years ago
commit 39cee1cbee

@ -41,6 +41,7 @@ class Subject < ApplicationRecord
scope :published, lambda{where(status: 1)} scope :published, lambda{where(status: 1)}
scope :unhidden, lambda{where(hidden: 0)} scope :unhidden, lambda{where(hidden: 0)}
scope :publiced, lambda{ where(public: 2) } scope :publiced, lambda{ where(public: 2) }
scope :show_moblied, lambda{ where(show_mobile: true) }
after_create :send_tiding after_create :send_tiding
def send_tiding def send_tiding

@ -8,7 +8,7 @@ class Weapps::SubjectQuery < ApplicationQuery
end end
def call def call
subjects = @current_laboratory.subjects.unhidden.publiced subjects = @current_laboratory.subjects.unhidden.publiced.show_moblied
# 课程体系的过滤 # 课程体系的过滤
if params[:sub_discipline_id].present? if params[:sub_discipline_id].present?

@ -1,7 +1,8 @@
class SyncSubjectdsMobile < ActiveRecord::Migration[5.2] class SyncSubjectdsMobile < ActiveRecord::Migration[5.2]
def change def change
SubDisciplineContainer.where(container_type: "Subject").find_each do |sc|
Subject.find(sc.container_id).update_column("show_mobile", true) SubDisciplineContainer.find_each do |sc|
Subject.find(sc.container_id).update_column(:show_mobile, true)
end end
end end
end end

Loading…
Cancel
Save