定制每日抽奖
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
652 B

  1. package db
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_day_luck_draw.git/db/model"
  4. "xorm.io/xorm"
  5. )
  6. // UserFindByMobile search user by mobile
  7. func UserFindByMobile(Db *xorm.Engine, mobile string) (*model.User, error) {
  8. var m model.User
  9. if has, err := Db.Where("phone = ? AND delete_at = 0", mobile, mobile).
  10. Get(&m); err != nil || has == false {
  11. return nil, err
  12. }
  13. return &m, nil
  14. }
  15. func UserProfileFindByIDWithSession(sess *xorm.Session, id interface{}) (*model.UserProfile, error) {
  16. var m model.UserProfile
  17. if has, err := sess.Where("uid = ?", id).
  18. Get(&m); err != nil || has == false {
  19. return nil, err
  20. }
  21. return &m, nil
  22. }