platform_kuaishou_user_info_dao.go 556 B

123456789101112131415161718
  1. package dao
  2. import (
  3. "github.com/sirupsen/logrus"
  4. "youngee_b_api/app/entity"
  5. )
  6. type PlatformKuaishouUserInfoDao struct{}
  7. func (d PlatformKuaishouUserInfoDao) SelectUserInfo(talentId string) (*entity.PlatformKuaishouUserInfo, error) {
  8. var userInfo *entity.PlatformKuaishouUserInfo
  9. err := Db.Model(entity.PlatformKuaishouUserInfo{}).Select("open_id, nick_name, head_uri").Where("talent_id = ?", talentId).Find(&userInfo).Error
  10. if err != nil {
  11. logrus.Errorf("[SelectUserInfo] error query, err:%+v", err)
  12. return nil, err
  13. }
  14. return userInfo, nil
  15. }