Ver código fonte

社媒账号信息边界条件

Ethan 5 dias atrás
pai
commit
de364624fb

+ 3 - 3
app/dao/platform_kuaishou_user_info_dao.go

@@ -6,9 +6,9 @@ import (
 
 type PlatformKuaishouUserInfoDao struct{}
 
-func (d PlatformKuaishouUserInfoDao) GetUserInfo(openId string) (*entity.PlatformKuaishouUserInfo, error) {
-	var userInfo *entity.PlatformKuaishouUserInfo
-	err := Db.Model(entity.PlatformKuaishouUserInfo{}).Select("open_id, platform_id, nick_name, head_uri, city, gender").Where("open_id = ?", openId).Find(userInfo).Error
+func (d PlatformKuaishouUserInfoDao) GetUserInfo(openId string) (entity.PlatformKuaishouUserInfo, error) {
+	var userInfo entity.PlatformKuaishouUserInfo
+	err := Db.Model(&entity.PlatformKuaishouUserInfo{}).Select("open_id, platform_id, nick_name, head_uri, city, gender").Where("open_id = ?", openId).Find(&userInfo).Error
 	if err != nil {
 		userInfo.OpenID = openId
 		userInfo.NickName = ""

+ 2 - 2
app/dao/talent_info_dao.go

@@ -9,8 +9,8 @@ import (
 type TalentInfoDao struct{}
 
 func (d TalentInfoDao) GetTalentPhone(talentId string) (*string, error) {
-	var talentInfo *entity.YoungeeTalentInfo
-	err := Db.Model(entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
+	var talentInfo entity.YoungeeTalentInfo
+	err := Db.Model(&entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
 	if err != nil {
 		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
 		return nil, err