上传商店优化
This commit is contained in:
parent
72a3246f7e
commit
782a67734b
@ -175,13 +175,14 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
sdata.Items = make([]*pb.UserShopGood, len(items))
|
sdata.Items = make([]*pb.UserShopGood, len(items))
|
||||||
sdata.Preview = make(map[int32]*pb.DB_Equipment)
|
sdata.Preview = make(map[int32]*pb.DB_Equipment)
|
||||||
for i, v := range items {
|
for i, v := range items {
|
||||||
|
id := v.Key*100 + int32(i)
|
||||||
sdata.Items[i] = &pb.UserShopGood{
|
sdata.Items[i] = &pb.UserShopGood{
|
||||||
Id: v.Key*100 + int32(i),
|
Id: id,
|
||||||
Gid: v.Key,
|
Gid: v.Key,
|
||||||
Buy: 0,
|
Buy: 0,
|
||||||
}
|
}
|
||||||
if v.Preview { //是否预览
|
if v.Preview { //是否预览
|
||||||
if errdata, sdata.Preview[v.Key] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); errdata != nil {
|
if errdata, sdata.Preview[id] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,13 +225,14 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
sdata.Items = make([]*pb.UserShopGood, len(items))
|
sdata.Items = make([]*pb.UserShopGood, len(items))
|
||||||
sdata.Preview = make(map[int32]*pb.DB_Equipment)
|
sdata.Preview = make(map[int32]*pb.DB_Equipment)
|
||||||
for i, v := range items {
|
for i, v := range items {
|
||||||
|
id := v.Key*100 + int32(i)
|
||||||
sdata.Items[i] = &pb.UserShopGood{
|
sdata.Items[i] = &pb.UserShopGood{
|
||||||
Id: v.Key*100 + int32(i),
|
Id: id,
|
||||||
Gid: v.Key,
|
Gid: v.Key,
|
||||||
Buy: 0,
|
Buy: 0,
|
||||||
}
|
}
|
||||||
if v.Preview { //是否预览
|
if v.Preview { //是否预览
|
||||||
if errdata, sdata.Preview[v.Key] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); errdata != nil {
|
if errdata, sdata.Preview[id] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user