From a9c57ef016e781ae92e93e3e6a6dfc62cf766a31 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sun, 15 Dec 2024 19:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=AD=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/user.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dao/user.go b/dao/user.go index a725174..7da04ed 100644 --- a/dao/user.go +++ b/dao/user.go @@ -116,6 +116,10 @@ func AddUserSync(req proto.UserAddOrUpdate) uint { if res.Error != nil { return 0 } + res = DB.Exec("update users set created_at=null where id=?", req.ID) + if res.Error != nil { + return 0 + } return req.ID } @@ -125,6 +129,10 @@ func UpdateUserSync(req proto.UserAddOrUpdate) uint { if res.Error != nil { return 0 } + res = DB.Exec("update users set created_at=null where id=?", req.ID) + if res.Error != nil { + return 0 + } return req.ID }