|
@@ -8,6 +8,7 @@ import ( |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/enum" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/enum" |
|
|
md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/md" |
|
|
md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/md" |
|
|
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/svc" |
|
|
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" |
|
|
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" |
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx" |
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx" |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
@@ -73,17 +74,17 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi |
|
|
|
|
|
|
|
|
func HandleSettlementSignInGreenEnergy(ch *rabbit.Channel, engine *xorm.Engine, masterId string, id int64, uid int, endTime string) (err error) { |
|
|
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` 基础设置 |
|
|
//1、查找 `one_circles_green_energy_basic_setting` 基础设置 |
|
|
oneCirclesGreenEnergyBasicSetting, err := db.OneCirclesGreenEnergyBasicSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
|
|
|
"key": "is_open", |
|
|
|
|
|
"value": 1, |
|
|
|
|
|
}) |
|
|
|
|
|
//oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId) |
|
|
|
|
|
//if err != nil { |
|
|
|
|
|
// return |
|
|
|
|
|
//} |
|
|
|
|
|
//if cb != nil { |
|
|
|
|
|
// defer cb() // 释放锁 |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
//oneCirclesGreenEnergyBasicSetting, err := db.OneCirclesGreenEnergyBasicSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
|
|
|
// "key": "is_open", |
|
|
|
|
|
// "value": 1, |
|
|
|
|
|
//}) |
|
|
|
|
|
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if cb != nil { |
|
|
|
|
|
defer cb() // 释放锁 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var teamRewardSetting *md2.TeamRewardSettingStruct |
|
|
var teamRewardSetting *md2.TeamRewardSettingStruct |
|
|
err = json.Unmarshal([]byte(oneCirclesGreenEnergyBasicSetting.TeamReward), &teamRewardSetting) |
|
|
err = json.Unmarshal([]byte(oneCirclesGreenEnergyBasicSetting.TeamReward), &teamRewardSetting) |
|
@@ -197,8 +198,8 @@ func HandleSettlementSignInGreenEnergy(ch *rabbit.Channel, engine *xorm.Engine, |
|
|
|
|
|
|
|
|
//5、减少“活跃赠送” 中的绿色能量 |
|
|
//5、减少“活跃赠送” 中的绿色能量 |
|
|
if reduceTotalGreenEnergy > 0 { |
|
|
if reduceTotalGreenEnergy > 0 { |
|
|
//err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), oneCirclesGreenEnergyBasicSetting, oneCirclesGreenEnergyBasicSetting.NowPrice) |
|
|
|
|
|
err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), nil, "", masterId) |
|
|
|
|
|
|
|
|
err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), oneCirclesGreenEnergyBasicSetting, oneCirclesGreenEnergyBasicSetting.NowPrice, masterId) |
|
|
|
|
|
//err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), nil, "", masterId) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
_ = session.Rollback() |
|
|
_ = session.Rollback() |
|
|
fmt.Println("err:::::55555", err) |
|
|
fmt.Println("err:::::55555", err) |
|
|