1
This commit is contained in:
parent
dfa6ee5671
commit
e7b58ef886
@ -18,24 +18,27 @@ func (this *award) unInit() {
|
||||
}
|
||||
|
||||
func (this *award) AddItem(accountId string, itemId int32, itemNum int32, baseVo *vo.BaseVo) {
|
||||
nowTime := f5.GetApp().GetRealSeconds()
|
||||
itemMeta := mt.Table.Item.GetById(int64(itemId))
|
||||
if itemMeta == nil {
|
||||
return
|
||||
}
|
||||
if itemMeta.GetItemType() == constant.ITEM_TYPE_SPEC_DICE {
|
||||
user := new(model.User)
|
||||
if err, found := user.Find(accountId, nowTime); err == nil && found {
|
||||
}
|
||||
return
|
||||
}
|
||||
nowTime := int32(f5.GetApp().GetRealSeconds())
|
||||
bagItem := new(model.Bag)
|
||||
if err, found := bagItem.Find(accountId, itemId); err == nil {
|
||||
if found {
|
||||
bagItem.AddItemNum(itemNum, nowTime)
|
||||
bagItem.AddItemNum(itemNum, int32(nowTime))
|
||||
} else {
|
||||
bagItem.AccountId = accountId
|
||||
bagItem.ItemId = itemId
|
||||
bagItem.ItemNum = itemNum
|
||||
bagItem.CreateTime = nowTime
|
||||
bagItem.ModifyTime = nowTime
|
||||
bagItem.CreateTime = int32(nowTime)
|
||||
bagItem.ModifyTime = int32(nowTime)
|
||||
bagItem.Create()
|
||||
}
|
||||
baseVo.GetOrCreateAward().AddItem(itemId, itemNum)
|
||||
|
Loading…
x
Reference in New Issue
Block a user