abiao пре 5 година
родитељ
комит
501bb4a72f

+ 0 - 2
go/gopath/src/fohow.com/apps/controllers/railsadmin_controller/intro_user_controller.go

@@ -22,8 +22,6 @@ func (self *RailsadminController) UpdateIntroUser() {
 		self.ReturnError(403, apps.NoExist, "", nil)
 	}
 	//升级群主,打开推广模块
-	wxUser.ProductBenefitRate = 15
-	wxUser.SecondProductBenefitRate = 8
 	wxUser.ShowInviteMode = int64(1)
 	wxUser.Save()
 

+ 0 - 268
go/gopath/src/fohow.com/apps/controllers/user_controller/binding_controller.go

@@ -95,271 +95,3 @@ func (self *UserController) BindingTel() {
 	self.Data["json"] = user
 	self.ServeJSON()
 }
-
-// //获取用户绑定状态
-// func (self *UserController) GetCurrentUserBindingState() {
-// 	user := self.GetCurrentUser(false)
-// 	wxUser := self.GetCurrentWxUser(false)
-// 	if wxUser == nil && user == nil {
-// 		self.ReturnError(403, apps.UserNeedLogin, "", nil)
-// 	}
-// 	type CurrentUser struct {
-// 		User         *user_model.User   `orm:"-"                                  json:"user"`
-// 		WxUser       *user_model.WxUser `orm:"-"                               json:"wx_user"`
-// 		WxBindingUrl string             `orm:"-"                               json:"wx_binding_url"`
-// 	}
-
-// 	bindingUrl := ""
-
-// 	//防止在其他端绑定,这里要再次做校验
-// 	if wxUser == nil && user != nil {
-// 		wxUser = user_model.GetWxUserByUserId(user.Id, false)
-// 	}
-
-// 	if wxUser != nil && user == nil {
-// 		if wxUser.UserId != 0 {
-// 			user = user_model.GetUserById(wxUser.UserId, false)
-// 		}
-// 	}
-
-// 	if wxUser == nil && user != nil {
-
-// 		uuId := tool.Get8Uuid()
-// 		k := fmt.Sprintf("user_controller.BindingWxUser[%s]", uuId)
-// 		cache.Cache.Put(k, user.Id, 20*time.Minute)
-// 		bindingUrl = fmt.Sprintf("%s/v1/tool/qrcode?url=%s/v1/user/binding/wx/%s",
-// 			beego.AppConfig.String("ApiHost"), beego.AppConfig.String("ApiHost"), uuId)
-
-// 		// fmt.Println("************* bindingUrl: %s", bindingUrl)
-// 	}
-
-// 	currentUser := new(CurrentUser)
-// 	if user != nil {
-// 		user.Head = user_model.GetFullImgUrl(user.Head)
-// 	}
-// 	if wxUser != nil {
-// 		wxUser.Head = user_model.GetFullImgUrl(wxUser.Head)
-// 	}
-// 	currentUser.User = user
-// 	currentUser.WxUser = wxUser
-// 	currentUser.WxBindingUrl = bindingUrl
-
-// 	self.Data["json"] = currentUser
-// 	self.ServeJSON()
-// }
-
-// //绑定微信用户
-// func (self *UserController) BindingWxUser() {
-// 	uuId := self.Ctx.Input.Param(":key")
-// 	var userId int64
-// 	//从缓存中取到待绑定userId
-// 	k := fmt.Sprintf("user_controller.BindingWxUser[%s]", uuId)
-// 	if r, ok := cache.Cache.Get(k).(int64); ok {
-// 		userId = r
-// 	}
-// 	//校验user存在
-// 	user := user_model.GetUserById(userId, false)
-// 	if user == nil {
-// 		self.ReturnError(403, apps.BindingWxUserError, "", nil)
-// 	}
-// 	//校验wx_user已登录,且记录被创建
-// 	wxUser := self.GetCurrentWxUser(false)
-// 	if wxUser == nil {
-// 		self.ReturnError(403, apps.BindingWxUserError, "", nil)
-// 	}
-
-// 	//确保没有wx_user绑定过该user_id
-// 	existedWxUser := user_model.GetWxUserByUserId(user.Id, false)
-// 	if wxUser.UserId == 0 && existedWxUser == nil {
-// 		//绑定微信user和user
-// 		wxUser.UserId = user.Id
-// 		wxUser.Save()
-// 		user.CopyWxUserHead(wxUser.Head)
-// 		if user.Nickname == "" {
-// 			user.Nickname = wxUser.Nickname
-// 		}
-// 		if user.Country == "" {
-// 			user.Country = wxUser.Country
-// 		}
-// 		if user.Province == "" {
-// 			user.Province = wxUser.Province
-// 		}
-// 		if user.City == "" {
-// 			user.City = wxUser.City
-// 		}
-// 		if user.Sex == 0 {
-// 			user.Sex = wxUser.Sex
-// 		}
-// 		user.Save()
-// 		cache.Cache.Delete(k)
-// 	} else {
-// 		self.ReturnError(403, apps.BindingWxUserError, "", nil)
-// 	}
-// 	self.Redirect(fmt.Sprintf("%s/user/binding/state", beego.AppConfig.String("WxHost")), 302)
-// }
-
-// //绑定身份证
-// func (self *UserController) BindingIdCard() {
-// 	idCard := self.GetString("identity_card")
-// 	realName := self.GetString("real_name")
-// 	user := self.GetCurrentUser(false)
-// 	if user.IsCertification == 1 {
-// 		self.ReturnError(403, apps.UserHasBindIdCard, "", nil)
-// 	}
-// 	if idCard == "" || realName == "" {
-// 		self.ReturnError(403, apps.BindingIdCardEmpty, "", nil)
-// 	}
-
-// 	idCardLength := len(idCard)
-// 	if idCardLength != 15 && idCardLength != 18 {
-// 		self.ReturnError(403, apps.BindingIdCardLengthError, "", nil)
-// 	}
-
-// 	userWithIdCard := user_model.GetUserByIdCardNo(idCard, false)
-// 	if userWithIdCard != nil {
-// 		self.ReturnError(403, apps.BindingIdCardExist, "", nil)
-// 	}
-
-// 	user.RealName = realName
-// 	user.IdentityCard = idCard
-// 	user.IsCertification = 1
-// 	birth, err := time.Parse("20060102", idCard[6:14])
-// 	if err == nil {
-// 		user.Birthday = birth
-// 	}
-
-// 	age, getAagError := getAgeByIdCardNo(user.IdentityCard)
-// 	if getAagError == nil {
-// 		user.Age = age
-// 	}
-
-// 	user.Save()
-
-// 	self.Data["json"] = user
-// 	self.ServeJSON()
-// }
-
-// //根据身份证获取年龄
-// func getAgeByIdCardNo(idCardNo string) (int64, error) {
-// 	age, err := user.CaculateAgeByIdCard(idCardNo)
-// 	if err != nil {
-// 		return 0, err
-// 	}
-// 	return age, nil
-// }
-
-// //迁移余额,春节翻红包专题
-// func moveFHBBalance(wxUser *user_model.WxUser, user *user_model.User) {
-// 	list := balance_model.GetValidWxBalances(wxUser.Id, balance_model.WX_BALANCE_SOURCE_NEW_YEAR_FHB_2017)
-// 	for _, item := range list {
-// 		//标记迁移
-// 		item.State = 1
-// 		item.Save()
-// 		go new(balance_model.Balance).Create(user.Id, item.Amount, item.Source,
-// 			item.RelateId, item.Remark, 1)
-// 	}
-// }
-
-// //迁移wx user balance 中数据到balance
-// func moveWxBalacneToBalance(wxUser *user_model.WxUser, user *user_model.User) {
-// 	list := balance_model.GetAllValidWxBalances(wxUser.Id)
-// 	for _, item := range list {
-// 		//标记迁移
-// 		item.State = 1
-// 		item.Save()
-// 		new(balance_model.Balance).Create(user.Id, item.Amount, item.Source,
-// 			item.RelateId, item.Remark, 1)
-// 	}
-// }
-
-// //更新wxUser上下级的邀请关系。仅适用于user先创建,wxuser后绑定的情况
-// func updateInviteRelation(wxUser *user_model.WxUser, user *user_model.User) {
-// 	if wxUser == nil || user == nil {
-// 		return
-// 	}
-
-// 	//user有邀请人时才执行更新上级的动作
-// 	if user.InviteId != 0 {
-// 		wxInviter := user_model.GetWxUserByUserId(user.InviteId, true)
-// 		//更新上级:微信用户的邀请人与User的邀请人有冲突,以user为准
-// 		if wxInviter != nil && wxUser.InviteId != wxInviter.Id {
-// 			//更新树型结构中受益人
-// 			orgWxInviter := user_model.GetWxUserById(wxUser.InviteId, true)
-// 			if orgWxInviter != nil {
-// 				list := user_model.GetWxBindingBenefitRecords(wxUser.Id, orgWxInviter.Id)
-// 				for _, item := range list {
-// 					//变更受益人
-// 					item.BenefitWxUId = wxInviter.Id
-// 					item.Save()
-// 				}
-
-// 				//删除间接邀请绑定记录
-// 				inDirectList := user_model.GetIndirectWxBindingBenefitRecords(wxUser.Id, orgWxInviter.Id)
-// 				for _, item := range inDirectList {
-// 					item.Delete()
-// 				}
-// 			}
-// 			//更新wxUser邀请人
-// 			wxUser.InviteId = wxInviter.Id
-// 			wxUser.UpdateField("InviteId")
-// 			beego.BeeLogger.Warn("Wxuser Inviter Relationship-binding1, wxUserId:%d, inviteId:%d, userId: %d, tel: %d, userInviteId: %d", wxUser.Id, wxUser.InviteId, user.Id, user.Tel, user.InviteId)
-// 		}
-// 	}
-
-// 	//更新下级
-// 	list := user_model.GetInviteList(user.Id, 1, 99999, false)
-// 	for _, child := range list {
-// 		wxChild := user_model.GetWxUserByUserId(child.Id, false)
-// 		if wxChild != nil && wxChild.InviteId != wxUser.Id {
-// 			//更新树型结构受益人
-// 			orgWxChildInviter := user_model.GetWxUserById(wxChild.InviteId, true)
-// 			if orgWxChildInviter != nil {
-// 				// user_model.UpdateBenefitWxUId(wxUser.Id, orgWxInviter.Id, wxInviter.Id)
-// 				list := user_model.GetWxBindingBenefitRecords(wxChild.Id, orgWxChildInviter.Id)
-// 				for _, item := range list {
-// 					//变更受益人
-// 					item.BenefitWxUId = wxUser.Id
-// 					item.Save()
-// 				}
-// 			}
-
-// 			//更新wxUser邀请人
-// 			wxChild.InviteId = wxUser.Id
-// 			wxChild.UpdateField("InviteId")
-// 			beego.BeeLogger.Warn("Wxuser Inviter Relationship-binding2, wxUserId:%d, inviteId:%d", wxUser.Id, wxUser.InviteId)
-// 		}
-// 	}
-// }
-
-// //给邀请人发送绑定手机通知
-// func sendBindingMsgToInviter(wxUser *user_model.WxUser, user *user_model.User) {
-// 	if wxUser == nil || user == nil {
-// 		return
-// 	}
-
-// 	wxInviter := user_model.GetWxUserById(wxUser.InviteId, true)
-// 	if wxInviter != nil {
-// 		now := time.Now()
-// 		//给直属邀请人发邀请成功通知
-// 		openId := wxInviter.MpOpenid
-// 		url := fmt.Sprintf("%s/user/promot", beego.AppConfig.String("MHost"))
-// 		title := "有人通过您的邀请注册成功。若TA投资项目,您将获得投资金额1%的奖励\n"
-// 		telwStar := tool.ReplaceTelMid4(user.Tel)
-// 		cTime := now.Format("2006-01-02 15:04:05")
-// 		remark := "\n点击详情,可以看一看TA"
-// 		wx_mp.TmplmsgInviteSignUp(openId, url, title, wxUser.Nickname, telwStar, cTime, remark)
-
-// 		// 取消二级关系
-// 		// preWxInviter := user_model.GetWxUserById(wxInviter.InviteId, true)
-// 		// if preWxInviter != nil {
-// 		// 	//给间接邀请人发注册成功通知
-// 		// 	openId := preWxInviter.MpOpenid
-// 		// 	url := fmt.Sprintf("%s/user/promot", beego.AppConfig.String("MHost"))
-// 		// 	title := fmt.Sprintf("有人通过%s的邀请注册成功。若TA投资项目,您将获得投资金额3‰的奖励\n", wxInviter.Nickname)
-// 		// 	telwStar := tool.ReplaceTelMid4(user.Tel)
-// 		// 	cTime := now.Format("2006-01-02 15:04:05")
-// 		// 	remark := "\n点击详情,可以看一看TA"
-// 		// 	wx_mp.TmplmsgInviteSignUp(openId, url, title, wxUser.Nickname, telwStar, cTime, remark)
-// 		// }
-// 	}
-// }

