This commit is contained in:
@@ -36,12 +36,16 @@ func (s *ItemService) UPDATE(id uint32, count int) {
|
||||
return
|
||||
}
|
||||
m := s.dbm(s.Model)
|
||||
|
||||
if t, _ := m.Where("item_id", id).Exist(); t {
|
||||
ok, err := m.Where("item_id", id).Exist()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if ok {
|
||||
_, err := s.dbm(s.Model).Where("item_id", id).Increment("item_cnt", count)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
} else {
|
||||
m := s.dbm(s.Model)
|
||||
data := g.Map{
|
||||
|
||||
Reference in New Issue
Block a user