Browse Source

nps已打分区分

pull/313/head
“xxq250” 3 years ago
parent
commit
fd66a3149d
3 changed files with 6 additions and 1 deletions
  1. +1
    -0
      app/controllers/admins/nps_controller.rb
  2. +1
    -1
      app/views/admins/nps/_user_np_list.html.erb
  3. +4
    -0
      app/views/admins/nps/index.html.erb

+ 1
- 0
app/controllers/admins/nps_controller.rb View File

@@ -7,6 +7,7 @@ class Admins::NpsController < Admins::BaseController
sql = 'CONCAT(users.lastname, users.firstname) LIKE :keyword OR users.nickname LIKE :keyword OR users.login LIKE :keyword OR users.mail LIKE :keyword OR users.phone LIKE :keyword'
@user_nps = @user_nps.where(sql, keyword: "%#{keyword}%")
end
@user_nps = @user_nps.where("action_type != 'close'") if params[:done_score].present?
@user_nps = paginate @user_nps.includes(:user)
end



+ 1
- 1
app/views/admins/nps/_user_np_list.html.erb View File

@@ -21,7 +21,7 @@
</td>
<td><%= display_text(nps.created_at&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= display_text(nps.user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= nps.score %></td>
<td><%= nps.action_type == 'close' ? '--' : nps.score %></td>
<td><%= nps.memo %></td>
</tr>
<% end %>


+ 4
- 0
app/views/admins/nps/index.html.erb View File

@@ -6,6 +6,10 @@
<%= form_tag(admins_nps_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>

<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: 'ID/姓名/邮箱/手机号检索') %>
<label for="done_score">
是否管理员
</label>
<%= check_box_tag("done_score", true, false, id: "done_score", style: 'margin-left: 2px;') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>

<span style="margin-left: 50px;margin-right: 10px;">NPS系统开关</span>


Loading…
Cancel
Save