Эх сурвалжийг харах

Merge remote-tracking branch 'origin/feature/v4.10.9' into feature/v4.10.9

jianghan 4 сар өмнө
parent
commit
d3da1d567d

+ 27 - 14
src/jfw/front/login.go

@@ -220,20 +220,33 @@ func (l *Login) Login() error {
 					}
 					_id := mongodb.Save("user", data)
 					if _id != "" {
-                        redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
-                        //用户日志保存
-                        referer := l.Refer()
-                        go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", source, "", gconv.String(l.GetSession("RSource")), gconv.String(sessVal["RSource"]), qutil.GetIp(l.Request), l.UserAgent(), "jybx", "", referer)
-                        jy.ClearPhoneIdentSession(l.Session())
-                        ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
-                        userInfo["isNewUser"] = true
-                        nsqPath, _ := config.Sysconfig["nsq"].(string)
-                        nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
-                        er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2, nil)
-                        if er != nil {
-                            log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
-                        }
-                        if ok {
+						redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+						//用户日志保存
+						referer := l.Refer()
+						go jy.SaveUserLog(public.Mgo_Log,
+							_id,
+							phone,
+							"phone",
+							"pc",
+							source,
+							"",
+							jyutil.GetSearchEngine(gconv.String(l.GetSession("RSource"))),
+							gconv.String(sessVal["RSource"]),
+							qutil.GetIp(l.Request),
+							l.UserAgent(),
+							"jybx",
+							"",
+							referer)
+						jy.ClearPhoneIdentSession(l.Session())
+						ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
+						userInfo["isNewUser"] = true
+						nsqPath, _ := config.Sysconfig["nsq"].(string)
+						nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
+						er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2, nil)
+						if er != nil {
+							log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
+						}
+						if ok {
 							sessVal = l.Session().GetMultiple()
 							result["userInfo"] = userInfo
 							go anonymousLogin(l.Session(), l.Cookie("JYTrustedId"))

+ 25 - 12
src/jfw/front/org_structure.go

@@ -197,18 +197,31 @@ func (this *OrgStructure) AutoLogon() error {
 			}); resp != nil && resp.Data.Id > 0 {
 				data["base_user_id"] = resp.Data.Id
 				if id := mongodb.Save("user", data); id != "" {
-                    referer := this.Refer()
-                    go jy.SaveUserLog(public.Mgo_Log, id, openId, "wx", "pc", source, openId, gconv.String(this.GetSession("RSource")), gconv.String(this.GetSession("RSource")), util.GetIp(this.Request), this.UserAgent(), "jybx", "", referer)
-                    nsqPath, _ := config.Sysconfig["nsq"].(string)
-                    nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
-                    jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{
-                        "code":       1007,
-                        "types":      "bindPhone",
-                        "num":        50,
-                        "baseUserId": resp.Data.Id,
-                        "positionId": this.GetSession("positionId"),
-                    })
-                    if mail != "" {
+					referer := this.Refer()
+					go jy.SaveUserLog(public.Mgo_Log,
+						id,
+						phone,
+						"phone",
+						jyutil.IsAndroidOrIOS(this.UserAgent()),
+						source,
+						openId,
+						jyutil.GetSearchEngine(gconv.String(this.GetSession("RSource"))),
+						gconv.String(this.GetSession("RSource")),
+						util.GetIp(this.Request),
+						this.UserAgent(),
+						"",
+						"",
+						referer)
+					nsqPath, _ := config.Sysconfig["nsq"].(string)
+					nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
+					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{
+						"code":       1007,
+						"types":      "bindPhone",
+						"num":        50,
+						"baseUserId": resp.Data.Id,
+						"positionId": this.GetSession("positionId"),
+					})
+					if mail != "" {
 						jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{
 							"code":       1009,
 							"types":      "bindMail",

+ 21 - 6
src/jfw/front/otherAct.go

@@ -6,6 +6,7 @@ import (
 	"fmt"
 	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/config"
+	"jy/src/jfw/jyutil"
 	"log"
 	"regexp"
 	"time"
@@ -154,12 +155,26 @@ func (f *Front) Lpsubmit() error {
 			}
 			_id := mongodb.Save("user", data)
 			if _id != "" {
-                //用户日志保存
-                referer := f.Refer()
-                go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "landPage", "", gconv.String(f.GetSession("RSource")), util.ObjToString(f.GetSession("RSource")), util.GetIp(f.Request), f.UserAgent(), "jybx", "", referer)
-                deleteIdentSession(f.Session())
-                return "y"
-            }
+				//用户日志保存
+				referer := f.Refer()
+				source := f.GetString("source")
+				go jy.SaveUserLog(public.Mgo_Log,
+					_id,
+					phoneNum,
+					"phone",
+					jyutil.IsAndroidOrIOS(f.UserAgent()),
+					source,
+					"",
+					jyutil.GetSearchEngine(gconv.String(f.GetSession("RSource"))),
+					util.ObjToString(f.GetSession("RSource")),
+					util.GetIp(f.Request),
+					f.UserAgent(),
+					"",
+					"",
+					referer)
+				deleteIdentSession(f.Session())
+				return "y"
+			}
 			return "saveError"
 		}()
 	}

