This commit is contained in:
hoteas
2022-05-03 22:40:02 +08:00
parent 7d36ad95a7
commit ce8059b0a0
16 changed files with 343 additions and 60 deletions
+13 -4
View File
@@ -30,10 +30,10 @@ var MattersCtr = Ctr{
return
}
res["salesman"] = that.Db.Get("salesman", "name,id", Map{"id": res.GetCeilInt64("salesman_id")})
res["provider"] = that.Db.Get("provider", "name,id", Map{"id": res.GetCeilInt64("provider_id")})
res["user"] = that.Db.Get("user", "id,name,nickname,company_id", Map{"user_id": res.GetCeilInt64("user_id")})
if res.GetMap("user") != nil && res.GetMap("user").GetCeilInt64("company_id") != 0 {
res["company"] = that.Db.Get("company", "id,name", Map{"company_id": res.GetMap("user").GetCeilInt64("company_id")})
}
that.Display(0, res)
},
@@ -94,6 +94,15 @@ var MattersCtr = Ctr{
res := that.Db.Page(page, pageSize).PageSelect("matters", "*", data)
for _, v := range res {
if v.GetCeilInt64("user_id") != 0 {
v["user"] = that.Db.Get("user", "id,name,nickname,company_id", Map{"user_id": v.GetCeilInt64("user_id")})
if v.GetMap("user") != nil && v.GetMap("user").GetCeilInt64("company_id") != 0 {
v["company"] = that.Db.Get("company", "id,name", Map{"company_id": v.GetMap("user").GetCeilInt64("company_id")})
}
}
}
that.Display(0, Map{"total": count, "data": res})
},
}
+1 -1
View File
@@ -178,7 +178,7 @@ var OrderCtr = Ctr{
pageSize = 20
}
data := Map{"del_flag": 0}
data := Map{"del_flag": 0, "salesman_id": that.Session("salesman_id").Data}
keywords := that.Req.FormValue("keywords")
if keywords != "" {
data["OR"] = Map{"sn[~]": keywords, "name[~]": keywords}