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) {
|
func (this *award) AddItem(accountId string, itemId int32, itemNum int32, baseVo *vo.BaseVo) {
|
||||||
|
nowTime := f5.GetApp().GetRealSeconds()
|
||||||
itemMeta := mt.Table.Item.GetById(int64(itemId))
|
itemMeta := mt.Table.Item.GetById(int64(itemId))
|
||||||
if itemMeta == nil {
|
if itemMeta == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if itemMeta.GetItemType() == constant.ITEM_TYPE_SPEC_DICE {
|
if itemMeta.GetItemType() == constant.ITEM_TYPE_SPEC_DICE {
|
||||||
|
user := new(model.User)
|
||||||
|
if err, found := user.Find(accountId, nowTime); err == nil && found {
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
nowTime := int32(f5.GetApp().GetRealSeconds())
|
|
||||||
bagItem := new(model.Bag)
|
bagItem := new(model.Bag)
|
||||||
if err, found := bagItem.Find(accountId, itemId); err == nil {
|
if err, found := bagItem.Find(accountId, itemId); err == nil {
|
||||||
if found {
|
if found {
|
||||||
bagItem.AddItemNum(itemNum, nowTime)
|
bagItem.AddItemNum(itemNum, int32(nowTime))
|
||||||
} else {
|
} else {
|
||||||
bagItem.AccountId = accountId
|
bagItem.AccountId = accountId
|
||||||
bagItem.ItemId = itemId
|
bagItem.ItemId = itemId
|
||||||
bagItem.ItemNum = itemNum
|
bagItem.ItemNum = itemNum
|
||||||
bagItem.CreateTime = nowTime
|
bagItem.CreateTime = int32(nowTime)
|
||||||
bagItem.ModifyTime = nowTime
|
bagItem.ModifyTime = int32(nowTime)
|
||||||
bagItem.Create()
|
bagItem.Create()
|
||||||
}
|
}
|
||||||
baseVo.GetOrCreateAward().AddItem(itemId, itemNum)
|
baseVo.GetOrCreateAward().AddItem(itemId, itemNum)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user