diff --git a/go.mod b/go.mod index 4f49faa..dab442d 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20241011013502-c777b13e1553 + code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241011020353-173703a75322 // indirect github.com/syyongx/php2go v0.9.8 go.uber.org/zap v1.13.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 diff --git a/go.sum b/go.sum index bb74abb..71dc0e1 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.202410 code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20241011013502-c777b13e1553/go.mod h1:j7RKAAoD15LeQ89ilr2YSQEWqYVHi4mCwl166zSRO+4= code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241011013237-040263075a38 h1:UdYxMWbzUYbIX8YkrWHLFioWvkd7YsVNWHpAovlRkDE= code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241011013237-040263075a38/go.mod h1:nT2x13YFgrS3tS1fDyUR6q/GNIK+hPw7bdzZXz99SM0= +code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241011020353-173703a75322 h1:9cwcRSalHnl506ISDQ7D58KMi2k4PVt+w9ocghFNt1I= +code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241011020353-173703a75322/go.mod h1:nT2x13YFgrS3tS1fDyUR6q/GNIK+hPw7bdzZXz99SM0= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s= diff --git a/svc/svc_reward.go b/svc/svc_reward.go index 9f3103a..df73264 100644 --- a/svc/svc_reward.go +++ b/svc/svc_reward.go @@ -5,6 +5,8 @@ import ( "code.fnuoos.com/go_rely_warehouse/zyos_go_condition_statistics.git/db/model" zhios_condition_statistics_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_condition_statistics.git/utils" "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/service_award_dividend" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/implement" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" "errors" "fmt" "time" @@ -67,6 +69,24 @@ func AddCoin(eg *xorm.Engine, money float64, Title, ordId string, types, transfe "amount": zhios_condition_statistics_utils.Float64ToStr(money), "price": amount, } + NewServiceAwardReturnBaseDb := implement.NewServiceAwardReturnBaseDb(eg) + base, _ := NewServiceAwardReturnBaseDb.GetServiceAwardReturnBase() + if base != nil && base.CoinId == zhios_condition_statistics_utils.StrToInt(req["coin_id"]) { + date := service_award_dividend.GetCycle(eg) + data := models.ServiceAwardReturnFlowSale{ + Uid: zhios_condition_statistics_utils.StrToInt(req["uid"]), + Time: time.Now(), + UpdateTime: time.Now(), + Type: 1, + Pvd: zhios_condition_statistics_utils.StrToInt(req["pvd"]), + CoinId: base.CoinId, + Date: zhios_condition_statistics_utils.StrToInt(date["now"]), + LastDate: zhios_condition_statistics_utils.StrToInt(date["last"]), + Price: amount, + } + eg.Insert(&data) + } + state := service_award_dividend.AddPeriodEg(eg, req) if state == 3 { return 0, errors.New("失败")