abiao 4 роки тому
батько
коміт
2e54aafadf
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      app/models/cash_balance.rb

+ 6 - 1
app/models/cash_balance.rb

@@ -5,7 +5,7 @@ class CashBalance < ActiveRecord::Base
   belongs_to :wx_user, :foreign_key => :wx_uid
   validates_presence_of :wx_uid, :count, :relate_id, :source
   attr_accessor :remain_sum
-  after_find :get_happen_total
+  #after_find :get_happen_total
 
   SOURCE_ENUM = [["提货券充值佣金", "balance_benefit"],
                  ["商品佣金", "product_benefit"],
@@ -90,6 +90,11 @@ class CashBalance < ActiveRecord::Base
       field :profit_state
       field :created_at
       # field :updated_at
+
+      field :get_happen_total do
+        visible true
+        bindings[:object].get_happen_total
+      end
     end
 
     show do