|
@@ -181,7 +181,7 @@ func (self *ThreeWxUser) Save() error {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//迁移微信老会员
|
|
//迁移微信老会员
|
|
|
-func (self *ThreeWxUser) CopyWxUsers() error {
|
|
|
|
|
|
|
+func CopyWxUsers() error {
|
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
|
|
|
|
|
|
//迁移当前记录
|
|
//迁移当前记录
|
|
@@ -208,7 +208,7 @@ func (self *ThreeWxUser) CopyWxUsers() error {
|
|
|
sql = `
|
|
sql = `
|
|
|
insert into three_wx_users (id,invite_id,intro_inner_no,intro_area) select id,invite_id,intro_inner_no,intro_area from wx_users
|
|
insert into three_wx_users (id,invite_id,intro_inner_no,intro_area) select id,invite_id,intro_inner_no,intro_area from wx_users
|
|
|
`
|
|
`
|
|
|
- _, err = o.Raw(sql, self.Id).Exec()
|
|
|
|
|
|
|
+ _, err = o.Raw(sql).Exec()
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
beego.BeeLogger.Warn("ThreeWxUser.CopyWxUsers() err[%s]", err)
|
|
beego.BeeLogger.Warn("ThreeWxUser.CopyWxUsers() err[%s]", err)
|
|
|
return err
|
|
return err
|
|
@@ -217,10 +217,9 @@ func (self *ThreeWxUser) CopyWxUsers() error {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//回写wx_users
|
|
//回写wx_users
|
|
|
-func (self *ThreeWxUser) CallBackWxUsers() error {
|
|
|
|
|
|
|
+func CallBackWxUsers() error {
|
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
|
-
|
|
|
|
|
- //更新invite_id丢失会员
|
|
|
|
|
|
|
+ //更新wx_users会员关系
|
|
|
sql := `
|
|
sql := `
|
|
|
update wx_users a , three_wx_users b set a.intro_inner_no=b.intro_inner_no,a.intro_area=b.intro_area where a.id=b.id
|
|
update wx_users a , three_wx_users b set a.intro_inner_no=b.intro_inner_no,a.intro_area=b.intro_area where a.id=b.id
|
|
|
`
|
|
`
|