Kaynağa Gözat

add cash to profit

abiao 5 yıl önce
ebeveyn
işleme
484b35cc14

+ 16 - 1
app/models/cash_balance.rb

@@ -29,7 +29,7 @@ class CashBalance < ActiveRecord::Base
                  ["活动退款","dollar_win_return"],
                  ["活动退款","dollar_win_return"],
                  ["活动报名","dollar_win"],
                  ["活动报名","dollar_win"],
                  ["佣金转提货券","cash_to_balance"],
                  ["佣金转提货券","cash_to_balance"],
-                 ["佣金自动分账","cash_profit"],
+                 ["佣金自动分账","cash_to_profit"],
   ]
   ]
 
 
   def remain_sum
   def remain_sum
@@ -40,6 +40,19 @@ class CashBalance < ActiveRecord::Base
       return self.count
       return self.count
     end
     end
   end
   end
+
+  def profit_state
+    if self.trade_no.length>0
+      if self.profit_flag
+        return "分账已完成"
+      else
+        return "分账处理中"
+      end
+    else
+      return "--"
+    end
+  end
+
   rails_admin do
   rails_admin do
     navigation_label '资金管理'
     navigation_label '资金管理'
     weight -920
     weight -920
@@ -68,6 +81,7 @@ class CashBalance < ActiveRecord::Base
         end
         end
       end
       end
       field :remark
       field :remark
+      field :profit_state
       field :created_at
       field :created_at
       # field :updated_at
       # field :updated_at
     end
     end
@@ -91,6 +105,7 @@ class CashBalance < ActiveRecord::Base
       end
       end
       field :relate_id
       field :relate_id
       field :remark
       field :remark
+      field :profit_state
       field :created_at
       field :created_at
     end
     end
 
 

+ 3 - 0
config/locales/models/cash_balance.yml

@@ -12,5 +12,8 @@ zh-CN:
         source: 来源
         source: 来源
         relate_id: 关联订单号
         relate_id: 关联订单号
         remark: 备注
         remark: 备注
+        trade_no: 分账单号
+        profit_flag: 分账状态
+        profit_state: 分账状态
         created_at: 创建时间
         created_at: 创建时间
         updated_at: 更新时间
         updated_at: 更新时间