+ 1 - 26
go/gopath/src/fohow.com/apps/controllers/user_controller/binding_wx_phone_controller.go

@@ -2,10 +2,10 @@ package user_controller
 
 import (
 	"encoding/json"
-	"github.com/astaxie/beego"
 	"fohow.com/apps"
 	"fohow.com/apps/helpers"
 	"fohow.com/apps/models/user_model"
+	"github.com/astaxie/beego"
 )
 
 func (self *UserController) BindingWxPhone() {
@@ -98,7 +98,6 @@ func (self *UserController) BindingWxPhone() {
 		user.City = wxUser.City
 		user.Sex = wxUser.Sex
 		user.Save()
-		go user_model.UpdateIsRegistD5c(user)
 		// 如果微信用户已绑定手机,则找出userId,并且赋值给session[userId]
 		if wxUser != nil && wxUser.UserId > 0 {
 			self.SetSession(apps.SessionWxUserKey, wxUser.Id)
@@ -109,27 +108,3 @@ func (self *UserController) BindingWxPhone() {
 	self.ServeJSON()
 
 }
-
-//
-//func (self *UserController)CheckParamsIsValid(phonumer, sign, tistamp string) bool {
-//
-//	bindingWxPhoneKey := beego.AppConfig.String("BindingWxPhoneKey")
-//
-//	var KVArray []string
-//	tpKV := fmt.Sprintf("%s=%s", "phonumer", phonumer)
-//	tistampKV := fmt.Sprintf("%s=%s", "tistamp", tistamp)
-//	KVArray = append(KVArray, tpKV)
-//	KVArray = append(KVArray, tistampKV)
-//	sort.Strings(KVArray)
-//
-//	KVArray = append(KVArray, fmt.Sprintf("%s=%s", "salt", bindingWxPhoneKey))
-//
-//	var KVString = strings.Join(KVArray, "&")
-//
-//	md5Ctx := md5.New()
-//	md5Ctx.Write([]byte(KVString))
-//	val := md5Ctx.Sum(nil)
-//	calSign := hex.EncodeToString(val)
-//	beego.BeeLogger.Warn("BindingWxPhone-calSign:%s", calSign)
-//	return calSign == sign
-//}

+ 3 - 3
go/gopath/src/fohow.com/apps/controllers/user_controller/init.go

@@ -21,9 +21,9 @@ import (
 
 var (
 	exceptCheckUserLoginAction = []string{"BindingTel", "UpdateWxUserInfo",
-		"CheckLogin", "UpdateIsRegistD5cAndIsRegistBeforeD5c", "GenerateQrcode",
-		"GetInviteList", "GetMonthlyInviteList", "OneClickBindingTel", "BindingWxPhone", "SetWxUserInviter", "GetUserCertificationFromD5c", "Get"}
-	exceptCheckWxUserLoginAction = []string{"CheckLogin", "UpdateIsRegistD5cAndIsRegistBeforeD5c"}
+		"CheckLogin", "GenerateQrcode",
+		"GetInviteList", "GetMonthlyInviteList", "OneClickBindingTel", "BindingWxPhone", "SetWxUserInviter", "Get"}
+	exceptCheckWxUserLoginAction = []string{"CheckLogin"}
 )
 
 type UserController struct {

+ 2 - 2
go/gopath/src/fohow.com/apps/controllers/user_controller/invite_controller.go

@@ -178,7 +178,7 @@ func (self *UserController) GetSecInviteList() {
 	}
 	useCache, _ := self.GetBool("cache", false)
 	wxUser := self.GetCurrentWxUser(useCache)
-	if wxUser == nil || wxUser.CopartnerState != user_model.COPARTNER_STATE_YES {
+	if wxUser == nil {
 		self.ReturnError(403, apps.NoExist, "", nil)
 	}
 
@@ -228,7 +228,7 @@ func (self *UserController) GetSecMonthlyInviteList() {
 	}
 	useCache, _ := self.GetBool("cache", false)
 	wxUser := self.GetCurrentWxUser(useCache)
-	if wxUser == nil || wxUser.CopartnerState != user_model.COPARTNER_STATE_YES {
+	if wxUser == nil {
 		self.ReturnError(403, apps.NoExist, "", nil)
 	}
 

+ 0 - 7
go/gopath/src/fohow.com/apps/controllers/user_controller/one_click_binding_controller.go

@@ -15,13 +15,7 @@ func (self *UserController) OneClickBindingTel() {
 	if wxUser.UserId != 0 {
 		self.ReturnError(403, apps.WxUserHasBindingTel, "", nil)
 	}
-
-	result := regist.GetD5cTelByUnionId(wxUser.Unionid)
 	tel := ""
-	if result != nil {
-		tel = result.D5cTel
-	}
-
 	if tel == "" {
 		self.ReturnError(403, apps.WxUserNotRegistD5c, "", nil)
 	}
@@ -56,7 +50,6 @@ func (self *UserController) OneClickBindingTel() {
 		user.Save()
 		// sign, template, action := sms_model.GetAliMsgContent(sms_model.LOGIN_PWD)
 		// go sms_model.SendSmsWithAli([]string{tel}, sign, template, action, loginPwd)
-		go user_model.UpdateIsRegistD5c(user)
 		// 如果微信用户已绑定手机,则找出userId,并且赋值给session[userId]
 		if wxUser != nil && wxUser.UserId > 0 {
 			self.SetSession(apps.SessionWxUserKey, wxUser.Id)

+ 4 - 181
go/gopath/src/fohow.com/apps/controllers/user_controller/user_controller.go

@@ -56,12 +56,10 @@ import (
 // 校验当前用户是否登录
 func (self *UserController) CheckLogin() {
 	type UserInfo struct {
-		UserId         int64 `json:"user_id"`
-		WxUserId       int64 `json:"wx_user_id"`
-		MerchantId     int64 `json:"merchant_id"`
-		IsSuperAdmin   bool  `json:"is_super_admin"`  //商家中的超级管理员
-		CopartnerState int64 `json:"copartner_state"` //合伙人状态
-		IsCopartner    bool  `json:"is_copartner"`    //是否是合伙人
+		UserId       int64 `json:"user_id"`
+		WxUserId     int64 `json:"wx_user_id"`
+		MerchantId   int64 `json:"merchant_id"`
+		IsSuperAdmin bool  `json:"is_super_admin"` //商家中的超级管理员
 	}
 	userInfo := new(UserInfo)
 	useCache, err := self.GetBool("cache", true)
@@ -75,8 +73,6 @@ func (self *UserController) CheckLogin() {
 	wxUser := self.GetCurrentWxUser(useCache)
 	if wxUser != nil {
 		userInfo.WxUserId = wxUser.Id
-		userInfo.CopartnerState = wxUser.CopartnerState
-		userInfo.IsCopartner = wxUser.CopartnerState == user_model.COPARTNER_STATE_YES
 	}
 
 	// 商户信息, 如果不是商户,则返回 0
@@ -244,52 +240,6 @@ func (self *UserController) Get() {
 	self.ServeJSON()
 }
 
-// //修改密码
-// func (self *UserController) UpdatePwd() {
-// 	pwd := self.GetString("org_pwd")
-// 	newPwd := self.GetString("new_pwd")
-// 	confirmedPwd := self.GetString("confirmed_pwd")
-// 	if newPwd != confirmedPwd {
-// 		self.ReturnError(403, apps.PasswordError, "", nil)
-// 	}
-
-// 	lengthPwd := len(newPwd)
-// 	if lengthPwd < 6 || lengthPwd > 20 {
-// 		self.ReturnError(403, apps.PasswordLengthError, "", nil)
-// 	}
-
-// 	md5Ctx := md5.New()
-// 	md5Ctx.Write([]byte(pwd))
-// 	cipherStr := md5Ctx.Sum(nil)
-// 	md5Pwd := hex.EncodeToString(cipherStr)
-
-// 	usr := self.GetCurrentUser(false)
-
-// 	if usr == nil {
-// 		self.ReturnError(403, apps.UpdatePasswordError, "", nil)
-// 	} else {
-// 		if usr.Pwd == md5Pwd {
-// 			md5Ctx := md5.New()
-// 			md5Ctx.Write([]byte(newPwd))
-// 			cipherStr := md5Ctx.Sum(nil)
-// 			md5NewPwd := hex.EncodeToString(cipherStr)
-
-// 			if usr.TradePwd != "" && md5NewPwd == usr.TradePwd {
-// 				self.ReturnError(403, apps.LoginPwdSameWithTradePwdError, "", nil)
-// 			}
-
-// 			usr.Pwd = md5NewPwd
-// 			usr.Save()
-// 		} else {
-// 			self.ReturnError(403, apps.OrginalPasswordError, "", nil)
-// 		}
-
-// 	}
-
-// 	self.Data["json"] = usr
-// 	self.ServeJSON()
-// }
-
 //修改交易密码
 func (self *UserController) UpdateTradePwd() {
 	code := self.GetString("code")
@@ -332,133 +282,6 @@ func (self *UserController) UpdateTradePwd() {
 	self.ServeJSON()
 }
 
-// //获取账户余额
-// func (self *UserController) GetLeftAmount() {
-// 	user := self.GetCurrentUser((true && !self.IsDev()))
-// 	leftAmount := balance_model.GetUserTotalBalance(user.Id)
-// 	self.Data["json"] = leftAmount
-// 	self.ServeJSON()
-// }
-
-// //上传头像
-// func (self *UserController) UploadHead() {
-// 	user := self.GetCurrentUser(false)
-// 	file, _, err := self.GetFile("head")
-// 	if err != nil {
-// 		self.ReturnError(403, apps.UploadUserHeadError, "", nil)
-// 	}
-// 	user.UploadHead(file)
-// 	user.Head = self.GetFullImgUrl(user.Head)
-// 	self.Data["json"] = user
-// 	self.ServeJSON()
-// }
-
-// func formatCurrentUserInfo(user *user_model.User) *user_model.User {
-// 	if user == nil {
-// 		return nil
-// 	}
-// 	//头像
-// 	user.Head = user_model.GetFullImgUrl(user.Head)
-// 	user.HasTradePwd = 0
-// 	if user.TradePwd != "" {
-// 		user.HasTradePwd = 1
-// 	}
-// 	//是否为vip用户
-// 	user.IsVip = false
-// 	vUser := user_model.GetVipUserByUId(user.Id)
-// 	if vUser != nil {
-// 		user.IsVip = true
-// 		user.VipLevel = vUser.LevelId
-// 	}
-// 	//职业
-// 	if user.JobId > 0 {
-// 		job := user_model.GetUserJobById(user.JobId, false)
-// 		if job != nil {
-// 			user.Job = job.Job
-// 		}
-// 	}
-// 	// 收入
-// 	if user.IncomeId > 0 {
-// 		income := user_model.GetUserIncomeById(user.IncomeId, false)
-// 		if income != nil {
-// 			user.Income = income.Range
-// 		}
-// 	}
-// 	// 生日
-// 	if user.Birthday.IsZero() {
-// 		user.UpdateBirthdayByIdCard()
-// 	}
-// 	user.BirthdayStr = user.Birthday.Format("2006-01-02")
-
-// 	//身份证号
-// 	user.IdentityCardWithStar = user.GetCardNoWithStar()
-// 	// user.IdentityCard = ""
-// 	// 年龄
-// 	// user.UpdateUserAge()
-// 	user.CTime = user.CreatedAt.Unix()
-// 	_id := strconv.FormatInt(user.Id, 10)
-// 	length := len(_id)
-// 	user.No = ""
-// 	if length < 8 {
-// 		for i := 0; i < 8-length; i++ {
-// 			user.No += "0"
-// 		}
-// 	}
-// 	user.No += _id
-// 	return user
-// }
-
-// func formatCurrentWxUserInfo(wxUser *user_model.WxUser, tel string) *user_model.WxUser {
-// 	if wxUser == nil {
-// 		beego.BeeLogger.Info("wxUser is nil")
-// 		wxUser = &user_model.WxUser{Nickname: tel}
-// 	}
-// 	// user.BirthdayStr = user.Birthday.Format("2006-01-02")
-// 	return wxUser
-// }
-
-//FOHOW玖玖的手机号码,是否在第五创注册,是否比第五创先注册,然后更新用户两个字段
-func (self *UserController) UpdateIsRegistD5cAndIsRegistBeforeD5c() {
-	tel := self.GetString("tel")
-
-	user := user_model.GetByTel(tel, true)
-	if user == nil {
-		self.ReturnError(403, apps.NoExist, "", nil)
-	}
-
-	user_model.UpdateIsRegistD5c(user)
-	self.ServeJSON()
-}
-
-func (self *UserController) GetUserCertificationFromD5c() {
-
-	wxUser := self.GetCurrentWxUser(false)
-
-	var realName, idCard string
-
-	if wxUser != nil {
-		resp := user.CheckCertificationInD5c(wxUser.Unionid)
-		if resp != nil {
-			if resp.CheckCode != user.CHECK_CODE_SUCCESS {
-				self.ReturnError(403, []string{"certificate_info_not_exist", "微信用户尚未在第五创进行认证"}, "", nil)
-			} else {
-				idCard = resp.IdCard
-				realName = resp.RealName
-			}
-		} else {
-			self.ReturnError(403, []string{"certificate_info_not_exist", "微信用户尚未在第五创进行认证"}, "", nil)
-		}
-	}
-
-	type Ret struct {
-		RealName string `json:"real_name"`
-		IdCard   string `json:"icer_card"`
-	}
-
-	self.Data["json"] = &Ret{RealName: realName, IdCard: idCard}
-	self.ServeJSON()
-}
-
 //绑定身份证
 func (self *UserController) BindingIdCard() {
 	idCard := self.GetString("identity_card")

+ 1 - 46
go/gopath/src/fohow.com/apps/models/user_model/user.go

@@ -13,7 +13,6 @@ import (
 	"fohow.com/libs/ali_oss"
 	"fohow.com/libs/tool"
 	// "fohow.com/libs/user"
-	"fohow.com/libs/regist"
 )
 
 const (
@@ -46,14 +45,9 @@ type User struct {
 	SignupIp        string `orm:"column(signup_ip);null"              json:"signup_ip"`    // int(11)
 	CTime           int64  `orm:"-"                                              json:"ctime"`
 
-	//是否在第五创注册过
-	IsRegistD5c int64 `orm:"is_regist_d5c"                                  json:"-"`
-	//是否比第五创先注册
-	IsRegistBeforeD5c int64 `orm:"is_regist_before_d5c"                           json:"-"`
 	//是否黑名单
 	IsBlackUser int64 `orm:"is_black_user"                           json:"-"`
-	//不需要到第五创查询代金券来源白名单
-	IsUnlimitPayProduct bool `orm:"is_unlimit_pay_product"                  json:"-"`
+
 	//银行信息
 	HasBank     bool      `orm:"-"                  json:"has_bank"`
 	BankName    string    `orm:"column(bank_name)"     json:"bank_name"`
@@ -260,45 +254,6 @@ func GetUserByIsRegistAndIsRegistBefore() (list []*User) {
 	return list
 }
 
-func UpdateIsRegistD5c(user *User) {
-
-	if user == nil {
-		return
-	}
-	result := regist.CheckIsRegistInD5c(user.Tel)
-	if result == nil {
-		return
-	}
-
-	if result.CheckCode != "0000" {
-		beego.BeeLogger.Warn("UpdateIsRegistD5c-tel:%s, check failed.", user.Tel)
-		return
-	}
-	//然后更新用户是否在第五创注册、比第五创先注册两个字段
-	beego.BeeLogger.Warn("UpdateIsRegistD5c-tel:%s,isRegist:%v,isRegistBeforeD5c:%s.", user.Tel, result.IsRegist, result.RegistTime)
-	if result.IsRegist { //已经注册,则比较创建时间
-		user.IsRegistD5c = int64(1)
-		user.IsRegistBeforeD5c = int64(0) //默认否
-		if result.RegistTime != "" {
-
-			dateArray := strings.Split(result.RegistTime, "-")
-			timeArray := strings.Split(result.RegistTime, ":")
-			if len(dateArray) == 3 && len(timeArray) == 3 {
-				registTime, _ := time.ParseInLocation("2006-01-02 15:04:05", result.RegistTime, time.Local)
-				beego.BeeLogger.Warn("UpdateIsRegistD5c-tel:%s, d5cRegistTime: %v, %d, rabbitRegistTime: %v, %d.", user.Tel, registTime, registTime.Unix(), user.CreatedAt, user.CreatedAt.Unix())
-				if user.CreatedAt.Unix() < registTime.Unix() {
-					user.IsRegistBeforeD5c = int64(1)
-				}
-			}
-		}
-	} else { //没有注册,则是比d5c先注册
-		user.IsRegistD5c = int64(0)
-		user.IsRegistBeforeD5c = int64(1)
-	}
-	user.Save()
-	beego.BeeLogger.Warn("UpdateIsRegistD5c-tel:%s,user udpate success: %s,%t,%t.", user.Tel, user.IsRegistD5c, user.IsRegistBeforeD5c)
-}
-
 func GetUserByIdCardNo(cardNo string, useCache bool) *User {
 	k := fmt.Sprintf("user_model.GetUserByIdCardNo[%s]", cardNo)
 	if useCache {

+ 7 - 15
go/gopath/src/fohow.com/apps/models/user_model/wx_user.go

@@ -37,21 +37,13 @@ type WxUser struct {
 	Sex                int64  `orm:"column(sex);null"                               json:"sex"`          // tinyint(4)
 	Head               string `orm:"column(head)"     json:"head"`
 	FullHead           string `orm:"-"     json:"full_head"`
-	Subscribe          int64  `orm:"column(subscribe);null"                         json:"subscribe"`            // tinyint(4)
-	IsRegist           int64  `orm:"column(is_regist);null"                         json:"is_regist"`            // tinyint(4)
-	SubscribeTime      int64  `orm:"column(subscribe_time);null"                    json:"-"`                    // int(11)
-	UnsubscribeTime    int64  `orm:"column(unsubscribe_time);null"                    json:"-"`                  // int(11)
-	LastConversationAt int64  `orm:"column(last_conversation_at);null"              json:"-"`                    // int(11)
-	ChannelQrcodeId    int64  `orm:"column(channel_qrcode_id);null"              json:"-"`                       // int(11)
-	InviteCount        int64  `orm:"-"              json:"invite_count"`                                         // int(11)
-	ProductBenefitRate int64  `orm:"column(product_benefit_rate);null"              json:"product_benefit_rate"` // int(11)
-	ProjectBenefitRate int64  `orm:"column(project_benefit_rate);null"              json:"project_benefit_rate"` // int(11)
-
-	SecondProductBenefitRate int64     `orm:"column(second_product_benefit_rate);null"   json:"-"` // int(11)
-	SecondProjectBenefitRate int64     `orm:"column(second_project_benefit_rate);null"   json:"-"` // int(11)
-	CopartnerState           int64     `orm:"column(copartner_state)"                                  json:"-"`
-	BeCopartnerTime          time.Time `orm:"column(be_copartner_time)"                                json:"-"`
-	CancelTime               time.Time `orm:"column(cancel_copartner_time)"                            json:"-"`
+	Subscribe          int64  `orm:"column(subscribe);null"                         json:"subscribe"` // tinyint(4)
+	IsRegist           int64  `orm:"column(is_regist);null"                         json:"is_regist"` // tinyint(4)
+	SubscribeTime      int64  `orm:"column(subscribe_time);null"                    json:"-"`         // int(11)
+	UnsubscribeTime    int64  `orm:"column(unsubscribe_time);null"                    json:"-"`       // int(11)
+	LastConversationAt int64  `orm:"column(last_conversation_at);null"              json:"-"`         // int(11)
+	ChannelQrcodeId    int64  `orm:"column(channel_qrcode_id);null"              json:"-"`            // int(11)
+	InviteCount        int64  `orm:"-"              json:"invite_count"`                              // int(11)
 
 	IntroUserId  int64  `orm:"column(intro_user_id);null"                           json:"intro_user_id"` // 群主ID int(11)
 	IntroArea    string `orm:"intro_area"                         json:"-"`                               // varchar(100)

+ 0 - 2
go/gopath/src/fohow.com/routers/routes.go

@@ -144,8 +144,6 @@ func init() {
 	//绑定身份证
 	beego.Router("/v1/user/binding/id_card", &user_controller.UserController{}, "put:BindingIdCard")
 
-	beego.Router("/v1/user/check_cert", &user_controller.UserController{}, "get:GetUserCertificationFromD5c")
-
 	//绑定电话号码
 	beego.Router("/v1/wxuser/binding/tel", &user_controller.UserController{}, "post:BindingTel")
 	beego.Router("/v1/wxuser/info", &user_controller.UserController{}, "put:UpdateWxUserInfo")