|
@@ -215,6 +215,7 @@ func CommonEntInfo(yp *xweb.Action, id string, editFlag int, ismobile bool) erro
|
|
|
yp.T["copyright"] = FindOne("enterprise_copyright", `{"EntId":"`+id+`"}`)
|
|
|
//编辑企业名片标识
|
|
|
yp.T["editFlag"] = editFlag
|
|
|
+ yp.T["lastService"] = getLastService(id)
|
|
|
//过滤企业名
|
|
|
if relflag && nodes != nil && len(*nodes) > 0 {
|
|
|
go func() {
|
|
@@ -233,7 +234,6 @@ func CommonEntInfo(yp *xweb.Action, id string, editFlag int, ismobile bool) erro
|
|
|
return yp.Render("/enterprise/detail.html", &yp.T)
|
|
|
} else {
|
|
|
//服务数量
|
|
|
- yp.T["serviceCount"] = getEntServiceCount(id)
|
|
|
var contentuser []byte
|
|
|
var erruser error
|
|
|
if ismobile {
|
|
@@ -530,13 +530,21 @@ func getDishonesty(legcerNo string, currentPage int) map[string]interface{} {
|
|
|
}
|
|
|
|
|
|
//获取该企业的服务数量
|
|
|
-func getEntServiceCount(id string) int64 {
|
|
|
+func getLastService(id string) string {
|
|
|
query := `{"query": {
|
|
|
"bool": {
|
|
|
- "must":[{"query_string":{"default_field": "s_enterpriseid","query":"` + id + `"}}],"must_not" : [{"term" : {"i_status" : 1 }}]
|
|
|
+ "must":[
|
|
|
+ {"term":{"s_enterpriseid":"` + id + `"}},
|
|
|
+ {"query_string": {"default_field": "s_isshow","query": "*3*"}}
|
|
|
+ ],
|
|
|
+ "must_not":[{"term":{"i_status":1}}]
|
|
|
}
|
|
|
- }}`
|
|
|
- return elastic.Count("service", "service", query)
|
|
|
+ },"from":0,"size":1,"sort":[{"l_createdate":"desc"}]}`
|
|
|
+ r := elastic.Get("service", "service", query)
|
|
|
+ if r != nil && len(*r) == 1 {
|
|
|
+ return util.ObjToString((*r)[0]["_id"])
|
|
|
+ }
|
|
|
+ return ""
|
|
|
}
|
|
|
func checkAuth(obj map[string]interface{}) (b bool, err string) {
|
|
|
if len(obj) > 0 {
|