From e3f46eb3568349c0eeefe461823af11125702852 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 17 Aug 2024 11:56:15 +0800 Subject: [PATCH] 1 --- server/backtask/service/user.go | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/server/backtask/service/user.go b/server/backtask/service/user.go index ecf4ce09..ddd062bd 100644 --- a/server/backtask/service/user.go +++ b/server/backtask/service/user.go @@ -5,6 +5,7 @@ import ( "f5" "main/constant" "fmt" + "strings" "jccommon" ) @@ -29,20 +30,23 @@ func GetAccountIdByAddress(accountAddress string) string { func GetAccountIdByEmail(email string) string { accountId := "" - f5.GetGoStyleDb().OrmSelectOne( - constant.ACCOUNT_DB, - "t_immutable_account", - [][]string { - {"email", email}, - }, - func (err error, ds *f5.DataSet) { - if err != nil { - return - } - if ds.Next() { - accountId = ds.GetByName("account_id") - } - }) + email = strings.ToLower(email) + if email != "" { + f5.GetGoStyleDb().OrmSelectOne( + constant.ACCOUNT_DB, + "t_immutable_account", + [][]string { + {"lower_case_email", email}, + }, + func (err error, ds *f5.DataSet) { + if err != nil { + return + } + if ds.Next() { + accountId = ds.GetByName("account_id") + } + }) + } return accountId }