This commit is contained in:
meixiongfeng 2024-01-03 15:38:10 +08:00
commit b62451fc35
2 changed files with 5 additions and 2 deletions

View File

@ -195,7 +195,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
var _items []*cfg.GameShopitemData
for _, v := range shopconf.Shopitem {
if _items, err = this.module.configure.GetShopItemsConfigureByGroups(v, udata); err != nil || len(_items) == 0 {
if _items, err = this.module.configure.GetShopItemsConfigureByGroups(v, udata); err != nil {
this.module.Error("no founf shopgroup", log.Field{Key: "gid", Value: v})
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SystemError,

View File

@ -75,7 +75,7 @@ func (this *configureComp) GetShopItemsConfigure(key int32) (result *cfg.GameSho
// 读取商品组
func (this *configureComp) GetShopItemsConfigureByGroups(groupid int32, user *pb.DBUser) (result []*cfg.GameShopitemData, err error) {
result = make([]*cfg.GameShopitemData, 0, 10)
result = make([]*cfg.GameShopitemData, 0)
var (
v interface{}
table *cfg.GameShopitem
@ -94,6 +94,9 @@ func (this *configureComp) GetShopItemsConfigureByGroups(groupid int32, user *pb
result = append(result, v)
}
}
if len(result) == 0 {
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_shopitem, groupid)
}
}
return
}