diff --git a/app/models/customer.rb b/app/models/customer.rb index bbfe45c6..cfff4b21 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -1,4 +1,5 @@ class Customer < ActiveRecord::Base + default_scope :order => 'created_at desc' belongs_to :partner has_one :school has_many :users diff --git a/app/views/managements/_partner_customer_list.html.erb b/app/views/managements/_partner_customer_list.html.erb index 4720fc96..e8f643fd 100644 --- a/app/views/managements/_partner_customer_list.html.erb +++ b/app/views/managements/_partner_customer_list.html.erb @@ -5,9 +5,9 @@ data-remote="true" class="color-blue">+添加 添加时间 -<% @current_partner.try(:customers).try(:each) do |customer| %> +<% @current_partner.try(:customers).try(:each_with_index) do |customer, index| %>