From 466d21e8b48aa397404986b32f2971ce27550e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Wed, 7 Sep 2022 13:15:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(god):=E4=BF=AE=E5=A4=8D=E5=B9=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4SQL=E8=AF=AD=E5=8F=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/god_mode.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service/god_mode.go b/service/god_mode.go index 1edc302..9649f90 100644 --- a/service/god_mode.go +++ b/service/god_mode.go @@ -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