abiao 4 년 전
부모
커밋
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