政企超链接开始集成

This commit is contained in:
hoteas
2022-02-24 06:26:36 +08:00
parent 32319d52f0
commit 2a98f0dcad
206 changed files with 117722 additions and 997 deletions
+24 -20
View File
@@ -186,9 +186,9 @@ var analyseCtr = Ctr{
page := ObjToInt(this.Req.FormValue("page"))
pageSize := ObjToInt(this.Req.FormValue("pageSize"))
orgId := ObjToInt(this.Req.FormValue("org_id"))
search := this.Req.FormValue("search")
where := Map{}
where := Map{"state": 0}
levelStr := this.Req.FormValue("level")
if levelStr != "" {
where["level"] = ObjToInt(levelStr)
@@ -197,7 +197,9 @@ var analyseCtr = Ctr{
if industryId != 0 {
where["industry_id"] = industryId
}
if orgId != 0 {
where["org_id"] = orgId
}
if search != "" {
where["name[~]"] = search
}
@@ -229,21 +231,23 @@ var analyseCtr = Ctr{
res["upload_data"] = res.GetMap("upload_data")
res["collect_data"] = res.GetMap("collect_data")
res["collect_data"] = res.GetMap("collect_data")
//if res.GetMap("collect_data") == nil {
// path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json")
//
// data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path)
//
// if len(data) != 0 {
// data["path"] = path
// this.Db.Update("company", Map{"collect_data": data.ToJsonString(),
// "address": data.GetString("companyAddress"),
// "sn": data.GetString("creditNo"),
// "unit": data.GetString("authority"),
// }, Map{"id": res.GetCeilInt("id")})
// res["collect_data"] = data
// }
//}
if res.GetMap("collect_data") == nil && page == 1 {
go func(res Map, this *Context) {
path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json")
data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path)
if len(data) != 0 {
data["path"] = path
this.Db.Update("company", Map{"collect_data": data.ToJsonString(),
"address": data.GetString("companyAddress"),
"sn": data.GetString("creditNo"),
"unit": data.GetString("authority"),
}, Map{"id": res.GetCeilInt("id")})
res["collect_data"] = data
}
}(res, this)
}
}
@@ -304,14 +308,14 @@ var analyseCtr = Ctr{
return
}
res := this.Db.Get("company", "upload_data", Map{"id": id})
res := this.Db.Get("company", "upload_data,org_id", Map{"id": id})
if res == nil {
this.Display(4, "找不到该数据")
return
}
uploadData := res.GetMap("upload_data")
tags := this.Db.Select("tag", "name,sn,`unit`,description", Map{"type": 1})
tags := this.Db.Select("tag", "name,sn,`unit`,description", Map{"AND": Map{"type": 0, "org_id": res.GetCeilInt("org_id")}})
for _, v := range tags {
v["value"] = uploadData[v.GetString("sn")]
}