diff --git a/app/models/user/user.rb b/app/models/user/user.rb
index c4b84134..4b3a9e6e 100644
--- a/app/models/user/user.rb
+++ b/app/models/user/user.rb
@@ -184,6 +184,13 @@ class User
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first
end
+ def self.get_role_member_data_by_sort(role_status_id)
+ a = Array.new
+ where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'], t ] }
+ member_data = a.sort
+ member_data_tmp = member_data.collect {|v| v[1] }
+ end
+
def create_dept_cache
dept_hash = {}
diff --git a/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb b/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb
index 0ae9c276..f171bd7b 100644
--- a/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb
+++ b/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb
@@ -13,17 +13,17 @@
<%= ms.title %>
- <% @member_lists.where(:role_status_ids=>ms.id).each do |member| %>
+ <% @member_lists.get_role_member_data_by_sort(ms.id).each do |member| %>
-
<%= show_avatar(member) %>
- - <%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title")) %>
+ - <%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) %>
- <%= t("users.name")%><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %>
- <%= t("users.office_tel")%><%= member.office_tel %>
- <%= t("users.email")%><%= member.email %>
- - <%= @member_lists.get_member_list_attribute_field_name("staff","business") %><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business")) %>
- - <%= @member_lists.get_member_list_attribute_field_name("staff","agent") %><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent") %>
+ - <%= @member_lists.get_member_list_attribute_field_name("staff","business") %><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) %>
+ - <%= @member_lists.get_member_list_attribute_field_name("staff","agent") %><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) %>
@@ -50,17 +50,17 @@
<%= ms.title %>
- <% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
+ <% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
- >
<%= show_avatar(member) %>
- - <%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title")) %>
+ - <%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) %>
- <%= t("users.name")%><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %>
- <%= t("users.office_tel")%><%= member.office_tel %>
- <%= t("users.email")%><%= member.email %>
- - <%= @member_lists.get_member_list_attribute_field_name("staff","business") %><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business")) %>
- - <%= @member_lists.get_member_list_attribute_field_name("staff","agent") %><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent") %>
+ - <%= @member_lists.get_member_list_attribute_field_name("staff","business") %><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) %>
+ - <%= @member_lists.get_member_list_attribute_field_name("staff","agent") %><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) %>
@@ -92,7 +92,8 @@
<%= @member_lists.get_member_list_attribute_field_name("staff","agent") %> |
- <% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
+
+ <% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|