|
|
@@ -54,6 +54,7 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi |
|
|
|
MasterId: masterId, |
|
|
|
Uid: v.Uid, |
|
|
|
Id: v.Id, |
|
|
|
EndTime: v.EndTime, |
|
|
|
}, md.OneCirclesRoutKeyForSignIn) |
|
|
|
ids = append(ids, v.Id) |
|
|
|
} |
|
|
@@ -70,7 +71,18 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi |
|
|
|
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` 基础设置 |
|
|
|
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId) |
|
|
|
if err != nil { |
|
|
@@ -147,7 +159,7 @@ func HandleSettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, id |
|
|
|
} |
|
|
|
//TODO::判断是否活跃 |
|
|
|
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 { |
|
|
|
_ = session.Rollback() |
|
|
|
fmt.Println("err:::::3333333", err3333333) |
|
|
|