Commit bc99ead9 by liyijie

feat: statistics_association with associaiton unscope

parent d1c2648e
...@@ -306,6 +306,7 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -306,6 +306,7 @@ class SimpleController::BaseController < ::InheritedResources::Base
if defined?(Com::Attr::Stat::Collection) && params[:collection_stat_condition].present? if defined?(Com::Attr::Stat::Collection) && params[:collection_stat_condition].present?
# 支持collection_stat_condition # 支持collection_stat_condition
statistics_association = association.unscope(:order).distinct
stat_condition = Com::Attr::Stat::Collection.new params.to_unsafe_h[:collection_stat_condition] stat_condition = Com::Attr::Stat::Collection.new params.to_unsafe_h[:collection_stat_condition]
@statistics = statistics_association.ta_statistic(stat_condition) @statistics = statistics_association.ta_statistic(stat_condition)
end end
......
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