1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-22 23:09:51 +08:00
committed by cnb
parent 91b938fd54
commit 236965cc63

View File

@@ -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{