|
@@ -108,7 +108,7 @@ func (this *EntPortrait) EntDetail() {
|
|
|
userIdFlag = qutil.ObjToString(this.GetSession("JYTrustedId"))
|
|
|
}
|
|
|
go entity.SaveZhiMaLog(map[string]interface{}{
|
|
|
- "s entId": util.DecodeId(entId),
|
|
|
+ "s_entId": util.DecodeId(entId),
|
|
|
"s_name": entInfo["entName"],
|
|
|
"credit_no": entInfo["creditNo"],
|
|
|
"s_userId": userIdFlag,
|
|
@@ -369,6 +369,7 @@ func (this *EntPortrait) WinnerMiniPortrait() {
|
|
|
rData["status"] = entInfo["status"]
|
|
|
rData["type"] = entInfo["type"]
|
|
|
rData["companyName"] = entInfo["entName"]
|
|
|
+ rData["creditNo"] = entInfo["creditNo"]
|
|
|
//rData["zhimaLabels"] = entInfo["zhimaLabels"]
|
|
|
entName := qutil.ObjToString(entInfo["entName"])
|
|
|
if entName != "" {
|
|
@@ -382,20 +383,9 @@ func (this *EntPortrait) WinnerMiniPortrait() {
|
|
|
labelsMaps = gconv.Maps(entInfo["zhimaLabels"])
|
|
|
credit_no = gconv.String(entInfo["creditNo"])
|
|
|
)
|
|
|
+ rData["zhimaLabels"] = gconv.Maps(entInfo["zhimaLabels"])
|
|
|
if credit_no != "" && entId != "" && (len(labelsMaps) == 0 || gconv.String(labelsMaps[0]["zhima_value"]) == "") {
|
|
|
rData["zhimaLabels"] = func() []map[string]interface{} {
|
|
|
- key := fmt.Sprintf("zhima_%s", entId)
|
|
|
- redisData := redis.Get("zm", key)
|
|
|
- if redisData != nil {
|
|
|
- if d, err := json.Marshal(redisData); err == nil {
|
|
|
- var zmLables []map[string]interface{}
|
|
|
- if err1 := json.Unmarshal(d, &zmLables); err1 == nil {
|
|
|
- return zmLables
|
|
|
- } else {
|
|
|
- log.Println(entId, err1)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
zhimaUrl := fmt.Sprintf(g.Cfg().MustGet(this.Request.Context(), "zhima.api", "https://api.jianyu360.com/data/getzhima?id=%s&appid=jianyu360").String(), entId)
|
|
|
res, err := g.Client().Get(this.Request.Context(), zhimaUrl)
|
|
|
if err != nil {
|
|
@@ -405,7 +395,7 @@ func (this *EntPortrait) WinnerMiniPortrait() {
|
|
|
if data, err := io.ReadAll(res.Body); err == nil && len(data) > 0 {
|
|
|
if m := gconv.Map(strings.ReplaceAll(gconv.String(data), "\n", "")); len(m) > 0 {
|
|
|
if rMaps := gconv.Maps(m["data"]); len(rMaps) > 0 {
|
|
|
- redis.Put("zm", key, rMaps, 60*60*24)
|
|
|
+ //redis.Put("zm", key, rMaps, 60*60*24)
|
|
|
return rMaps
|
|
|
}
|
|
|
}
|
|
@@ -413,21 +403,6 @@ func (this *EntPortrait) WinnerMiniPortrait() {
|
|
|
return nil
|
|
|
}()
|
|
|
}
|
|
|
-
|
|
|
- //芝麻曝光日志存储
|
|
|
- if labels := gconv.Maps(entInfo["zhimaLabels"]); len(labels) > 0 {
|
|
|
- userIdFlag := userId
|
|
|
- if userIdFlag == "" {
|
|
|
- userIdFlag = qutil.ObjToString(this.GetSession("JYTrustedId"))
|
|
|
- }
|
|
|
- go entity.SaveZhiMaLog(map[string]interface{}{
|
|
|
- "s_entId": entId,
|
|
|
- "s_name": entInfo["entName"],
|
|
|
- "credit_no": entInfo["creditNo"],
|
|
|
- "s_userId": userIdFlag,
|
|
|
- "l_date": time.Now().Unix(),
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
//项目动态数量
|
|
|
rData["biddingCount"] = cepm.GetWinnerNewCount(entId)
|
|
@@ -446,6 +421,20 @@ func (this *EntPortrait) WinnerMiniPortrait() {
|
|
|
log.Println("get winner mini cache err :", err.Error())
|
|
|
}
|
|
|
}
|
|
|
+ //芝麻曝光日志存储
|
|
|
+ if labels := gconv.Maps(rData["zhimaLabels"]); len(labels) > 0 {
|
|
|
+ userIdFlag := userId
|
|
|
+ if userIdFlag == "" {
|
|
|
+ userIdFlag = qutil.ObjToString(this.GetSession("JYTrustedId"))
|
|
|
+ }
|
|
|
+ go entity.SaveZhiMaLog(map[string]interface{}{
|
|
|
+ "s_entId": entId,
|
|
|
+ "s_name": rData["companyName"],
|
|
|
+ "credit_no": rData["creditNo"],
|
|
|
+ "s_userId": userIdFlag,
|
|
|
+ "l_date": time.Now().Unix(),
|
|
|
+ })
|
|
|
+ }
|
|
|
return rData, nil
|
|
|
}()
|
|
|
if errMsg != nil {
|