+ 22 - 8
src/jfw/front/pchelper.go

@@ -154,14 +154,28 @@ func (l *PcHelper) Login() error {
 						}
 						_id := mongodb.Save("user", data)
 						if _id != "" {
-                            referer := l.Refer()
-                            go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "pc", "", gconv.String(l.GetSession("RSource")), gconv.String(l.GetSession("RSource")), util.GetIp(l.Request), l.UserAgent(), "jybx", "", referer)
-                            jy.ClearPhoneIdentSession(l.Session())
-                            reToken = getUToken(mac, phone)
-                            reOpenId = phone
-                            reNickname = phone
-                            return 1
-                        }
+							referer := l.Refer()
+							source := l.GetString("source")
+							go jy.SaveUserLog(public.Mgo_Log,
+								_id,
+								phone,
+								"phone",
+								"pc",
+								source,
+								"",
+								jyutil.GetSearchEngine(gconv.String(l.GetSession("RSource"))),
+								gconv.String(l.GetSession("RSource")),
+								util.GetIp(l.Request),
+								l.UserAgent(),
+								"jybx",
+								"",
+								referer)
+							jy.ClearPhoneIdentSession(l.Session())
+							reToken = getUToken(mac, phone)
+							reOpenId = phone
+							reNickname = phone
+							return 1
+						}
 					} else {
 						updataMap := map[string]interface{}{}
 						if (*datas)[0]["s_m_phone"] != nil {

+ 22 - 0
src/jfw/jyutil/jyutil.go

@@ -360,3 +360,25 @@ func GetES(state int) *JyES {
 	}
 	return ESInfo
 }
+func IsAndroidOrIOS(s string) string {
+	typ := ""
+	if strings.Contains(s, "Android") {
+		typ = "Android"
+	} else if strings.Contains(s, "iPhone") || strings.Contains(s, "iPad") {
+		typ = "IOS"
+	} else {
+		typ = "other"
+	}
+	return typ
+}
+func GetSearchEngine(promotion string) string {
+	search_engine := ""
+	refererlist := config.Seoconfig["referer"].(map[string]interface{})
+	for k, v := range refererlist {
+		if promotion == v {
+			search_engine = k
+			break
+		}
+	}
+	return search_engine
+}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 585 - 586
src/jfw/modules/app/src/app/front/login.go


+ 1 - 1
src/jfw/modules/publicapply/src/oneclick/entity/entity.go

@@ -440,7 +440,7 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 					gconv.String(data["s_rsource"]),
 					o.R.Proto,
 					client,
-					gconv.String(common.If(isAndroidOrIOS(client) == "jyzbw", "jyzbw", "jybx")),
+					"",
 					"",
 					referer)
 				//用户中台同步

+ 2 - 0
src/jfw/modules/subscribepay/src/a/init.go

@@ -92,4 +92,6 @@ func init() {
 	xweb.AddRouter("/subscribepay", &service.BidCreditReport{})
 	//超级订阅赠送
 	xweb.AddRouter("/subscribepay", &service.VipGift{})
+	//获取配置项
+	xweb.AddRouter("/subscribepay", &service.Config{})
 }

+ 1 - 0
src/jfw/modules/subscribepay/src/config.yaml

