Browse Source

update

master
DengBiao 11 months ago
parent
commit
bcb86e9dc3
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      rule/one_circles/one_circles_auto_release_green_energy.go

+ 6
- 0
rule/one_circles/one_circles_auto_release_green_energy.go View File

@@ -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",


Loading…
Cancel
Save