@ -236,9 +236,11 @@ class OrganizationsController < ApplicationController
@field=params[:org_subfield_id].nil??OrgSubfield.where("organization_id =? and field_type =?",params[:id].to_i,"Comppro").first:OrgSubfield.find(params[:org_subfield_id])
@type=params[:type]
if@type.nil?
@containers=Project.find_by_sql("SELECT * FROM `projects` where status = 1 and is_public = 1 and name like '%#{q}%' order by updated_on desc;")
@containers=Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count
@containers=Project.find_by_sql("SELECT * FROM `projects` where status =1 and is_public = 1 and hot = 1 and name like '%#{q}%' order by updated_on desc;")
@containers=Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count
@ -248,9 +250,11 @@ class OrganizationsController < ApplicationController
@field=params[:org_subfield_id].nil??OrgSubfield.where("organization_id =? and field_type =?",params[:id].to_i,"Compstu").first:OrgSubfield.find(params[:org_subfield_id])
@type=params[:type]
if@type.nil?
@containers=Course.find_by_sql("SELECT * FROM `courses` where is_delete = 0 and is_public = 1 and name like '%#{q}%' order by updated_at desc;")
@containers=Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count
@containers=Course.find_by_sql("SELECT * FROM `courses` where is_delete = 0 and is_public = 1 and is_excellent = 1 and name like '%#{q}%' order by updated_at desc;")
@containers=Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count