|
- package db
-
- import (
- "code.fnuoos.com/go_rely_warehouse/zyos_go_day_luck_draw.git/db/model"
- "xorm.io/xorm"
- )
-
- // UserFindByMobile search user by mobile
- func UserFindByMobile(Db *xorm.Engine, mobile string) (*model.User, error) {
- var m model.User
- if has, err := Db.Where("phone = ? AND delete_at = 0", mobile, mobile).
- Get(&m); err != nil || has == false {
- return nil, err
- }
- return &m, nil
- }
-
- func UserProfileFindByIDWithSession(sess *xorm.Session, id interface{}) (*model.UserProfile, error) {
- var m model.UserProfile
- if has, err := sess.Where("uid = ?", id).
- Get(&m); err != nil || has == false {
- return nil, err
- }
- return &m, nil
- }
|