|
|
@@ -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("失败") |
|
|
|