上传道具最后操作时间
This commit is contained in:
parent
24efd14c67
commit
8d9708ccc4
@ -57,18 +57,6 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
|
|||||||
if code = this.module.AddItemforGrid(&comm.ModuleCallSource{}, session, req.GridId, -1*int32(req.Amount), true); code != pb.ErrorCode_Success {
|
if code = this.module.AddItemforGrid(&comm.ModuleCallSource{}, session, req.GridId, -1*int32(req.Amount), true); code != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// item.Amount = item.Amount - req.Amount
|
|
||||||
// if item.Amount == 0 {
|
|
||||||
// if err = this.module.modelItems.DelUserPack(session.GetUserId(), item.GridId); err != nil {
|
|
||||||
// code = pb.ErrorCode_DBError
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if err = this.module.modelItems.UpdateUserPack(session.GetUserId(), item); err != nil {
|
|
||||||
// code = pb.ErrorCode_DBError
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
session.SendMsg(string(this.module.GetType()), "useitem", &pb.ItemsUseItemResp{GridId: req.GridId, Amount: req.Amount, Issucc: true})
|
session.SendMsg(string(this.module.GetType()), "useitem", &pb.ItemsUseItemResp{GridId: req.GridId, Amount: req.Amount, Issucc: true})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ func (this *ModelItemsComp) UpdateUserPack(uid string, itmes ...*pb.DB_UserItemD
|
|||||||
this.ChangeList(uid, v.GridId, map[string]interface{}{
|
this.ChangeList(uid, v.GridId, map[string]interface{}{
|
||||||
"amount": v.Amount,
|
"amount": v.Amount,
|
||||||
"isNewItem": v.IsNewItem,
|
"isNewItem": v.IsNewItem,
|
||||||
|
"lastopt": time.Now().Unix(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user