From 50c6d649946723bcc6dcc7b3f8c9445e45df2741 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 6 Dec 2024 15:17:03 +0800 Subject: [PATCH] =?UTF-8?q?db.Db=E4=B8=8D=E8=83=BD=E5=9C=A8=E8=BF=99?= =?UTF-8?q?=E9=87=8C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/egg_energy/activity_coin_ready_exchange_egg_energy.go | 5 ++--- rule/egg_energy/give_activty_coin.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) 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