搜索调整

dev_cs
cxt 5 years ago
parent e98ae780f2
commit 4b1f4c7845

@ -131,7 +131,7 @@ class ShixunsController < ApplicationController
offset = (page.to_i - 1) * (limit.to_i)
order = params[:order] || "desc"
## 搜索关键字创建者、实训名称、院校名称
keyword = params[:search]
keyword = params[:search].blank? ? "*" : params[:search]
@shixuns = Shixun.search keyword, where: {id: @shixuns.pluck(:id)}, order: {"myshixuns_count" => order}, limit: limit, offset: offset
@total_count = @shixuns.total_count

@ -40,6 +40,7 @@ elsif @user_course_identity == Course::STUDENT
json.efficiency work_score_format(@work.efficiency, true, @score_open)
json.eff_score work_score_format(@work.eff_score, true, @score_open)
json.complete_count @work.myshixun.try(:passed_count)
# json.redo_work student_redo_work(@work)
else
json.(@work, :id, :work_status, :update_time, :ultimate_score)

Loading…
Cancel
Save