Commit c7e95f5b by liyijie

feat: 对于group_keys,只对active_record生效

parent 6257cfe5
...@@ -292,7 +292,7 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -292,7 +292,7 @@ class SimpleController::BaseController < ::InheritedResources::Base
# 执行统计和sub_q # 执行统计和sub_q
def ransack_association_chain def ransack_association_chain
association = collection_of_association_chain association = collection_of_association_chain
if params[:group_keys].present? if params[:group_keys].present? && active_record?
statistics_association = association.unscope(:order).distinct statistics_association = association.unscope(:order).distinct
if defined?(Com::CounterStorage) && Array(params[:group_keys]).count > 1 if defined?(Com::CounterStorage) && Array(params[:group_keys]).count > 1
hash = statistics_association.group(params[:group_keys]).count.merge(count: statistics_association.count) hash = statistics_association.group(params[:group_keys]).count.merge(count: statistics_association.count)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment