소스 검색

Merge remote-tracking branch 'origin/dev4.6.3.4' into dev4.6.3.4

wangkaiyue 3 년 전
부모
커밋
894a1be5e4

+ 0 - 3
README.md

@@ -2,8 +2,5 @@
 微信和pc端功能
 weixin sdk https://github.com/wizjin/weixin
 web用xweb框架
-<<<<<<< HEAD
 v4.6.3.4
 大会员等落地页及购买页优化
-=======
->>>>>>> release

+ 1 - 2
src/entnichePc.json

@@ -1,5 +1,4 @@
 {
 	"entnichePcUser": [14595,442,1686,1685,1711],
-	"hideEntnicheMenu": [1711,442],
-	"privateDataPhone": "18530014520,13525530909,13938299083"
+	"hideEntnicheMenu": [1711,442]
 }

+ 2 - 1
src/jfw/front/dataExport.go

@@ -765,7 +765,8 @@ func (this *DataExport) GetPcEntAuth() {
 				}
 			}
 		}
-		if strings.Contains(config.EntnichePcConf.PrivateDataPhone, phone) {
+		userCount := public.Mysql.CountBySql("select count(1) from privatedata where phone=?", phone)
+		if userCount > 0 {
 			privatedata = true
 		}
 	}

+ 46 - 41
src/jfw/front/shorturl.go

@@ -176,6 +176,8 @@ func (s *Short) Article(stype, id string) error {
 
 		obj := wxvisitD(sid, userId, myopenid, isVip || isMember || isEntniche)
 		if len(obj) > 0 {
+			FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, isVip || isMember || isEntniche, true)
+
 			//获取打赏文案
 			s.T["rewardText"], s.T["advertText"] = getRewardText()
 			//纠错随机回复
@@ -185,9 +187,7 @@ func (s *Short) Article(stype, id string) error {
 			s.T["advertImg"] = config.Sysconfig["advertImg"]
 			s.T["advertName"] = config.Sysconfig["advertName"]
 			s.T["advertUrl"] = config.Sysconfig["advertUrl"]
-			FieldProcessing(obj, ssOpenid, industry, id, isVip || isMember || isEntniche)
 			s.T["obj"] = obj
-			BigMemberJump(obj, from_userid, userId, stype, id, true)
 			s.T["advertcode"] = s.GetString("advertcode")
 			content, _ := s.Render4Cache("/weixin/wxinfocontent_rec.html", &s.T)
 			return s.SetBody(content)
@@ -216,11 +216,7 @@ func (s *Short) Article(stype, id string) error {
 			s.DisableHttpCache()
 			po, bo, wo, obj := pcVRT(sid, industry, isVip || isMember || isEntniche)
 			if obj != nil && len(obj) > 0 {
-				href, _ := obj["href"].(string)
-				href = strings.Replace(href, "\n", "", -1)
-				if href != "" && !strings.HasPrefix(href, "http") {
-					href = "http://" + href
-				}
+
 				if len(po) > 0 {
 					s.T["projectOther"] = po
 				}
@@ -230,13 +226,12 @@ func (s *Short) Article(stype, id string) error {
 				if len(wo) > 0 {
 					s.T["winnerOther"] = wo
 				}
-				obj["url"] = href
-				FieldProcessing(obj, ssOpenid, industry, id, isVip || isMember || isEntniche)
+
+				FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, isVip || isMember || isEntniche, false)
 				s.T["obj"] = obj
 				if obj["projectname"] != nil {
 					s.SetSession("projectname", obj["projectname"])
 				}
-				BigMemberJump(obj, "", "", "", "", false)
 				content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
 				timeout := 60 * 20
 				if stype == "indexcontent" {
@@ -263,39 +258,11 @@ func SwiDef(sid_openid []string) (string, string) {
 	return shareopenid, sid
 }
 
-//大会员中标企业跳转至画像
-func BigMemberJump(obj map[string]interface{}, from_userid, userId, stype, id string, b bool) {
-	if obj["entidlist"] != nil {
-		if winner := util.ObjToString(obj["winner"]); winner != "" {
-			//临时更改为企业名称查询企业id
-			rData := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query":{"bool":{"should":[{"term":{"company_name":"%s"}},{"term":{"hname":"%s"}}],"minimum_should_match":1}},"_source":["name","_id","capital","company_phone"],"size":1}`, winner, winner))
-			if rData != nil && len(*rData) == 1 {
-				if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
-					obj["entId"] = util.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
-				}
-			}
-		}
-	}
-	//移动端需要处理
-	if b && from_userid != "" && se.Decode4Hex(from_userid) != "" && from_userid != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
-		article_id := util.CommonDecodeArticle(stype, id)[0]
-		key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, from_userid, userId)
-		if redis.Incr("other", key) == 1 {
-			redis.SetExpire("other", key, 60*60*24)
-			err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), jy.Jyweb_article_open, se.Decode4Hex(from_userid), jy.Jywx_node1)
-			if err != nil {
-				log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, se.Decode4Hex(from_userid))
-			}
-		}
-	}
-
-}
-
 //user 权限获取
 func UserPermission(userId string, ssOpenid interface{}) (bool, bool, bool) {
 	var (
-		res                         *map[string]interface{}
-		isVip, isMember, isEntniche bool
+		res                                      *map[string]interface{}
+		isVip, isMember, isEntniche, privatedata bool
 	)
 	if userId == "" && ssOpenid != nil {
 		res, _ = mongodb.FindOneByField("user", bson.M{"s_m_openid": ssOpenid, "s_unionid": bson.M{"$ne": ssOpenid}}, `{"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone":1}`)
@@ -310,12 +277,17 @@ func UserPermission(userId string, ssOpenid interface{}) (bool, bool, bool) {
 
 	if phone, _ := util.If(util.ObjToString((*res)["s_phone"]) != "", util.ObjToString((*res)["s_phone"]), util.ObjToString((*res)["s_m_phone"])).(string); phone != "" {
 		isEntniche = public.Mysql.CountBySql(`SELECT count(1) from entniche_user a INNER JOIN entniche_info b on (a.phone=? and a.power=1 and a.ent_id=b.id and b.status>0)`, phone) > 0
+		privatedata = public.Mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone) > 0
+	}
+	if !isEntniche && privatedata {
+		isEntniche = true
 	}
+
 	return isVip, isMember, isEntniche
 }
 
 //pc 移动共用字段处理
-func FieldProcessing(obj map[string]interface{}, ssOpenid interface{}, industry, id string, isPayUser bool) {
+func FieldProcessing(obj map[string]interface{}, ssOpenid interface{}, industry, id, from_userid, userId, stype string, isPayUser, b bool) {
 	obj["industry"] = industry
 	if ssOpenid != nil {
 		obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
@@ -332,6 +304,39 @@ func FieldProcessing(obj map[string]interface{}, ssOpenid interface{}, industry,
 			obj["winner_enttel"] = "无权限"
 		}
 	}
+	if !b {
+		href, _ := obj["href"].(string)
+		href = strings.Replace(href, "\n", "", -1)
+		if href != "" && !strings.HasPrefix(href, "http") {
+			href = "http://" + href
+		}
+		obj["url"] = href
+	}
+
+	//大会员中标企业跳转至画像
+	if obj["entidlist"] != nil {
+		if winner := util.ObjToString(obj["winner"]); winner != "" {
+			//临时更改为企业名称查询企业id
+			rData := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query":{"bool":{"should":[{"term":{"company_name":"%s"}},{"term":{"hname":"%s"}}],"minimum_should_match":1}},"_source":["name","_id","capital","company_phone"],"size":1}`, winner, winner))
+			if rData != nil && len(*rData) == 1 {
+				if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
+					obj["entId"] = util.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
+				}
+			}
+		}
+	}
+	//移动端需要处理
+	if b && from_userid != "" && se.Decode4Hex(from_userid) != "" && from_userid != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
+		article_id := util.CommonDecodeArticle(stype, id)[0]
+		key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, from_userid, userId)
+		if redis.Incr("other", key) == 1 {
+			redis.SetExpire("other", key, 60*60*24)
+			err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), jy.Jyweb_article_open, se.Decode4Hex(from_userid), jy.Jywx_node1)
+			if err != nil {
+				log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, se.Decode4Hex(from_userid))
+			}
+		}
+	}
 }
 
 //disWord 为空时处理

