上传商店最后售价

This commit is contained in:
liwei1dao 2022-07-22 13:58:50 +08:00
parent c8ed280049
commit 3c5c9d4c55
3 changed files with 6 additions and 8 deletions

View File

@ -51,7 +51,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
need[i] = &cfg.Game_atn{
A: v.A,
T: v.T,
N: int32(math.Ceil(float64(v.N) * float64(conf.Sale) / float64(100))),
N: int32(math.Ceil(float64(v.N) * float64(conf.Sale) / float64(1000))),
}
}

View File

@ -31,11 +31,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
tdata time.Duration
ltime time.Duration
)
defer func() {
if code == pb.ErrorCode_Success {
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ShopGetListResp{Goods: goods})
}
}()
if shopconf, err = this.module.configure.GetShopConfigure(int32(req.SType)); err != nil && err != mgo.MongodbNil {
code = pb.ErrorCode_SystemError
return
@ -138,7 +134,8 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
}
} else {
code = pb.ErrorCode_ReqParameterError
}
return
}
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ShopGetListResp{Goods: goods})
return
}

View File

@ -4,6 +4,7 @@ import (
"crypto/rand"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"math"
"math/big"
)
@ -56,7 +57,7 @@ func transGoods(goods []*cfg.Game_shopitemData, ushoputem map[int32]*pb.DBShopIt
result[i].Consume[i1] = &pb.UserAssets{
A: v1.A,
T: v1.T,
N: v1.N,
N: int32(math.Ceil(float64(v1.N) * float64(v.Sale) / float64(1000))),
}
}
}