|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
class ShixunSearchService < ApplicationService
|
|
|
|
|
include ElasticsearchAble
|
|
|
|
|
|
|
|
|
|
attr_reader :params
|
|
|
|
|
attr_reader :params, :subdomain
|
|
|
|
|
|
|
|
|
|
def initialize(params)
|
|
|
|
|
def initialize(params, subdomain)
|
|
|
|
|
@params = params
|
|
|
|
|
@subdomain = subdomain
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def call
|
|
|
|
@ -35,7 +36,7 @@ class ShixunSearchService < ApplicationService
|
|
|
|
|
@shixuns = @shixuns.where(trainee: params[:diff])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
laboratory = Laboratory.find_by_subdomain(request.subdomain)
|
|
|
|
|
laboratory = Laboratory.find_by_subdomain(subdomain)
|
|
|
|
|
@shixuns = @shixuns.where(id: laboratory.shixuns) if laboratory
|
|
|
|
|
|
|
|
|
|
Shixun.search(keyword, search_options)
|
|
|
|
|