增加限制条件

This commit is contained in:
hoteas
2022-05-07 11:02:12 +08:00
parent 25ab6c219d
commit e0752218ea
5 changed files with 22 additions and 2 deletions
+11
View File
@@ -24,6 +24,17 @@ var UserCtr = Ctr{
return
}
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")})
}
delete(user, "password")
company := that.Db.Get("company", "id,name", Map{"id": user.GetCeilInt("company_id")})