解决搜索不能用的问题
This commit is contained in:
parent
92f55e0dc1
commit
80f829c018
|
@ -164,7 +164,7 @@ class OrganizationsController < ApplicationController
|
|||
return
|
||||
end
|
||||
q = params[:search].nil? ? "" : "#{params[:search].strip}"
|
||||
@field = OrgSubfield.find(params[:org_subfield_id])
|
||||
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comptec").first : OrgSubfield.find(params[:org_subfield_id])
|
||||
@type = params[:type]
|
||||
if @type == "courses" || @type.nil?
|
||||
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
</div>
|
||||
<div class="resources mt10">
|
||||
<div class="function-row" id="org_teacher_search">
|
||||
<%= form_tag( url_for(:controller => 'organizations', :action => 'teachers', :type => @type),
|
||||
:remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||
<%= form_tag(url_for(:controller => 'organizations', :action => 'teachers', :type => @type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||
<input type="text" name="search" placeholder="输入教师名进行搜索" class="teacher-list-search fl" />
|
||||
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
|
||||
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
||||
|
|
Loading…
Reference in New Issue