- authType userID2 to userid2

This commit is contained in:
gazebo
2019-03-05 12:06:24 +08:00
parent 5d0b5ec360
commit 8a1425c4d0
4 changed files with 12 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals"
)
func GetUserByID(db *DaoDB, fieldName, fieldValue string) (user *model.User, err error) {
@@ -13,7 +14,12 @@ func GetUserByID(db *DaoDB, fieldName, fieldValue string) (user *model.User, err
FROM user t1
WHERE t1.deleted_at = ? AND t1.%s = ?
`, fieldName)
err = GetRow(db, &user, sql, utils.DefaultTimeValue, fieldValue)
sqlParams := []interface{}{
utils.DefaultTimeValue,
fieldValue,
}
globals.SugarLogger.Debugf("GetUserByID sql:%s, sqlParams:%s", sql, utils.Format4Output(sql, false))
err = GetRow(db, &user, sql, sqlParams...)
return user, err
}