Преглед изворни кода

add migrate wx_user function

abiao пре 5 година
родитељ
комит
733aee78eb

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

@@ -213,6 +213,11 @@ func (self *UserController) Get() {
 		if wxGzhUser != nil {
 			wxUser.Subscribe = wxGzhUser.Subscribe
 		}
+		wxUser.CanBind = false
+		//大于某一时间点,可做会员迁移
+		if len(wxUser.UserNo) == 0 && wxUser.CreatedAt.Unix() > int64(1574562603) {
+			wxUser.CanBind = true
+		}
 	}
 
 	type Ret struct {

+ 4 - 3
go/gopath/src/fohow.com/apps/models/user_model/wx_user.go

@@ -59,9 +59,10 @@ type WxUser struct {
 	SaleGroup    float64 `orm:"column(sale_group);null"              json:"sale_group"` // int(11)
 	SaleGroupSum float64 `orm:"column(sale_group_sum)" json:"sale_group_sum"`           // datetime
 	//等级
-	Rank        int64     `orm:"column(rank);null"              json:"rank"`              // int(11)
-	PartnerTime int64     `orm:"column(partner_time);null"              json:"-"`         // 群主时间
-	UserNo      string    `orm:"column(user_no);null"              json:"-"`              // int(11)
+	Rank        int64     `orm:"column(rank);null"              json:"rank"`      // int(11)
+	PartnerTime int64     `orm:"column(partner_time);null"              json:"-"` // 群主时间
+	UserNo      string    `orm:"column(user_no);null"              json:"-"`      // int(11)
+	CanBind     bool      `orm:"-"     json:"can_bind"`
 	CreatedAt   time.Time `orm:"column(created_at);auto_now_add;type(datetime)" json:"-"` // datetime
 	UpdatedAt   time.Time `orm:"column(updated_at);auto_now;type(datetime)"     json:"-"` // datetime
 }