|
@@ -134,12 +134,12 @@ func BindUser(unionId, openId, phone, email, areaCode string) (userItem *models.
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if !userItem.IsSubscribed {
|
|
|
- userRecord, er := models.GetUserRecordByUnionId(userItem.UnionId)
|
|
|
- if er != nil && er.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("获取用户关注记录失败")
|
|
|
- return
|
|
|
- }
|
|
|
+ userRecord, er := models.GetUserRecordByUnionId(userItem.UnionId)
|
|
|
+ if er != nil && er.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("获取用户关注记录失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if !userItem.IsSubscribed && userRecord != nil {
|
|
|
userRecord.UserId = userId
|
|
|
er = userRecord.Update([]string{"user_id"})
|
|
|
if er != nil {
|