关联课堂搜索弹框

dev_local_lzdx
daiao 4 years ago
parent 378bd46513
commit 1305acb1c9

@ -347,15 +347,15 @@ class EcCoursesController < ApplicationController
def search_courses
user = User.where(:id => params[:user_id]).first
if user.try(:admin?) || user.try(:business?)
courses = Course.where(:is_delete => 0)
courses = Course.where(:is_delete => 0).limit(20)
else
course_ids = Member.where("user_id = #{user.try(:id)} and course_id != -1").pluck(:course_id)
courses = Course.where(:is_delete => 0, :id => course_ids)
courses = Course.where(:is_delete => 0, :id => course_ids).limit(20)
end
if params[:search] && params[:search].strip != ""
courses = courses.where("name like ?", "%#{params[:search].strip}%").reorder("created_at desc")
else
courses = courses.reorder("created_at desc")
courses = courses.reorder("created_at desc").limit(20)
end
respond_to do |format|

@ -336,10 +336,6 @@ class PullRequestsController < ApplicationController
def pull_request_changes
@type = params[:type]
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
@changes_count = @changes.count
@limit = 10
@is_remote = true

Loading…
Cancel
Save