```
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

feat(pet): 添加宠物是否可售状态字段

新增is_sale字段用于控制宠物是否可售,
同时修改价格更新接口以支持设置销售状态
```
This commit is contained in:
昔念
2026-03-11 01:30:31 +08:00
parent b0130f39d5
commit 6430de9c5d
2 changed files with 4 additions and 4 deletions

View File

@@ -46,9 +46,8 @@ func (s *PetService) UPdateFree(ctime uint32, free uint32) {
).Update()
}
func (s *PetService) UPdatePrice(ctime uint32, Price float32) {
s.dbm(s.Model).Where("catch_time", ctime).Data("sale_price", Price).Update()
func (s *PetService) UPdatePrice(ctime uint32, Price float32, is_sale uint32) {
s.dbm(s.Model).Where("catch_time", ctime).Data("sale_price", Price, "is_sale", is_sale).Update()
}
func (s *PetService) BuyPet(pid uint32) error {