- user2
This commit is contained in:
18
business/model/dao/dao_user2.go
Normal file
18
business/model/dao/dao_user2.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
func GetUserByID(db *DaoDB, fieldName, fieldValue string) (user *model.User, err error) {
|
||||
sql := fmt.Sprintf(`
|
||||
SELECT *
|
||||
FROM user t1
|
||||
WHERE t1.deleted_at = ? AND t1.%s = ?
|
||||
`, fieldName)
|
||||
err = GetRows(db, &user, sql, utils.DefaultTimeValue, fieldValue)
|
||||
return user, err
|
||||
}
|
||||
Reference in New Issue
Block a user