调优
This commit is contained in:
@@ -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})
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user