|
@@ -159,7 +159,7 @@ func formatWxUser(wxUser *models.WxUserItem, platform int) {
|
|
|
}
|
|
|
|
|
|
//用户绑定
|
|
|
-func BindWxUser(openid, mobile, email string, registerPlatform int) (wxUser *models.WxUserItem, err error) {
|
|
|
+func BindWxUser(openid, mobile, email, areaNum string, registerPlatform int) (wxUser *models.WxUserItem, err error) {
|
|
|
source := 1 //绑定来源,1:微信端,2:pc网页端,3:查研观向小程序,4:每日咨询
|
|
|
if mobile == "" && email == "" {
|
|
|
err = errors.New("手机号或邮箱必填一个")
|
|
@@ -204,16 +204,19 @@ func BindWxUser(openid, mobile, email string, registerPlatform int) (wxUser *mod
|
|
|
}
|
|
|
utils.Rc.SetNX(key, "ok", time.Second*300)
|
|
|
user := &models.WxUser{
|
|
|
- CompanyId: 1,
|
|
|
- CreatedTime: time.Now(),
|
|
|
- FirstLogin: 1,
|
|
|
- Enabled: 1,
|
|
|
- RegisterPlatform: registerPlatform, //账号注册来源,注册平台,1:微信端,2:PC网页端
|
|
|
- RegisterTime: time.Now(),
|
|
|
- Mobile: mobile,
|
|
|
- Email: email,
|
|
|
- IsRegister: 1,
|
|
|
- Source: source,
|
|
|
+ CompanyId: 1,
|
|
|
+ CreatedTime: time.Now(),
|
|
|
+ FirstLogin: 1,
|
|
|
+ Enabled: 1,
|
|
|
+ RegisterPlatform: registerPlatform, //账号注册来源,注册平台,1:微信端,2:PC网页端
|
|
|
+ RegisterTime: time.Now(),
|
|
|
+ Mobile: mobile,
|
|
|
+ Email: email,
|
|
|
+ IsRegister: 1,
|
|
|
+ Source: source,
|
|
|
+ CountryCode: areaNum,
|
|
|
+ OutboundMobile: mobile,
|
|
|
+ OutboundCountryCode: areaNum,
|
|
|
}
|
|
|
tmpUserId, addUserErr := models.AddWxUser(user)
|
|
|
//添加完成,清除缓存
|