fix: 修复改价条件判断错误
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-13 16:06:49 +08:00
committed by cnb
parent faad50b1df
commit 49b8b6d301

View File

@@ -59,7 +59,7 @@ func (s *PetService) UPdatePrice(ctime uint32, Price uint32, is_sale uint32) err
}
var p model.Pet
s.dbm(s.Model).Where("catch_time", ctime).Scan(&p)
if p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格
if p.SalePrice!=0&&p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格
return fmt.Errorf("一天只允许改价一次")
}
res0, err := s.dbm(s.Model).