From 58b81b21db01715369e5e716b75fcc363b237378 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 4 Apr 2019 17:25:24 +0800 Subject: [PATCH] 1 --- app/controllers/managements_controller.rb | 2 +- app/models/customer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 31e42f05..8afb2340 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1184,7 +1184,7 @@ end def partners @menu_type = 6 @sub_type = 3 - @partners = Partner.includes(:school).order("created_at desc") + @partners = Partner.includes(:school).order("partners.created_at desc") @partners = @partners.where("concat(schools.name) like ? ", "%#{params[:search]}%") unless params[:search].blank? @current_partner = nil diff --git a/app/models/customer.rb b/app/models/customer.rb index cfff4b21..673acd20 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -1,5 +1,5 @@ class Customer < ActiveRecord::Base - default_scope :order => 'created_at desc' + default_scope :order => 'customers.created_at desc' belongs_to :partner has_one :school has_many :users