浏览代码

update

master
dengbiao 7 个月前
父节点
当前提交
29375a2022
共有 2 个文件被更改,包括 15 次插入2 次删除
  1. +1
    -0
      md/mq.go
  2. +14
    -2
      rule/one_circles/one_circles_sign_in_green_energy_settlement.go

+ 1
- 0
md/mq.go 查看文件

@@ -14,6 +14,7 @@ type OneCirclesStructForSignIn struct {
MasterId string `json:"master_id"` MasterId string `json:"master_id"`
Uid int `json:"uid"` Uid int `json:"uid"`
Id int64 `json:"id"` Id int64 `json:"id"`
EndTime string `json:"end_time"`
} }


type OneCirclesStructForAutoExchangeGreenEnergy struct { type OneCirclesStructForAutoExchangeGreenEnergy struct {


+ 14
- 2
rule/one_circles/one_circles_sign_in_green_energy_settlement.go 查看文件

@@ -54,6 +54,7 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi
MasterId: masterId, MasterId: masterId,
Uid: v.Uid, Uid: v.Uid,
Id: v.Id, Id: v.Id,
EndTime: v.EndTime,
}, md.OneCirclesRoutKeyForSignIn) }, md.OneCirclesRoutKeyForSignIn)
ids = append(ids, v.Id) ids = append(ids, v.Id)
} }
@@ -70,7 +71,18 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi
return return
} }


func HandleSettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, id int64, uid int) (err error) {
func HandleSettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, id int64, uid int, endTime string) (err error) {
//var signRecord model.OneCirclesGreenEnergySignIn
//has, err00000 := engine.Where("id =?", id).Get(&signRecord)
//if err00000 != nil {
// fmt.Println("err:::::0000000", err00000)
// return err00000
//}
//if !has {
// //不活跃不需要奖励
// return errors.New("未查询到对应记录")
//}

//1、查找 `one_circles_green_energy_basic_setting` 基础设置 //1、查找 `one_circles_green_energy_basic_setting` 基础设置
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId) oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId)
if err != nil { if err != nil {
@@ -147,7 +159,7 @@ func HandleSettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, id
} }
//TODO::判断是否活跃 //TODO::判断是否活跃
var m model.OneCirclesGreenEnergySignIn var m model.OneCirclesGreenEnergySignIn
has, err3333333 := engine.Where("uid =?", relate.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m)
has, err3333333 := engine.Where("uid =?", relate.ParentUid).And("end_time >=?", endTime).Get(&m)
if err3333333 != nil { if err3333333 != nil {
_ = session.Rollback() _ = session.Rollback()
fmt.Println("err:::::3333333", err3333333) fmt.Println("err:::::3333333", err3333333)


正在加载...
取消
保存