This commit is contained in:
cdle 2021-08-19 13:59:31 +08:00
parent 06f0f3d19e
commit 57645e30c1

View File

@ -210,12 +210,12 @@ func (ck *JdCookie) OutPool() (string, error) {
us[Available] = True
us[PtKey] = jp.PtKey
}
e := tx.Where(fmt.Sprintf("%s = '%s'", Available, True)).Model(ck).Updates(us).RowsAffected
e := tx.Model(ck).Updates(us).RowsAffected
if e == 0 {
tx.Rollback()
return "", nil
}
ck.Available = True
ck.Available = us[Available].(string)
ck.PtKey = jp.PtKey
return jp.PtKey, tx.Commit().Error
}