diff --git a/modules/shopcenter/module.go b/modules/shopcenter/module.go index 7cdc33ab5..4f858de81 100644 --- a/modules/shopcenter/module.go +++ b/modules/shopcenter/module.go @@ -117,7 +117,7 @@ func (this *ShopCenter) Delivery(session comm.IUserSession, pId int32) (errdata errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, Title: pb.ErrorCode_ConfigNoFound.String(), - Message: fmt.Sprintf("no found Point:%s", pId), + Message: fmt.Sprintf("no found Point:%d", pId), } return } @@ -130,19 +130,18 @@ func (this *ShopCenter) Delivery(session comm.IUserSession, pId int32) (errdata } return } - if _, ok := info.Item[conf.Id]; !ok { - info.Item[conf.Id] = &pb.DBShopCenterItem{ - Id: conf.Id, - Vip: true, - Open: true, - Buytime: configure.Now().Unix(), - Record: make(map[int32]bool), - } - } else { + if _, ok := info.Item[conf.Id]; ok { info.Item[conf.Id].Open = true info.Item[conf.Id].Vip = true info.Item[conf.Id].Buytime = configure.Now().Unix() info.Item[conf.Id].Record = make(map[int32]bool) + } else { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.String(), + Message: fmt.Sprintf("no found Point:%d", pId), + } + return } if err = this.modelshop.Change(session.GetUserId(), map[string]interface{}{ "item": info.Item,