正在显示
1 个修改的文件
包含
8 行增加
和
1 行删除
| @@ -66,7 +66,14 @@ func (repository *PushDeviceRepository) UpdateDevice(uid int64, clientId, device | @@ -66,7 +66,14 @@ func (repository *PushDeviceRepository) UpdateDevice(uid int64, clientId, device | ||
| 66 | o := orm.NewOrm() | 66 | o := orm.NewOrm() |
| 67 | o.Begin() | 67 | o.Begin() |
| 68 | //更新(这个项目)其他绑定这个client_id的设备 is_active=0 | 68 | //更新(这个项目)其他绑定这个client_id的设备 is_active=0 |
| 69 | - _, err := o.Raw("UPDATE push_device_info SET update_at=now(),is_active=0 where client_id=? and is_active=1 and project=?", clientId, project).Exec() | 69 | + _, err := o.Raw("UPDATE push_device_info SET update_at=now(),is_active=0 where client_id=? and project=? and is_active=1", clientId, project).Exec() |
| 70 | + if err != nil { | ||
| 71 | + o.Rollback() | ||
| 72 | + return err | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + //更新(这个项目)uid绑定的其他设备 is_active=0 | ||
| 76 | + _, err = o.Raw("UPDATE push_device_info SET update_at=now(),is_active=0 where uid=? and project=? and is_active=1", uid, project).Exec() | ||
| 70 | if err != nil { | 77 | if err != nil { |
| 71 | o.Rollback() | 78 | o.Rollback() |
| 72 | return err | 79 | return err |
-
请 注册 或 登录 后发表评论