|
@@ -2,6 +2,7 @@ package personnel
|
|
|
|
|
|
import (
|
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
|
+ "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
"context"
|
|
|
"encoding/json"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
@@ -40,19 +41,7 @@ func (p *personnel) Statistics(ctx context.Context, req *v1.PersonnelInsertReq)
|
|
|
in.Source = common.If(req.Source == "undefined", "", req.Source).(string)
|
|
|
in.Url = common.If(req.Url == "undefined", "", req.Url).(string)
|
|
|
in.AppId = common.If(req.AppId == "undefined", "", req.AppId).(string)
|
|
|
- if req.BreakData != nil && len(req.BreakData) > 0 {
|
|
|
- // 处理page_name 和product_name
|
|
|
- if pageName, ok := req.BreakData["page_name"]; ok && pageName != "" && pageName != "undefined" && in.PageName == "" {
|
|
|
- in.PageName = common.InterfaceToStr(pageName)
|
|
|
- }
|
|
|
- if productName, ok := req.BreakData["product_name"]; ok && productName != "" && productName != "undefined" && in.ProductName == "" {
|
|
|
- in.ProductName = common.InterfaceToStr(productName)
|
|
|
- }
|
|
|
- breakData, _ := json.Marshal(req.BreakData)
|
|
|
- in.BreakData = string(breakData)
|
|
|
- }
|
|
|
in.AppVersion = common.If(req.AppVersion == "undefined", "", req.AppVersion).(string)
|
|
|
-
|
|
|
sessionGet, err := model.UserSessionCtx.Get(ctx)
|
|
|
if err == nil {
|
|
|
session := sessionGet.JySession
|
|
@@ -85,6 +74,26 @@ func (p *personnel) Statistics(ctx context.Context, req *v1.PersonnelInsertReq)
|
|
|
//A24112 新增字段
|
|
|
in.Port = utils.GetUserPort(r) // 行为端口 wx,Android,ios,pc,h5
|
|
|
in.Refer = g.RequestFromCtx(ctx).GetHeader("pageReferrer") // 跳转前页面
|
|
|
+ if req.BreakData != nil && len(req.BreakData) > 0 {
|
|
|
+ // 处理page_name 和product_name
|
|
|
+ if pageName, ok := req.BreakData["page_name"]; ok && pageName != "" && pageName != "undefined" && in.PageName == "" {
|
|
|
+ in.PageName = common.InterfaceToStr(pageName)
|
|
|
+ }
|
|
|
+ if productName, ok := req.BreakData["product_name"]; ok && productName != "" && productName != "undefined" && in.ProductName == "" {
|
|
|
+ in.ProductName = common.InterfaceToStr(productName)
|
|
|
+ }
|
|
|
+ // 小程序 如果有id 存解密后的id
|
|
|
+ if bid, ok := req.BreakData["id"]; ok && bid != "" && bid != "undefined" && in.BiddingId == "" {
|
|
|
+ biddingId := encrypt.CommonDecodeArticle("content", common.InterfaceToStr(bid))[0]
|
|
|
+ in.BiddingId = common.InterfaceToStr(biddingId)
|
|
|
+ }
|
|
|
+ breakData, _ := json.Marshal(req.BreakData)
|
|
|
+ in.BreakData = string(breakData)
|
|
|
+ }
|
|
|
+ // 小程序的refer是从body里面取的
|
|
|
+ if in.Refer == "" && req.Refer != "" && req.Refer != "undefined" {
|
|
|
+ in.Refer = req.Refer
|
|
|
+ }
|
|
|
in.MiniProgramCode = g.RequestFromCtx(ctx).GetHeader("miniProgramCode")
|
|
|
in.SearchWord = req.SearchWord // 搜索词
|
|
|
in.Filter = req.Filter // 搜索条件
|