abiao лет назад: 4
Родитель
Сommit
3e055ee2d8
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      app/models/cash_balance.rb

+ 3 - 3
app/models/cash_balance.rb

@@ -43,15 +43,15 @@ class CashBalance < ActiveRecord::Base
     end
   end
   @total=0
-  @list=[]
-  def get_happen_total
 
+  def get_happen_total
+    @list=[]
     unless @list.include?(self.id)
       @list.append(self.id)
     end
     # list.append(self.id)
 
-    total =  CashBalance.where(id: list).sum("count")
+    total =  CashBalance.where(id:@list).sum("count")
 
     return total
   end