|
|
@@ -72,18 +72,7 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
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("未查询到对应记录") |
|
|
|
//} |
|
|
|
|
|
|
|
func HandleSettlementSignInGreenEnergy(ch *rabbit.Channel, engine *xorm.Engine, masterId string, id int64, uid int, endTime string) (err error) { |
|
|
|
//1、查找 `one_circles_green_energy_basic_setting` 基础设置 |
|
|
|
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId) |
|
|
|
if err != nil { |
|
|
@@ -214,9 +203,14 @@ func HandleSettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, id |
|
|
|
} |
|
|
|
|
|
|
|
//6、更新 `one_circles_green_energy_sign_in` 中的 is_completed 状态 |
|
|
|
_, err = session.Where("id = ?", id).Update(&model.OneCirclesGreenEnergySignIn{ |
|
|
|
IsCompleted: 1, |
|
|
|
}) |
|
|
|
//_, err = session.Where("id = ?", id).Update(&model.OneCirclesGreenEnergySignIn{ |
|
|
|
// IsCompleted: 1, |
|
|
|
//}) |
|
|
|
//TODO::推入rabbitmq 异步处理 |
|
|
|
ch.Publish(md.OneCirclesExchange, md.UpdateOneCirclesStructForSignInRecords{ |
|
|
|
Uid: uid, |
|
|
|
Id: id, |
|
|
|
}, md.OneCirclesRoutKeyForSignInUpdateRecords) |
|
|
|
|
|
|
|
err = session.Commit() |
|
|
|
if err != nil { |
|
|
|