Merge branches 'dev_aliyun' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

schedule_job
杨树明 5 years ago
commit 2e97ec37c3

@ -17,7 +17,7 @@ class SubjectsController < ApplicationController
include CustomSortable
def index
subjects = Weapps::SubjectQuery.call(current_laboratory, params)
subjects = Weapps::SubjectQuery.call(current_laboratory, params, "web")
@subject_count = subjects.map(&:id).size
@subjects = paginate subjects.includes(:shixuns, :repertoire)
end

@ -4,7 +4,7 @@ class Weapps::SubjectsController < Weapps::BaseController
# 首页
def index
subjects = Weapps::SubjectQuery.call(current_laboratory, params)
subjects = Weapps::SubjectQuery.call(current_laboratory, params, "wechat")
@subject_count = subjects.map(&:id).size
@subjects = paginate subjects
end

@ -2,13 +2,20 @@ class Weapps::SubjectQuery < ApplicationQuery
include CustomSortable
attr_reader :params
def initialize(current_laboratory, params)
def initialize(current_laboratory, params, device)
@current_laboratory = current_laboratory
@params = params
@device = device
end
def call
subjects = @current_laboratory.subjects.unhidden.publiced.show_moblied
Rails.logger.info("##### @device: #{@device}")
subjects =
if @device == "wechat"
@current_laboratory.subjects.unhidden.publiced.show_moblied
else
@current_laboratory.subjects.unhidden.publiced
end
# 课程体系的过滤
if params[:sub_discipline_id].present?

Loading…
Cancel
Save