This commit is contained in:
gazebo
2019-03-03 22:20:07 +08:00
parent af38ab535b
commit 6793e7443d
16 changed files with 330 additions and 59 deletions

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