Explorar o código

edit cart wx user rules

abiao %!s(int64=5) %!d(string=hai) anos
pai
achega
343b8ba0be

+ 16 - 14
go/gopath/src/fohow.com/apps/controllers/user_controller/user_controller.go

@@ -514,24 +514,26 @@ func (self *UserController) SysUserBind() {
 	if record == nil {
 		self.ReturnError(403, apps.BindFail, "", nil)
 	}
+	if c != nil {
+		//迁移佣金记录--balance
+		if c.Balance > 0 {
+			s := "sys_init"
+			new(balance_model.CashBalance).Create(sysWxUser.Id, c.Balance*int64(100), s, relateId, remark)
+		}
 
-	//迁移佣金记录--balance
-	if c.Balance > 0 {
-		s := "sys_init"
-		new(balance_model.CashBalance).Create(sysWxUser.Id, c.Balance*int64(100), s, relateId, remark)
-	}
+		//迁移积分记录
+		if c.Cent > 0 {
+			s := "sys_init"
+			new(cent_model.CentBalance).Create(sysWxUser.Id, c.Cent*int64(100), s, relateId, remark)
+		}
 
-	//迁移积分记录
-	if c.Cent > 0 {
-		s := "sys_init"
-		new(cent_model.CentBalance).Create(sysWxUser.Id, c.Cent*int64(100), s, relateId, remark)
+		//迁移提货券记录--cash
+		if c.Cash > 0 {
+			s := "sys_init"
+			new(balance_model.Balance).Create(sysWxUser.Id, sysWxUser.UserId, c.Cash*int64(100), s, relateId, remark)
+		}
 	}
 
-	//迁移提货券记录--cash
-	if c.Cash > 0 {
-		s := "sys_init"
-		new(balance_model.Balance).Create(sysWxUser.Id, sysWxUser.UserId, c.Cash*int64(100), s, relateId, remark)
-	}
 	//清掉wxuser缓存
 	userKey := fmt.Sprintf("user.GetByUid[%d]", wxUser.UserId)
 	wxUserKey := cache.GetKey(cache.GetWxUserById, wxUser.Id)