删除搜索接口

issues25489
daiao 6 years ago
parent c3d5b02d13
commit 451172cf31

@ -8,8 +8,13 @@ class TrustieHacksController < ApplicationController
## 分页参数 ## 分页参数
page = params[:page] || 1 page = params[:page] || 1
limit = params[:limit] || 16 limit = params[:limit] || 16
search = params[:search]
hacks = @hackathon.trustie_hacks hacks = @hackathon.trustie_hacks
if search
hacks = hacks.where("name like ?", "%#{search}%")
end
@hackathon_users_count = hacks ? 0 : hacks.sum(:hack_users_count) @hackathon_users_count = hacks ? 0 : hacks.sum(:hack_users_count)
@hacks = hacks.page(page).per(limit) @hacks = hacks.page(page).per(limit)
@ -28,6 +33,11 @@ class TrustieHacksController < ApplicationController
render_ok render_ok
end end
def destroy
@hack.destroy
render_ok
end
def edit_hackathon def edit_hackathon
end end
@ -36,6 +46,7 @@ class TrustieHacksController < ApplicationController
render_ok render_ok
end end
# 报名入口
def entry def entry
if @hack.hack_users.exists?(user_id: current_user) if @hack.hack_users.exists?(user_id: current_user)
render_error('已经报名,请勿重复操作') render_error('已经报名,请勿重复操作')

Loading…
Cancel
Save