Forráskód Böngészése

add cash to profit

abiao 5 éve
szülő
commit
e8a7f35f7e

+ 2 - 1
app/models/cash_balance.rb

@@ -29,7 +29,8 @@ class CashBalance < ActiveRecord::Base
                  ["活动退款","dollar_win_return"],
                  ["活动报名","dollar_win"],
                  ["佣金转提货券","cash_to_balance"],
-               ]
+                 ["佣金自动分账","cash_profit"],
+  ]
 
   def remain_sum
     b = CashBalance.where("wx_uid = ? and id < ?", self.wx_uid, self.id).last

+ 19 - 0
db/migrate/20201219114699_create_profit_users.rb

@@ -0,0 +1,19 @@
+# encoding:utf-8
+class CreateProfitUsers < ActiveRecord::Migration
+  def up
+    #分佣方管理
+    create_table :profit_users do |t|
+      #微信ID
+      t.column :wx_user_id,:string
+      #openId
+      t.column :openid,:string
+      t.timestamps
+    end
+    add_index :profit_users, :wx_user_id
+  end
+
+  def down
+    drop_table :profit_users
+  end
+
+end