From bcb86e9dc3669bf63fa935e067ec6077dc5f735e Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Fri, 26 Jan 2024 21:00:39 +0800 Subject: [PATCH] update --- rule/one_circles/one_circles_auto_release_green_energy.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rule/one_circles/one_circles_auto_release_green_energy.go b/rule/one_circles/one_circles_auto_release_green_energy.go index 0194289..d4768a3 100644 --- a/rule/one_circles/one_circles_auto_release_green_energy.go +++ b/rule/one_circles/one_circles_auto_release_green_energy.go @@ -7,11 +7,17 @@ import ( "errors" "fmt" "github.com/shopspring/decimal" + "time" "xorm.io/xorm" ) // AutoReleaseExchangeGreenEnergy 结算绿色能量自动释放成可用绿色能量 func AutoReleaseExchangeGreenEnergy(engine *xorm.Engine, masterId string) (err error) { + now := time.Now() + if now.Hour() > 1 && now.Hour() > 8 { + //TODO::只在凌晨一点 ~ 凌晨 8 点运行 + return errors.New("非运行时间") + } //1、查找 `one_circles_green_energy_basic_setting` 基础设置 && `one_circles_public_platoon_basic_setting` 基础设置 oneCirclesGreenEnergyBasicSetting, err := db.OneCirclesGreenEnergyBasicSettingGetOneByParams(engine, map[string]interface{}{ "key": "is_open",