find org where type is Resource
This commit is contained in:
parent
c425106d0b
commit
1103e7eab4
|
@ -2027,11 +2027,11 @@ class UsersController < ApplicationController
|
|||
|
||||
def search_user_org
|
||||
@user = User.current
|
||||
if !params[:search].nil?
|
||||
if !params[:search].nil? #发送到有栏目类型为资源的组织中
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@orgs = @user.organizations.where("name like ?", search)
|
||||
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
|
||||
else
|
||||
@orgs = @user.organizations
|
||||
@orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
|
||||
end
|
||||
@search = params[:search]
|
||||
#这里仅仅是传递需要发送的资源id
|
||||
|
|
Loading…
Reference in New Issue