abiao 4 년 전
부모
커밋
2b5582c87c
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      app/models/cash_balance.rb

+ 5 - 5
app/models/cash_balance.rb

@@ -43,15 +43,15 @@ class CashBalance < ActiveRecord::Base
     end
   end
   @total=0
-
+  LIST =  []
   def get_happen_total
-    @list=[]
-    unless @list.include?(self.id)
-      @list.append(self.id)
+
+    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