|
|
@@ -41,10 +41,16 @@ class CashBalance < ActiveRecord::Base
|
|
|
return self.count
|
|
|
end
|
|
|
end
|
|
|
- $total=0
|
|
|
+ total=0
|
|
|
+ list=[]
|
|
|
def get_happen_total
|
|
|
- $total= $total+self.count
|
|
|
- return $total
|
|
|
+ unless list.include?(3)
|
|
|
+ list.append(self.id)
|
|
|
+ end
|
|
|
+
|
|
|
+ total = CashBalance.where(id: list).sum("count")
|
|
|
+
|
|
|
+ return total
|
|
|
end
|
|
|
|
|
|
def profit_state
|
|
|
@@ -92,7 +98,9 @@ class CashBalance < ActiveRecord::Base
|
|
|
# field :updated_at
|
|
|
|
|
|
field :get_happen_total do
|
|
|
- visible true
|
|
|
+ formatted_value do
|
|
|
+ value.to_f / 100.0
|
|
|
+ end
|
|
|
end
|
|
|
end
|
|
|
|