@@ -86,3 +86,4 @@ bidCreditReport:
     - "5d6378301c298a5aac7b5402"
   performanceTime: 2018-01-01 00:00:00
   performanceSize: 100
+  makeTime: 30

+ 5 - 5
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport.go

@@ -24,7 +24,7 @@ import (
 	"time"
 )
 
-const esQuery = `{"query":{"bool":{"must":[{"term":{"s_winner":"%s"}},{"range":{"lasttime":{"gt":%d}}},{"exists":{"field":"projectname"}},{"exists":{"field":"buyer"}},{"exists":{"field":"lasttime"}}]}},"_source":["id","projectname","buyer","area","city","district","bidamount","lasttime","list.infoid","topscopeclass"],"sort":{"bidamount":"desc"},"size":%d}`
+const esQuery = `{"query":{"bool":{"must":[{"term":{"s_winner":"%s"}},{"range":{"lasttime":{"gt":%d}}},{"exists":{"field":"projectname"}},{"exists":{"field":"buyer"}},{"exists":{"field":"lasttime"}}]}},"_source":["id","projectname","buyer","area","city","district","sortprice","lasttime","list.infoid","topscopeclass"],"sort":{"sortprice":"desc"},"size":%d}`
 
 var BidCreditReport *bidCreditReport
 
@@ -327,15 +327,15 @@ func (b *bidCreditReport) Create(id int64) error {
 				} else if district != "" {
 					city = district
 				}
