diff --git a/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go b/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go index a3e7557..d04bde3 100644 --- a/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go +++ b/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go @@ -1,7 +1,6 @@ package egg_energy import ( - db "code.fnuoos.com/EggPlanet/egg_models.git/src" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_models.git/src/model" md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" @@ -102,7 +101,7 @@ func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabb //6、插入签到记录 now := time.Now() - eggSignInDb := implement.NewEggSignInDb(db.Db) + eggSignInDb := implement.NewEggSignInDb(engine) var sign = &model.EggSignIn{ Uid: uid, StartTime: now.Format("2006-01-02 15:04:05"), @@ -127,7 +126,7 @@ func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabb return err } if !has { - eggEnergyUserActivityDb := implement.NewEggEnergyUserActivityDb(db.Db) + eggEnergyUserActivityDb := implement.NewEggEnergyUserActivityDb(engine) insertAffected, err1 := eggEnergyUserActivityDb.EggEnergyUserActivityInsert(&model.EggEnergyUserActivity{ Uid: uid, Date: now.Format("2006-01-02"), diff --git a/rule/egg_energy/give_activty_coin.go b/rule/egg_energy/give_activty_coin.go index fa26a9c..a747267 100644 --- a/rule/egg_energy/give_activty_coin.go +++ b/rule/egg_energy/give_activty_coin.go @@ -1,7 +1,6 @@ package egg_energy import ( - db "code.fnuoos.com/EggPlanet/egg_models.git/src" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_models.git/src/model" "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" @@ -65,7 +64,7 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ch *rabbit var rewardValue float64 //TODO::奖励多少个活跃积分(根据ecpm, 新用户机制, 蛋蛋分机制) redisConn := cache.GetPool().Get() - sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) + sysCfgDb := implement.NewSysCfgDb(engine, redisConn) videoRewardUnitPrice := sysCfgDb.SysCfgGetWithDb(enum.VideoRewardUnitPrice) if videoRewardUnitPrice != "" { //处理ecpm var coin model.VirtualCoin @@ -107,7 +106,7 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ch *rabbit } score = doc.ScoreValue } - eggPointPartitionCoefficientManagementDb := implement.NewEggPointPartitionCoefficientManagementDb(db.Db) + eggPointPartitionCoefficientManagementDb := implement.NewEggPointPartitionCoefficientManagementDb(engine) eggPointPartitionCoefficientManagements, err1 := eggPointPartitionCoefficientManagementDb.EggPointPartitionCoefficientManagementGetAll() if err1 != nil { return err1