1
This commit is contained in:
parent
032e403760
commit
8d0a0d928f
@ -8,8 +8,8 @@ import (
|
||||
)
|
||||
|
||||
type Bag struct {
|
||||
Idx int64 `gorm:"column:idx;AUTO_INCREMENT"`
|
||||
AccountId string `gorm:"column:account_id;primaryKey"`
|
||||
Idx int64 `gorm:"column:idx;AUTO_INCREMENT;primaryKey"`
|
||||
AccountId string `gorm:"column:account_id"`
|
||||
ItemId int32 `gorm:"column:item_id"`
|
||||
ItemNum int32 `gorm:"column:item_num"`
|
||||
CreateTime int32 `gorm:"column:createtime;<-:create"`
|
||||
|
@ -22,7 +22,12 @@ func (this *award) AddItem(accountId string, itemId int32, itemNum int32, baseVo
|
||||
if found {
|
||||
bagItem.AddItemNum(itemNum, nowTime)
|
||||
} else {
|
||||
|
||||
bagItem.AccountId = accountId
|
||||
bagItem.ItemId = itemId
|
||||
bagItem.ItemNum = itemNum
|
||||
bagItem.CreateTime = nowTime
|
||||
bagItem.ModifyTime = nowTime
|
||||
bagItem.Create()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user