-				bidamount := "-"
-				if !vv.GetVar("bidamount").IsNil() {
-					bidamount = vv.GetVar("bidamount").String()
+				sortprice := "-"
+				if !vv.GetVar("sortprice").IsNil() {
+					sortprice = vv.GetVar("sortprice").String()
 				}
 				infoUrl := ""
 				if infos := vv.GetVar("list").Maps(); len(infos) > 0 {
 					infoUrl = config.Config.WebDomain + "/nologin/content/" + encrypt.CommonEncodeArticle("content", gmap.NewStrAnyMapFrom(infos[len(infos)-1]).GetVar("infoid").String()) + ".html"
 				}
-				records = append(records, []string{vv.GetVar("id").String(), projectName, buyer, gtime.New(vv.GetVar("lasttime").Int64()).Layout(time.DateTime), "-", bidamount, "-", area, city, "-", "-", infoUrl})
+				records = append(records, []string{vv.GetVar("id").String(), projectName, buyer, gtime.New(vv.GetVar("lasttime").Int64()).Layout(time.DateTime), "-", sortprice, "-", area, city, "-", "-", infoUrl})
 			}
 		}
 		if len(records) > 1 {

+ 2 - 2
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport_test.go

@@ -16,13 +16,13 @@ func TestEntSearch(t *testing.T) {
 }
 
 func TestEntRiskCheck(t *testing.T) {
-	BidCreditReport.EntHasRisk("", "91110105MA020L9F6R")
+	BidCreditReport.EntHasRisk("", "91310000132653687M")
 	time.Sleep(time.Minute)
 }
 
 // ZMEP9999202504070099000000057403 test_19s2t86cc40d90atjcd09q0100yvbpml
 func TestReportQuery(t *testing.T) {
-	BidCreditReport.ReportQuery("ZMEP9999202504070099000000057403")
+	BidCreditReport.ReportQuery("ZMEP9999202504090099000000057901")
 	time.Sleep(time.Minute)
 }
 

+ 2 - 1
src/jfw/modules/subscribepay/src/filter/sessionfilter.go

@@ -29,7 +29,8 @@ func (l *sessionfilter) Do() bool {
 		strings.HasPrefix(rqu, "/subscribepay/vip/gift/informInfo") || //vip赠送告知页面
 		strings.HasPrefix(rqu, "/subscribepay/vip/gift/configuration") || //vip赠送配置页面
 		rqu == "/jypay/wx/getwxSdkSign" || rqu == "/jypay/user/company/association" ||
-		rqu == "/jypay/equityCode/submit" || rqu == "/jypay/equityCode/captcha" || rqu == "/jypay/getDomain" { //微信js调用参数
+		rqu == "/jypay/equityCode/submit" || rqu == "/jypay/equityCode/captcha" || rqu == "/jypay/getDomain" || //微信js调用参数
+		rqu == "/subscribepay/config" { //获取配置项
 		return true
 	}
 	if l.GetSession["userId"] == nil {

+ 10 - 4
src/jfw/modules/subscribepay/src/service/bidCreditReport.go

@@ -11,6 +11,7 @@ import (
 	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/modules/subscribepay/src/entity/bidCreditReport"
 	"jy/src/jfw/modules/subscribepay/src/util"
+	"time"
 )
 
 type BidCreditReport struct {
@@ -104,9 +105,7 @@ func (this *BidCreditReport) UpdateReport() {
 			return fmt.Errorf("无效参数")
 		}
 		Id := gconv.Int64(infoMap["id"])
-		fool := util.Mysql.Update("bid_credit_report", map[string]interface{}{
-			"id": Id,
-		}, map[string]interface{}{
+		updateData := map[string]interface{}{
 			"prove_purchase":          gconv.String(infoMap["prove_purchase"]),
 			"prove_executed":          gconv.String(infoMap["prove_executed"]),
 			"prove_dishonesty":        gconv.String(infoMap["prove_dishonesty"]),
@@ -116,12 +115,19 @@ func (this *BidCreditReport) UpdateReport() {
 			"prove_dishonesty_status": gconv.Int64(infoMap["prove_dishonesty_status"]),
 			"prove_produce_status":    gconv.Int64(infoMap["prove_produce_status"]),
 			"creditchina":             gconv.String(infoMap["creditchina"]),
-		},
+		}
+		fool := util.Mysql.Update("bid_credit_report", map[string]interface{}{
+			"id": Id,
+		}, updateData,
 		)
 		if !fool {
 			return fmt.Errorf("图片修改失败")
 		}
 		bidCreditReport.BidCreditReport.Create(Id)
+		updateData["reportId"] = Id
+		updateData["method"] = "jianyu.upload"
+		updateData["createtime"] = time.Now().Unix()
+		util.Mgo_log.Save("bidcredit_report_log", updateData)
 		return nil
 	}()
 	if errMsg == nil {

+ 19 - 0
src/jfw/modules/subscribepay/src/service/config.go

@@ -0,0 +1,19 @@
+package service
+
+import (
+	"app.yhyue.com/moapp/jybase/api"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gctx"
+)
+
+type Config struct {
+	*xweb.Action
+	config xweb.Mapper `xweb:"/config"`
+}
+
+func (c *Config) Config() {
+	c.ServeJson(api.Result{Data: api.M{
+		"bidCreditReport_makeTime": g.Config().MustGet(gctx.New(), "bidCreditReport.makeTime").Int(),
+	}})
+}

+ 25 - 1
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -1112,7 +1112,20 @@ func (this *UserAccount) WxUnBind() {
 				return nil, DBUPDATE_ERROR
 			}
 			referer := this.Refer()
-			go jy.SaveUserLog(util.Mgo_log, saveId, phone, "phone", "wx", "wx", "", "", gconv.String(this.GetSession("RSource")), this.Request.Proto, this.UserAgent(), gconv.String(qutil.If(gconv.String((*unsetMap)["s_rsource"]) == "jyzbw", "jyzbw", "jybx")), "", referer)
+			go jy.SaveUserLog(util.Mgo_log,
+				saveId,
+				"",
+				"wx",
+				isAndroidOrIOS(this.Header("User-Agent")),
+				"wx",
+				s_m_openid,
+				"",
+				gconv.String((*unsetMap)["s_rsource"]),
+				this.Request.Proto,
+				this.UserAgent(),
+				"",
+				"",
+				referer)
 
 			flushWxsession = true
 		}
@@ -1166,6 +1179,17 @@ func (u *UserAccount) ShareUserId() {
 	}()
 	u.ServeJson(NewResult(rData, errMsg))
 }
+func isAndroidOrIOS(s string) string {
+	typ := ""
+	if strings.Contains(s, "Android") {
+		typ = "Android"
+	} else if strings.Contains(s, "iPhone") || strings.Contains(s, "iPad") {
+		typ = "IOS"
+	} else {
+		typ = "other"
+	}
+	return typ
+}
 
 //util---------------------------------
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно