用户审核详情调整
This commit is contained in:
parent
d22a18a8fe
commit
d4d6751dc0
|
@ -3,9 +3,7 @@ class Admins::IdentityVerificationsController < Admins::BaseController
|
|||
def index
|
||||
params[:sort_by] = params[:sort_by].presence || 'created_at'
|
||||
params[:sort_direction] = params[:sort_direction].presence || 'desc'
|
||||
|
||||
identity_verifications = Admins::IdentityVerificationQuery.call(params)
|
||||
|
||||
@identity_verifications = paginate identity_verifications.preload(:user)
|
||||
end
|
||||
|
||||
|
@ -16,9 +14,13 @@ class Admins::IdentityVerificationsController < Admins::BaseController
|
|||
end
|
||||
|
||||
def update
|
||||
@identity_verification.update(update_params)
|
||||
flash[:success] = '保存成功'
|
||||
render 'edit'
|
||||
if @identity_verification.update(update_params)
|
||||
redirect_to admins_identity_verifications_path
|
||||
flash[:success] = "更新成功"
|
||||
else
|
||||
redirect_to admins_identity_verifications_path
|
||||
flash[:danger] = "更新失败"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -10,7 +10,7 @@ class Admins::IdentityVerificationQuery < ApplicationQuery
|
|||
end
|
||||
|
||||
def call
|
||||
state = params[:state].blank? ? [0,1,2] : params[:state].to_i
|
||||
state = params[:state] == "all" ? [0,1,2] : params[:state].nil? ? [0] : params[:state].to_i
|
||||
applies = IdentityVerification.where(state: state)
|
||||
custom_sort(applies, params[:sort_by], params[:sort_direction])
|
||||
end
|
||||
|
|
|
@ -99,16 +99,10 @@
|
|||
</td>
|
||||
</div>
|
||||
|
||||
</br>
|
||||
<div class="form-row">
|
||||
<label><b>是否通过身份证审核: </b></label>
|
||||
</div>
|
||||
<b>
|
||||
|
||||
<% unless @identity_verification.state == "已通过" %>
|
||||
<div class="form-row">
|
||||
<%= f.radio_button :state, '已通过' %> 通过
|
||||
<%= f.radio_button :state, '已拒绝' %> 拒绝
|
||||
<%= radio_button_tag("identity_verification[state]","已通过", required: 'required') %>通过
|
||||
<%= radio_button_tag("identity_verification[state]","已拒绝", required: 'required') %>拒绝
|
||||
</div>
|
||||
</br>
|
||||
<div class="form-row">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<%= form_tag(admins_identity_verifications_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
|
||||
<div class="form-group mr-2">
|
||||
<label for="state">状态:</label>
|
||||
<% state_options = [['全部',nil], ['待审核', 0], ['已通过', 1], ['已拒绝', 2]] %>
|
||||
<% state_options = [['待审核', 0], ['全部',"all"], ['已通过', 1], ['已拒绝', 2]] %>
|
||||
<%= select_tag(:state, options_for_select(state_options), class: 'form-control') %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<table class="table table-hover identity-verifications-list-table">
|
||||
<table class="table table-hover identity-verifications-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="10%">序号</th>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<th width="5%" class="text-left">建站工具</th>
|
||||
<th width="10%" class="text-left">主题</th>
|
||||
<th width="10%" class="text-left">上次构建时间</th>
|
||||
<th width="10%" class="text-left">上次部署时间</th>
|
||||
|
||||
|
||||
<th width="10%"><%= sort_tag('创建于', name: 'created_at', path: admins_site_pages_path) %></th>
|
||||
|
|
Loading…
Reference in New Issue