feat(pet): 添加宠物自由状态管理功能 - 在ServiceList和ServicePage方法中添加WhereNot条件支持 - 将宠物销售状态改为自由状态,新增free字段来标识三种状态: 0为放入仓库,1为放生,2为上架 - 修改PetInfo、UPdateFree、UPdatePrice等方法以支持新的状态逻辑 - 更新BuyPet方法中的验证逻辑 - 调整查询操作中的字段过滤条件 ```
This commit is contained in:
@@ -254,6 +254,8 @@ func (s *Service) ServiceList(ctx context.Context, req *ListReq) (data interface
|
||||
if len(v) == 3 {
|
||||
if gconv.Bool(v[2]) {
|
||||
m.Where(v[0], v[1])
|
||||
} else {
|
||||
m.WhereNot(gconv.String(v[0]), v[1])
|
||||
}
|
||||
}
|
||||
if len(v) == 2 {
|
||||
@@ -357,6 +359,8 @@ func (s *Service) ServicePage(ctx context.Context, req *PageReq) (data interface
|
||||
if len(v) == 3 {
|
||||
if gconv.Bool(v[2]) {
|
||||
m.Where(v[0], v[1])
|
||||
} else {
|
||||
m.WhereNot(gconv.String(v[0]), v[1])
|
||||
}
|
||||
}
|
||||
if len(v) == 2 {
|
||||
|
||||
Reference in New Issue
Block a user