|
|
|
@ -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?
|
|
|
|
|