Browse Source

新增字段

WH01243 3 months ago
parent
commit
e0fbde07c8
1 changed files with 14 additions and 3 deletions
  1. 14 3
      common/src/qfw/util/jy/subScribe.go

+ 14 - 3
common/src/qfw/util/jy/subScribe.go

@@ -1,13 +1,15 @@
 package jy
 
 import (
-	"time"
-
 	"app.yhyue.com/moapp/jybase/common"
 	qutil "app.yhyue.com/moapp/jybase/common"
+	elastic "app.yhyue.com/moapp/jybase/es"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jybase/go-xweb/log"
 	"app.yhyue.com/moapp/jybase/mongodb"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"time"
 )
 
 func GetSubScribeInfo(session *httpsession.Session, mg mongodb.MongodbSim, types, appid string) *map[string]interface{} {
@@ -160,7 +162,7 @@ func format(data *map[string]interface{}) *map[string]interface{} {
 }
 
 // 用户注册日志保存
-func SaveUserLog(mg mongodb.MongodbSim, userid, phone, way, system, source, openid, search_engine, promotion, ip, user_agent, site, event string, referer string, others ...map[string]interface{}) {
+func SaveUserLog(mg mongodb.MongodbSim, userid, phone, way, system, source, openid, search_engine, promotion, ip, user_agent, site, event, referer, code string, others ...map[string]interface{}) {
 	data := map[string]interface{}{
 		"userid":        userid,
 		"phone":         phone,
@@ -176,6 +178,7 @@ func SaveUserLog(mg mongodb.MongodbSim, userid, phone, way, system, source, open
 		"site":          site,
 		"event":         event,
 		"referer":       referer,
+		"code":          code,
 	}
 	if len(others) > 0 {
 		for k, v := range others[0] {
@@ -184,3 +187,11 @@ func SaveUserLog(mg mongodb.MongodbSim, userid, phone, way, system, source, open
 	}
 	mg.Save("register_log", data)
 }
+func GetEsDetail(sid string) string {
+	r := elastic.Get("bidding", "bidding", fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"id":"%s"}}]}},"_source":["_id","detail"],"size":1}`, sid))
+	detail := ""
+	if len(*r) > 0 {
+		detail = gconv.String((*r)[0]["detail"])
+	}
+	return detail
+}