|
@@ -38,10 +38,11 @@ func DailySettlementBlockStarChain(engine *xorm.Engine, mid string) (err error) |
|
|
session.Begin() |
|
|
session.Begin() |
|
|
now := time.Now() |
|
|
now := time.Now() |
|
|
today := now.Format("2006-01-02") |
|
|
today := now.Format("2006-01-02") |
|
|
if now.Hour() > 8 || now.Hour() < 1 { |
|
|
|
|
|
//TODO::只在凌晨一点 ~ 凌晨 8 点运行 |
|
|
|
|
|
return errors.New("非运行时间") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", now.Hour()) |
|
|
|
|
|
//if now.Hour() > 8 || now.Hour() < 1 { |
|
|
|
|
|
// //TODO::只在凌晨一点 ~ 凌晨 8 点运行 |
|
|
|
|
|
// return errors.New("非运行时间") |
|
|
|
|
|
//} |
|
|
//1、查找 `block_star_chain` 基础设置 |
|
|
//1、查找 `block_star_chain` 基础设置 |
|
|
blockStarChain, err := db.BlockStarChainGetOneByParams(session, map[string]interface{}{ |
|
|
blockStarChain, err := db.BlockStarChainGetOneByParams(session, map[string]interface{}{ |
|
|
"key": "is_use", |
|
|
"key": "is_use", |
|
@@ -713,6 +714,7 @@ func DealLotteryDraw(session *xorm.Session, req md.DealLotteryDrawReq) (err erro |
|
|
_ = session.Rollback() |
|
|
_ = session.Rollback() |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
|
|
|
//2、销毁 |
|
|
rewardValue, _ := decimal.NewFromString(req.Amount) |
|
|
rewardValue, _ := decimal.NewFromString(req.Amount) |
|
|
rewardValue = rewardValue.Mul(decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(blockStarChain.LotteryDrawDestroyCoinRate) / 100)) |
|
|
rewardValue = rewardValue.Mul(decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(blockStarChain.LotteryDrawDestroyCoinRate) / 100)) |
|
|
platformGuidePriceForCoin, _ := decimal.NewFromString(blockStarChain.PlatformGuidePriceForCoin) |
|
|
platformGuidePriceForCoin, _ := decimal.NewFromString(blockStarChain.PlatformGuidePriceForCoin) |
|
|