|
@@ -293,6 +293,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
|
|
|
yp.T["dishonesty"] = getDishonesty(util.If(info["LegCerNO"] != nil, info["LegCerNO"], "").(string), 1)
|
|
|
//服务列表第一页数据
|
|
|
yp.T["service"] = findServiceByEntId(id, 1, yp.Session())
|
|
|
+ log.Println(yp.T["service"])
|
|
|
//关系网数据
|
|
|
yp.T["relation"] = relation
|
|
|
contentuser, erruser := yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)
|
|
@@ -560,18 +561,19 @@ func (yp *Yellowpage) GetDishonesty() error {
|
|
|
return nil
|
|
|
}
|
|
|
func getDishonesty(legcerNo string, currentPage int) map[string]interface{} {
|
|
|
- var res map[string]interface{}
|
|
|
+ var limit int = 10
|
|
|
+ if strings.Trim(legcerNo, " ") == "" {
|
|
|
+ return map[string]interface{}{"list": []map[string]interface{}{}, "count": 0, "pageSize": limit}
|
|
|
+ }
|
|
|
if ret := redis.Get("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage)); ret != nil {
|
|
|
- res = ret.(map[string]interface{})
|
|
|
+ return ret.(map[string]interface{})
|
|
|
} else {
|
|
|
- limit := 10
|
|
|
start := (currentPage - 1) * limit
|
|
|
count := Count("laolai", `{"s_cardnum":"`+legcerNo+`"}`)
|
|
|
r := Find("laolai", `{"s_cardnum":"`+legcerNo+`"}`, `{"l_date":-1}`, `{"l_date":1,"iname":1,"court_name":1,"case_code":1,"performance":1}`, false, start, limit)
|
|
|
- res = map[string]interface{}{"list": r, "count": count, "pageSize": limit}
|
|
|
- redis.Put("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
|
|
|
+ redis.Put("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage), r, 7*24*60*60)
|
|
|
+ return map[string]interface{}{"list": r, "count": count, "pageSize": limit}
|
|
|
}
|
|
|
- return res
|
|
|
}
|
|
|
func (yp *Yellowpage) FindServiceByEntId() error {
|
|
|
if yp.Method() == "POST" {
|