铁匠铺清除数量为0的订单数据
This commit is contained in:
parent
a7777dc379
commit
5b624437d3
@ -98,8 +98,8 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
|
|||||||
// 计算出需要的时间
|
// 计算出需要的时间
|
||||||
|
|
||||||
_smithycfg := this.module.configure.GetSmithyConfigData(desktype, skillLv) // 美食家配置表
|
_smithycfg := this.module.configure.GetSmithyConfigData(desktype, skillLv) // 美食家配置表
|
||||||
iCount := int(order.Count)
|
|
||||||
for i := 0; i < iCount; i++ {
|
for i := 0; i < int(order.Count); i++ {
|
||||||
curTime += szTime[order.DeskType]
|
curTime += szTime[order.DeskType]
|
||||||
order.Count--
|
order.Count--
|
||||||
if order.Count == 0 {
|
if order.Count == 0 {
|
||||||
@ -148,6 +148,14 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 清除数量为0 的订单
|
||||||
|
pos := 0
|
||||||
|
for _, order := range smithy.Orders {
|
||||||
|
if order.Count == 0 {
|
||||||
|
pos++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
smithy.Orders = append(smithy.Orders[:0], smithy.Orders[pos:]...)
|
||||||
if nextDay {
|
if nextDay {
|
||||||
smithy.OrderCostTime += nextDayTime
|
smithy.OrderCostTime += nextDayTime
|
||||||
for _, order := range smithy.Orders {
|
for _, order := range smithy.Orders {
|
||||||
|
Loading…
Reference in New Issue
Block a user