diff --git a/app/db/model/user_virtual_coin_flow.go b/app/db/model/user_virtual_coin_flow.go index b63e328..e412d8b 100644 --- a/app/db/model/user_virtual_coin_flow.go +++ b/app/db/model/user_virtual_coin_flow.go @@ -16,6 +16,7 @@ type UserVirtualCoinFlow struct { 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)"` + Price string `json:"price" 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)"` diff --git a/consume/zhios_appreciation.go b/consume/zhios_appreciation.go index 135c30d..799656c 100644 --- a/consume/zhios_appreciation.go +++ b/consume/zhios_appreciation.go @@ -2,6 +2,7 @@ package consume import ( "applet/app/db" + "applet/app/db/model" "applet/app/svc" "applet/app/utils" "applet/app/utils/logx" @@ -167,7 +168,7 @@ func withdraw(eg *xorm.Engine, msg *md.ZhiosAppreciation) error { //这是到手的 newAmount := utils.GetPrec(utils.Float64ToStrByPrec(resp.TransferOutValue-resp.AmountOut, 5), "4") //扣的 - coinSum := utils.GetPrec(utils.Float64ToStrByPrec(resp.TransferOut-resp.RefluxValue, 20), "4") + coinSum := utils.GetPrec(utils.Float64ToStrByPrec(resp.TransferOutValue-resp.RefluxValue, 20), "4") price = utils.GetPrec(utils.Float64ToStrByPrec(resp.Price, 20), "4") err := svc.UpdateUserFinValidAndInterFlowSess(sess, newAmount, args["amount"]+"个数字资产转余额,价值"+price+"/个", "appreciation", 0, 56, utils.StrToInt(msg.Uid), utils.StrToInt(msg.Oid), utils.StrToInt64(msg.Oid), utils.StrToInt64(msg.Oid)) @@ -211,6 +212,7 @@ func withdraw(eg *xorm.Engine, msg *md.ZhiosAppreciation) error { sess.Rollback() return err } + sess.Where("ord_id=?", msg.Oid).Cols("price").Update(&model.UserVirtualCoinFlow{Price: price}) sess.Commit() return nil } diff --git a/go.mod b/go.mod index 9941416..da49ffa 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( code.fnuoos.com/go_rely_warehouse/zyos_go_condition_statistics.git v1.1.2-0.20231117125527-cb06c9e24f3f code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.0 code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.4 - code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20231128005921-f49c8849bc4a + code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20231130020109-71fc70fb5505 code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git v1.6.2-0.20231116085701-9ba6e19f877b code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20230911014653-22cc8e626d17 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5