fix(god):修复并调整SQL语句。

This commit is contained in:
徐涛 2022-09-07 13:15:19 +08:00
parent ab92f22c85
commit 466d21e8b4

View File

@ -553,6 +553,7 @@ func (g _GodModeService) DeleteUser(userId string) (bool, error) {
Table(new(model.Park)).
Where(builder.Eq{"user_id": userId}).
NoAutoCondition().
Unscoped().
Select("id").
Find(&parkIds)
if err != nil {
@ -594,7 +595,7 @@ func (g _GodModeService) DeleteUser(userId string) (bool, error) {
result = result && (rows >= 0)
}
// 删除用户基本索引数据
res, err = tx.Exec("delete from user where id=?", userId)
res, err = tx.Exec("delete from `user` where id=?", userId)
if err != nil {
tx.Rollback()
return false, err