handle remove
This commit is contained in:
@@ -293,7 +293,7 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
|
||||
} else {
|
||||
for i, item := range c.Items {
|
||||
if item.Id == int(msg.Id) {
|
||||
if item.Quantity <= int(msg.Quantity) {
|
||||
if msg.Quantity <= 0 {
|
||||
c.TotalPrice -= item.Price * int64(msg.Quantity)
|
||||
c.Items = append(c.Items[:i], c.Items[i+1:]...)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user