对政策匹配进行优化
This commit is contained in:
@@ -110,6 +110,21 @@ var Wechath5 = Ctr{
|
||||
}
|
||||
delete(user, "password")
|
||||
company := that.Db.Get("company", "id,name", Map{"id": user.GetCeilInt("company_id")})
|
||||
|
||||
//消除company没有创建的影响
|
||||
if company == nil {
|
||||
companyId := that.Db.Insert("company", Map{
|
||||
"user_id": user["id"],
|
||||
"provider_id": user["provider_id"],
|
||||
"salesman_id": user["salesman_id"],
|
||||
"create_time[#]": "now()",
|
||||
"modify_time[#]": "now()",
|
||||
"del_flag": 0,
|
||||
})
|
||||
user["company_id"] = companyId
|
||||
that.Db.Update("user", Map{"company_id": companyId}, Map{"id": user.GetCeilInt("id")})
|
||||
company = that.Db.Get("company", "*", Map{"id": user.GetCeilInt("company_id")})
|
||||
}
|
||||
salesman := that.Db.Get("salesman", "id,name", Map{"id": user.GetCeilInt("salesman_id")})
|
||||
provider := that.Db.Get("provider", "id,name", Map{"id": user.GetCeilInt("provider_id")})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user