From eee90a28fe58f9290aa2672c17ce2000cf58a44b Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 28 Feb 2024 16:04:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/exclusive/model.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/modules/exclusive/model.go b/modules/exclusive/model.go index a751a333d..d1c2dc44d 100644 --- a/modules/exclusive/model.go +++ b/modules/exclusive/model.go @@ -133,11 +133,9 @@ type exclusiveModel struct { // /查询用户的武器背包 func (this *exclusiveModel) getExclusives(uId string) (list []*pb.DB_Exclusive, err error) { - var ( - model *db.DBModel - ) + list = make([]*pb.DB_Exclusive, 0) - if err = model.GetList(uId, &list); err != nil { + if err = this.model.GetList(uId, &list); err != nil { this.module.Errorf("err:%v", err) } return @@ -145,11 +143,9 @@ func (this *exclusiveModel) getExclusives(uId string) (list []*pb.DB_Exclusive, // /查询用户的武器背包 func (this *exclusiveModel) getExclusivesById(uId string, oid string) (info *pb.DB_Exclusive, err error) { - var ( - model *db.DBModel - ) + info = &pb.DB_Exclusive{} - if err = model.GetListObj(uId, oid, info); err != nil { + if err = this.model.GetListObj(uId, oid, info); err != nil { this.module.Errorf("err:%v", err) } return @@ -157,11 +153,9 @@ func (this *exclusiveModel) getExclusivesById(uId string, oid string) (info *pb. // /查询用户的武器背包 func (this *exclusiveModel) getExclusivesByIds(uId string, oid []string) (list []*pb.DB_Exclusive, err error) { - var ( - model *db.DBModel - ) + list = make([]*pb.DB_Exclusive, 0) - if err = model.GetListObjs(uId, oid, &list); err != nil { + if err = this.model.GetListObjs(uId, oid, &list); err != nil { this.module.Errorf("err:%v", err) } return