上传商店最后售价
This commit is contained in:
parent
c8ed280049
commit
3c5c9d4c55
@ -51,7 +51,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
|
|||||||
need[i] = &cfg.Game_atn{
|
need[i] = &cfg.Game_atn{
|
||||||
A: v.A,
|
A: v.A,
|
||||||
T: v.T,
|
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))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,11 +31,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
tdata time.Duration
|
tdata time.Duration
|
||||||
ltime 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 {
|
if shopconf, err = this.module.configure.GetShopConfigure(int32(req.SType)); err != nil && err != mgo.MongodbNil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
return
|
return
|
||||||
@ -138,7 +134,8 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ShopGetListResp{Goods: goods})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ func transGoods(goods []*cfg.Game_shopitemData, ushoputem map[int32]*pb.DBShopIt
|
|||||||
result[i].Consume[i1] = &pb.UserAssets{
|
result[i].Consume[i1] = &pb.UserAssets{
|
||||||
A: v1.A,
|
A: v1.A,
|
||||||
T: v1.T,
|
T: v1.T,
|
||||||
N: v1.N,
|
N: int32(math.Ceil(float64(v1.N) * float64(v.Sale) / float64(1000))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user