+ 0 - 1
src/jfw/front/swordfish.go

@@ -320,7 +320,6 @@ func (m *Front) WxsearchlistPaging() {
 		//历史记录和订阅查询
 		one, _ := mongodb.FindById("user", userId, `{"o_jy":1}`)
 		history := redis.GetStr("other", "s_"+userId)
-		arrs = strings.Split(history, ",")
 		searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
 
 		if searchvalue != "" {

+ 26 - 47
src/jfw/modules/app/src/app/front/shorturl.go

@@ -53,12 +53,11 @@ func (s *Short) Article(stype, id string) error {
 				//是否计算佣金
 				if time.Now().Unix() <= effectiveTime {
 					belongUserId = strings.Split(redisDis, "##")[1]
-					if public.Mysql.ExecTx("口号使用", func(tx *sql.Tx) bool {
+					public.Mysql.ExecTx("口号使用", func(tx *sql.Tx) bool {
 						//口号是否使用过
 						wordInfo := public.Mysql.Find("dis_word", map[string]interface{}{"userId": userId, "password": disWord}, "id", "", 0, 0)
 						if len((*wordInfo)) == 0 {
 							//新增口号使用
-							wordInfo = public.Mysql.Find("dis_word", map[string]interface{}{"userId": userId}, "id,start_time,stop_time", "stop_time", 0, 1)
 							start_time := time.Now().Format(DateFullLayout)
 							termValidityInt, _ := strconv.Atoi(fmt.Sprint(config.Sysconfig["termValidity"]))
 							stop_time := TimeProcessing(time.Now().Format(DateFullLayout), termValidityInt).Format(DateFullLayout)
@@ -73,10 +72,8 @@ func (s *Short) Article(stype, id string) error {
 							log.Println("插入口号使用表", insert_1)
 						}
 						return true
-					}) {
-					}
+					})
 				}
-
 			}
 		}
 	}
@@ -84,29 +81,11 @@ func (s *Short) Article(stype, id string) error {
 	if b {
 		return s.Redirect("/jyapp/free/mob/err")
 	}
-	//判断用户是否是vip用户
-	isVip, i_member_status, isEntniche, email, phone := false, 0, false, "", ""
-	data, ok := mongodb.FindById("user", userId, `{"i_vip_status":1,"i_member_status":1,"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
-	if ok && data != nil && len(*data) > 0 {
-		i_vip_status := util.IntAll((*data)["i_vip_status"])
-		if i_vip_status > 0 {
-			isVip = true
-		}
-		i_member_status = util.IntAllDef((*data)["i_member_status"], 0)
-		email = util.ObjToStringDef((*data)["s_myemail"], "")
-		if s_phone, _ := (*data)["s_phone"].(string); s_phone != "" {
-			phone = s_phone
-		} else if s_m_phone, _ := (*data)["s_m_phone"].(string); s_m_phone != "" {
-			phone = s_m_phone
-		}
-	}
+
+	isVip, isEntniche, i_member_status, email := UserPermission(userId)
 	s.T["isVip"] = isVip
 	s.T["member_status"] = i_member_status
 	s.T["email"] = email
-	//判断用户是否是商机管理付费用户
-	if public.Mysql.CountBySql(`select count(1) from entniche_user where phone=? and power=1`, phone) > 0 {
-		isEntniche = true
-	}
 	s.T["isEntniche"] = isEntniche
 	s.T["isMember"] = i_member_status > 0
 	surl := s.GetString("url")
@@ -155,28 +134,6 @@ func (s *Short) Article(stype, id string) error {
 						obj["entId"] = util.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
 					}
 				}
-				//s_winner := util.ObjToString(obj["s_winner"])
-				//idObjs, _ := obj["entidlist"].([]interface{})
-				//winnerId := ""
-				//if names := strings.Split(s_winner, ","); len(names) > 1 {
-				//	index := 0
-				//	for i := 0; i < len(names); i++ {
-				//		if names[i] == winner {
-				//			index = i
-				//			break
-				//		}
-				//	}
-				//	if len(idObjs) > index {
-				//		winnerId = util.ObjToString(idObjs[index])
-				//	}
-				//} else { //中标企业仅一个
-				//	if len(idObjs) > 0 {
-				//		winnerId = util.ObjToString(idObjs[0])
-				//	}
-				//}
-				//if winnerId != "" {
-				//	obj["entId"] = util.EncodeArticleId2ByCheck(winnerId)
-				//}
 			}
 		}
 		s.T["userId"] = se.Encode2Hex(userId) //加密用户userid
@@ -241,3 +198,25 @@ func getwinnertel(company interface{}) string {
 	}
 	return ""
 }
+
+func UserPermission(userId string) (isVip, isEntniche bool, i_member_status int, email string) {
+	var phone string
+	data, ok := mongodb.FindById("user", userId, `{"i_vip_status":1,"i_member_status":1,"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
+	if ok && data != nil && len(*data) > 0 {
+		i_vip_status := util.IntAll((*data)["i_vip_status"])
+		if i_vip_status > 0 {
+			isVip = true
+		}
+		i_member_status = util.IntAllDef((*data)["i_member_status"], 0)
+		email = util.ObjToStringDef((*data)["s_myemail"], "")
+		if s_phone, _ := (*data)["s_phone"].(string); s_phone != "" {
+			phone = s_phone
+		} else if s_m_phone, _ := (*data)["s_m_phone"].(string); s_m_phone != "" {
+			phone = s_m_phone
+		}
+	}
+	if public.Mysql.CountBySql(`select count(1) from entniche_user where phone=? and power=1`, phone) > 0 {
+		isEntniche = true
+	}
+	return
+}

+ 7 - 1
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -429,7 +429,7 @@ func GetCollList(c *util.CollList, userid string) map[string]interface{} {
 
 //是否是付费用户 -bool: true:是 fasle:不是
 func Power(userid string) (bool, map[string]interface{}) {
-	isVip, isMember, isEnt := false, false, false
+	isVip, isMember, isEnt, privatedata := false, false, false, false
 	vipstatus := 0
 	phone := ""
 	var registedate int64
@@ -468,6 +468,11 @@ func Power(userid string) (bool, map[string]interface{}) {
 			// if db.Mysql.CountBySql(`select count(1) from entniche_user where phone = ? and power =1`, phone) > 0 {
 			// 	isEnt = true
 			// }
+			//广州移动判断
+			privatedataCount := db.Mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone)
+			if privatedataCount > 0 {
+				privatedata = true
+			}
 		}
 		registedate, _ = (*data)["l_registedate"].(int64)
 	}
@@ -475,6 +480,7 @@ func Power(userid string) (bool, map[string]interface{}) {
 		"vip":         vipstatus,
 		"member":      isMember,
 		"entniche":    isEnt,
+		"privatedata": privatedata,
 		"registedate": registedate,
 	}
 }

+ 2 - 1
src/web/templates/pc/biddetail_rec.html

@@ -1249,6 +1249,7 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
 			bidmember = res.data.member
 			entniche = res.data.entniche
 			vip = res.data.vip
+      privatedata = res.data.privatedata
 			var subType = {{.T.obj.subtype}}
 			// if(subType == '采购意向' && !bidmember && !entniche && vip <=0){
 			// 	$(".com-prebuilt").removeClass("hidden");
@@ -1258,7 +1259,7 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
 				$(".tip-box .tip-text").eq(0).text('采购意向项目全公开,抢先获知采购项目需求,')
 				$(".tip-box .tip-text").eq(1).text('提前主动介入,中标几率更高!')
 			}
-			if ((subType == '拟建' || subType == '采购意向') && !bidmember && !entniche && vip <=0){
+			if ((subType == '拟建' || subType == '采购意向') && !bidmember && !entniche && vip <=0 && !privatedata){
 				$(".com-prebuilt").removeClass("hidden");
 				$(".com-prebuilt").css('height', '408px')
 				$('.original-text').remove()