对政策匹配进行优化

This commit is contained in:
hoteas 2022-05-10 12:54:24 +08:00
parent db0724f09b
commit 7de6a79611

View File

@ -101,6 +101,7 @@ var DeclareCtr = Ctr{
} }
company := that.Db.Get("company", "*", Map{"user_id": that.Session("user_id").Data}) company := that.Db.Get("company", "*", Map{"user_id": that.Session("user_id").Data})
delete(company, "id") delete(company, "id")
delete(company, "salesman_id") delete(company, "salesman_id")
delete(company, "provider_id") delete(company, "provider_id")
@ -489,18 +490,6 @@ var DeclareCtr = Ctr{
that.Display(4, "找不到用户") that.Display(4, "找不到用户")
return return
} }
//消除company没有创建的影响
if user.GetCeilInt("company_id") == 0 {
companyId := that.Db.Insert("company", Map{
"user_id": user["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")})
}
companyName := that.Req.FormValue("company_name") companyName := that.Req.FormValue("company_name")
if companyName == "" { if companyName == "" {
that.Display(3, "参数错误") that.Display(3, "参数错误")