This commit is contained in:
aozhiwei 2024-08-17 11:56:15 +08:00
parent 8ea2c287fe
commit e3f46eb356

View File

@ -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
}