初步版本修正

This commit is contained in:
hoteas
2022-05-05 00:29:30 +08:00
parent ce8059b0a0
commit f0d4efd8fc
20 changed files with 511 additions and 52 deletions
+26
View File
@@ -38,7 +38,31 @@ var Wechath5 = Ctr{
}
userId := 0
defer func() {
//有sn就关联业务员
parentId := ObjToInt(that.Req.FormValue("parent_id"))
if parentId == 0 {
return
}
if userId == 0 || userId == parentId {
return
}
puser := that.Db.Get("user", "`index`,id", Map{"id": parentId})
if puser == nil {
return
}
user := that.Db.Get("user", "parent_id", Map{"id": userId})
if user.GetCeilInt("parent_id") != 0 {
return
}
index1 := puser.GetString("index")
if index1 == "," {
index1 = index1 + ObjToStr(parentId) + ","
}
that.Db.Update("user", Map{"parent_id": parentId, "index": index1 + ObjToStr(userId) + ","}, Map{"id": userId})
}()
//最后验证服务商是否绑定
defer func() {
//有sn就关联业务员
@@ -131,6 +155,7 @@ var Wechath5 = Ctr{
user := Map{
"nickname": wechatInfo.GetString("nickname"),
"avatar": wechatInfo.GetString("avatar"),
"index": ",",
"create_time[#]": "now()",
"modify_time[#]": "now()",
"login_time[#]": "now()",
@@ -160,6 +185,7 @@ var Wechath5 = Ctr{
user := Map{
"nickname": wechatInfo.GetString("nickname"),
"avatar": wechatInfo.GetString("avatar"),
"index": ",",
"create_time[#]": "now()",
"modify_time[#]": "now()",
"login_time[#]": "now()",