diff --git a/db/model/user_virtual_coin_flow.go b/db/model/user_virtual_coin_flow.go index 2d48b87..370db00 100644 --- a/db/model/user_virtual_coin_flow.go +++ b/db/model/user_virtual_coin_flow.go @@ -5,17 +5,22 @@ import ( ) type UserVirtualCoinFlow struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` - Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"` - CoinId int `json:"coin_id" xorm:"not null comment('虚拟币id') INT(11)"` - Direction int `json:"direction" xorm:"not null comment('方向:1收入 2支出') TINYINT(255)"` - Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"` - OrdId string `json:"ord_id" xorm:"comment('相关的订单id') VARCHAR(255)"` - Amout string `json:"amout" xorm:"not null comment('变更数量') DECIMAL(16,6)"` - BeforeAmout string `json:"before_amout" xorm:"not null comment('变更前数量') DECIMAL(16,6)"` - AfterAmout string `json:"after_amout" xorm:"not null comment('变更后数量') DECIMAL(16,6)"` - SysFee string `json:"sys_fee" xorm:"not null default 0.000000 comment('手续费') DECIMAL(16,6)"` - CreateTime time.Time `json:"create_time" xorm:"created default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` - TransferType int `json:"transfer_type" xorm:"comment('转账类型:1全球分红,2管理员修改,3消费,4退回,5虚拟币兑换') TINYINT(100)"` - CoinIdTo int `json:"coin_id_to" xorm:"not null default 0 comment('兑换时目标币种id') INT(11)"` + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"` + CoinId int `json:"coin_id" xorm:"not null comment('虚拟币id') INT(11)"` + Direction int `json:"direction" xorm:"not null comment('方向:1收入 2支出') TINYINT(255)"` + Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"` + OrdId string `json:"ord_id" xorm:"comment('相关的订单id') VARCHAR(255)"` + Amout string `json:"amout" xorm:"not null comment('变更数量') DECIMAL(16,6)"` + BeforeAmout string `json:"before_amout" xorm:"not null comment('变更前数量') DECIMAL(16,6)"` + AfterAmout string `json:"after_amout" xorm:"not null comment('变更后数量') DECIMAL(16,6)"` + SysFee string `json:"sys_fee" xorm:"not null default 0.000000 comment('手续费') DECIMAL(16,6)"` + CoinTransferData string `json:"coin_transfer_data" xorm:"not null comment('虚拟币转赠信息') TEXT"` + CreateTime time.Time `json:"create_time" xorm:"created default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + TransferType int `json:"transfer_type" xorm:"comment('转账类型:1全球分红,2管理员修改,3消费,4退回,5虚拟币兑换') TINYINT(100)"` + CoinIdTo int `json:"coin_id_to" xorm:"not null default 0 comment('兑换时目标币种id') INT(11)"` + IsRevoke int `json:"is_revoke" xorm:"not null default 0 comment('转赠是否撤回') INT(1)"` + TransferId int `json:"transfer_id" xorm:"not null default 0 comment('转赠关联id') INT(11)"` + ToUid int `json:"to_uid" xorm:"not null default 0 comment('转赠的用户id') INT(11)"` + TransferMoney string `json:"transfer_money" xorm:"not null default '0.000000' comment('转赠已撤回金额') INT(11)"` } diff --git a/md/block_star_chain.go b/md/block_star_chain.go index 42470c7..6f71e97 100644 --- a/md/block_star_chain.go +++ b/md/block_star_chain.go @@ -75,6 +75,7 @@ type DealUserCoinReq struct { OrdId string `json:"ord_id"` CoinId int `json:"coin_id"` Uid int `json:"uid"` + ToUid int `json:"to_uid"` Amount float64 `json:"amount"` } diff --git a/rule/block_star_chain_settlement.go b/rule/block_star_chain_settlement.go index 57ebe96..46c8b6b 100644 --- a/rule/block_star_chain_settlement.go +++ b/rule/block_star_chain_settlement.go @@ -817,6 +817,7 @@ func DealUserCoin(session *xorm.Session, req md.DealUserCoinReq) (err error) { userVirtualCoinFlow.Title = req.Title userVirtualCoinFlow.TransferType = req.TransferType userVirtualCoinFlow.Uid = req.Uid + userVirtualCoinFlow.ToUid = req.ToUid userVirtualCoinFlow.BeforeAmout = coinAmount userVirtualCoinFlow.Amout = amountValue.String() userVirtualCoinFlow.CreateTime = now