diff --git a/modules/caravan/comp_configure.go b/modules/caravan/comp_configure.go index b5c4b7c32..0c6abcbc8 100644 --- a/modules/caravan/comp_configure.go +++ b/modules/caravan/comp_configure.go @@ -215,14 +215,18 @@ func (this *configureComp) GetCaravanReward() (reward []*cfg.GameCaravanRewardDa return } -func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanRewardData) { - if v, err := this.GetConfigure(game_caravan_reward); err == nil { +func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanRewardData, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(game_caravan_reward); err == nil { if configure, ok := v.(*cfg.GameCaravanReward); ok { - reward = configure.Get(this.overflow) + if reward = configure.Get(this.overflow); err != nil { + return + } } - } else { - log.Errorf("get GetCaravanInitCity conf err:%v", err) } + err = comm.NewNotFoundConfErr(moduleName, game_caravan_reward, this.overflow) return } diff --git a/modules/caravan/module.go b/modules/caravan/module.go index 601a688cd..b59f4cbc7 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -494,7 +494,10 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E maxKey = v.Key } } - moreReard := this.configure.GetCaravanMoreReward() // 超过部分 + moreReard, err := this.configure.GetCaravanMoreReward() // 超过部分 + if err != nil { + return + } // 发送虚拟币奖励 if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": comm.CaravanMerchantmoney}}); err == nil { for _data.Next(context.TODO()) { @@ -522,7 +525,7 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E } Query := bson.M{} Query["merchantmoney"] = 0 - _, err := this.modelCaravan.DB.UpdateMany(core.SqlTable(comm.TableUser), bson.M{"merchantmoney": bson.M{"$gt": 0}}, bson.M{"$set": Query}, options.MergeUpdateOptions().SetUpsert(true)) //, new(options.UpdateOptions).SetUpsert(true) + _, err = this.modelCaravan.DB.UpdateMany(core.SqlTable(comm.TableUser), bson.M{"merchantmoney": bson.M{"$gt": 0}}, bson.M{"$set": Query}, options.MergeUpdateOptions().SetUpsert(true)) //, new(options.UpdateOptions).SetUpsert(true) if err != nil { this.Errorf("Update Merchantmoney Many error: %v", err) }