From 5b368235e843162c9d081684be4466bb537dc67b Mon Sep 17 00:00:00 2001 From: Spen Date: Thu, 2 May 2013 17:24:06 +0800 Subject: [PATCH] ntu dropdown fix list sort --- app/models/user/user.rb | 7 +++++++ .../member_staff_lists/index.html.erb | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/models/user/user.rb b/app/models/user/user.rb index c4b841340..4b3a9e6e6 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 0ae9c2760..f171bd7ba 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 %>