错误信息补充

This commit is contained in:
meixiongfeng 2023-09-18 17:11:54 +08:00
parent dad0c67a6a
commit 5529d8edb7
2 changed files with 14 additions and 7 deletions

View File

@ -215,14 +215,18 @@ func (this *configureComp) GetCaravanReward() (reward []*cfg.GameCaravanRewardDa
return return
} }
func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanRewardData) { func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanRewardData, err error) {
if v, err := this.GetConfigure(game_caravan_reward); err == nil { var (
v interface{}
)
if v, err = this.GetConfigure(game_caravan_reward); err == nil {
if configure, ok := v.(*cfg.GameCaravanReward); ok { 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 return
} }

View File

@ -494,7 +494,10 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E
maxKey = v.Key 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 { if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": comm.CaravanMerchantmoney}}); err == nil {
for _data.Next(context.TODO()) { for _data.Next(context.TODO()) {
@ -522,7 +525,7 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E
} }
Query := bson.M{} Query := bson.M{}
Query["merchantmoney"] = 0 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 { if err != nil {
this.Errorf("Update Merchantmoney Many error: %v", err) this.Errorf("Update Merchantmoney Many error: %v", err)
} }