Răsfoiți Sursa

Merge branch 'master' into feature/v4.7.34

lianbingjie 2 ani în urmă
părinte
comite
b2e4a6d302

+ 3 - 100
src/jfw/modules/bigmember/src/entity/followEnterprise.go

@@ -117,8 +117,8 @@ func (this *EntFollow) EntFollowedShow(entId string) (followed, showFollow bool,
 // param A默认分组 B竞争对手 C合作伙伴 逗号分隔
 // db  0||nil 默认分组、1 竞争对手、2 合作伙伴、3 竞争对手和合作伙伴
 func (this *EntFollow) GetEntFollowList(pNum, pSize int, match, group string) (followData []map[string]interface{}, hasNext bool, count, total int, err error) {
-	log.Print("我关注的企业列表开始查询")
-	flistSql := fmt.Sprintf(`SELECT id,f_capital,i_apppushunread,l_establishdate,l_lastpushtime,s_area,s_city,s_employeeno,s_entId,s_entname,i_group,s_phone FROM follow_ent_monitor WHERE  s_userid="%s" ORDER BY l_createtime DESC LIMIT %d,%d`, this.UserId, 0, this.MaxNum)
+	flistSql := fmt.Sprintf(`SELECT id,f_capital,i_apppushunread,l_establishdate,l_lastpushtime,s_area,s_city,s_employeeno,s_entId,s_entname,i_group,s_phone FROM follow_ent_monitor WHERE  s_userid="%s" ORDER BY l_lastpushtime DESC,l_createtime DESC LIMIT %d,%d`, this.UserId, 0, this.MaxNum)
+	log.Print("我关注的企业列表开始查询:", flistSql)
 	res := db.Base.SelectBySql(flistSql)
 	if res == nil || len(*res) == 0 {
 		//err = errors.New("查询异常")
@@ -126,39 +126,7 @@ func (this *EntFollow) GetEntFollowList(pNum, pSize int, match, group string) (f
 	}
 	log.Print("我关注的企业列表查询结束")
 	count = len(*res)
-	//var names []string
-	//for _, data := range *res {
-	//	if data["s_area"] == nil || data["s_city"] == nil || data["s_phone"] == nil || data["s_employeeno"] == nil || data["f_capital"] == nil {
-	//		//根据企业名字查询企业信息
-	//		names = append(names, qutil.ObjToString(data["s_entname"]))
-	//	}
-	//}
-	//
-	//fullData := getEntMsgByNames(names)
-	//if group != "" {
-	//		var igroup string
-	//		if strings.Index(group, "A") > -1 {
-	//			igroup = `i_group = 0 AND`
-	//		}
-	//		if strings.Index(group, "B") > -1 && strings.Index(group, "C") > -1 {
-	//			igroup = `(i_group = 1 OR i_group = 2 OR i_group = 3 ) AND`
-	//		} else {
-	//			if strings.Index(group, "B") > -1 {
-	//				igroup = `(i_group = 1 OR i_group = 3 ) AND`
-	//			} else if strings.Index(group, "C") > -1 {
-	//				igroup = `(i_group = 2 OR i_group = 3 ) AND`
-	//			}
-	//		}
-	//		flistSql = fmt.Sprintf(flistSql, igroup)
-	//		countSql = fmt.Sprintf(countSql, igroup)
-	//	} else {
-	//		flistSql = fmt.Sprintf(flistSql, ``)
-	//		countSql = fmt.Sprintf(countSql, ``)
-	//	}
-	// if match = strings.TrimSpace(match); match != "" {
-	//        flistSql = flistSql + `AND s_entname LIKE "%` + match + `%"`
-	//        countSql = countSql + `AND s_entname LIKE "%` + match + `%"`
-	//    }
+
 	var followDataAll []map[string]interface{}
 	for _, item := range *res {
 		//兼容从大会员变成免费用户时筛选条件数据错乱问题 取数据全部取出后在进行筛选过滤
@@ -215,71 +183,6 @@ func (this *EntFollow) GetEntFollowList(pNum, pSize int, match, group string) (f
 	}
 
 	hasNext = qutil.If((pNum+1)*pSize >= len(followDataAll), false, true).(bool)
-	/*if this.HasPower { //购买企业情报的用户直接查询
-	  	res, _ := db.Mgo.Find(this.SaveTable, query, `{"l_lastpushtime":-1}`, `{"_id":1,"s_entname":1,"s_area":1,"s_city":1,"s_phone":1,"f_capital":1,"s_employeeno":1,"l_establishdate":1,"i_apppushunread":1,"s_entId":1,"l_lastpushtime":1,"i_group":1}`, false, pNum*size, pSize)
-	  	if res == nil || len(*res) == 0 {
-	  		err = errors.New("查询异常")
-	  		return
-	  	}
-	  	//followData = *res
-	  	//加密entId
-	  	for _, item := range *res {
-	  		entId := qutil.ObjToString(item["s_entId"])
-	  		if entId == "" { //dev3.6.2 前关注企业未存入企业id
-	  			//查询企业entid
-	  			entId = this.updateFollowed(item)
-	  		}
-	  		followData = append(followData, map[string]interface{}{
-	  			"fid":             util.EncodeId(mongodb.BsonIdToSId(item["_id"])),
-	  			"s_entId":         util.EncodeId(entId),
-	  			"f_capital":       item["f_capital"],
-	  			"l_establishdate": item["l_establishdate"],
-	  			"s_area":          item["s_area"],
-	  			"s_city":          item["s_city"],
-	  			"s_employeeno":    item["s_employeeno"],
-	  			"s_entname":       item["s_entname"],
-	  			"s_phone":         item["s_phone"],
-	  			"i_apppushunread": item["i_apppushunread"],
-	  			"l_lastpushtime":  item["l_lastpushtime"],
-	  			"s_group":         parseGroupStr(qutil.IntAll(item["i_group"])),
-	  		})
-	  	}
-	  } else { //免费用户根据企业名称 二次查询企业id、成立时间等数据
-	  	res, _ := db.Mgo.Find(this.SaveTable, query, `{"l_lastpushtime":-1}`, `{"_id":1,"s_entname":1,"i_apppushunread":1,"l_lastpushtime":1,"i_group":1}`, false, pNum*size, pSize)
-	  	if res == nil || len(*res) == 0 {
-	  		err = errors.New("查询异常")
-	  		return
-	  	}
-	  	//根据企业名字查询企业信息
-	  	var names []string
-	  	for _, data := range *res {
-	  		names = append(names, qutil.ObjToString(data["s_entname"]))
-	  	}
-	  	fullData := getEntMsgByNames(names)
-
-	  	for _, item := range *res {
-	  		entName, _ := item["s_entname"].(string)
-	  		rowMap := map[string]interface{}{
-	  			"fid":             util.EncodeId(mongodb.BsonIdToSId(item["_id"])),
-	  			"s_entname":       entName,
-	  			"i_apppushunread": item["i_apppushunread"],
-	  			"l_lastpushtime":  item["l_lastpushtime"],
-	  			"s_group":         parseGroupStr(qutil.IntAll(item["i_group"])),
-	  		}
-	  		if supplement, ok := fullData[entName]; ok {
-	  			//企业id
-	  			if entId, _ := supplement["_id"].(string); entId != "" {
-	  				rowMap["s_entId"] = util.EncodeId(entId)
-	  			}
-	  			rowMap["l_establishdate"] = supplement["establish_date"] //成立时间
-	  			rowMap["f_capital"] = supplement["capital"]              //注册资本
-	  			rowMap["s_area"] = supplement["company_area"]            //企业省份
-	  			rowMap["s_city"] = supplement["company_city"]            //城市
-	  			rowMap["s_phone"] = supplement["company_phone"]          //企业电话
-	  		}
-	  		followData = append(followData, rowMap)
-	  	}
-	  }*/
 	return
 }
 

+ 1 - 1
src/jfw/modules/bigmember/src/entity/followProject.go

@@ -335,7 +335,7 @@ func (this *ProjectFollow) GetFollowList(pNum, pSize, entUserId int) (followData
 		"s_userid": this.UserId,
 	}
 	t1 := time.Now()
-	followList := db.Base.Find(this.SaveTable, query, "l_lastpushtime,s_id,i_remind,id,l_createtime,i_apppushunread", "l_createtime desc", 0, pSize)
+	followList := db.Base.Find(this.SaveTable, query, "l_lastpushtime,s_id,i_remind,id,l_createtime,i_apppushunread", "l_lastpushtime desc,l_createtime desc", 0, pSize)
 	log.Println("查询耗时:", time.Since(t1), "数据量:", len(*followList))
 	if followList != nil && len(*followList) > 0 {
 		sidArr := []string{}

+ 5 - 1
src/jfw/modules/followent/src/config.json

@@ -4,5 +4,9 @@
     "cacheflag": false,
     "agreement": "https",
 	"followentlimit":"10",
-    "recommendEntLimit":"50"
+    "recommendEntLimit":"50",
+    "resourceCenter": "https://web-zxl.jydev.jianyu360.com",
+    "resourceCenterUrl": {
+	    "haspowers": "/resourceCenter/haspowers"
+	}
 }

+ 20 - 14
src/jfw/modules/followent/src/followent/followent.go

@@ -6,6 +6,7 @@ import (
 	"jfw/jylabutil"
 	"jfw/public"
 	"jfw/wx"
+	"log"
 	. "mongodb"
 	"qfw/util"
 	"qfw/util/jy"
@@ -130,30 +131,35 @@ func (f *FollowEnt) Detail(followId string) error {
 	if userId == "" {
 		return f.Redirect("/swordfish/about")
 	}
+	follow := "n"
 	followId = util.DecodeArticleId2ByCheck(followId)[0]
 	winner := ""
 	var a_visited interface{}
 	oneQy := base.FindOne("follow_ent_monitor", map[string]interface{}{
 		"id": followId,
-	}, `s_entname,s_id,s_userid`, "")
+	}, `s_entname,s_id,s_userid,i_apppushunread`, "")
 	fmt.Println(oneQy)
 	if oneQy == nil {
 		return f.Redirect("/jylab/followent/entList")
 	}
-	follow := "n"
-	if oneQy == nil || len(*oneQy) == 0 {
-		oneQy, _ = mongodb.FindOneByField("jylab_followent_back", map[string]interface{}{
-			"s_followid": followId,
-		}, `{"s_entname":1,"s_id":1,"a_visited":1,"s_userid":1}`)
-	}
-	if oneQy == nil || len(*oneQy) == 0 {
-		return f.Render("_error.html")
-	} else if util.ObjToString((*oneQy)["s_userid"]) != userId {
-		return f.Redirect(fmt.Sprintf("/jylab/followent/newInfo/%s", util.ObjToString((*oneQy)["s_entname"])))
-	}
-	if (*oneQy)["a_visited"] != nil {
-		a_visited = (*oneQy)["a_visited"]
+	if util.IntAll((*oneQy)["i_apppushunread"]) == 1 {
+		if base.UpdateOrDeleteBySql(`UPDATE follow_ent_monitor SET i_apppushunread = 0 WHERE id = ?`, followId) == 0 {
+			log.Println("更新已读失败....")
+		}
 	}
+	// if oneQy == nil || len(*oneQy) == 0 {
+	// 	oneQy, _ = mongodb.FindOneByField("jylab_followent_back", map[string]interface{}{
+	// 		"s_followid": followId,
+	// 	}, `{"s_entname":1,"s_id":1,"a_visited":1,"s_userid":1}`)
+	// }
+	// if oneQy == nil || len(*oneQy) == 0 {
+	// 	return f.Render("_error.html")
+	// } else if util.ObjToString((*oneQy)["s_userid"]) != userId {
+	// 	return f.Redirect(fmt.Sprintf("/jylab/followent/newInfo/%s", util.ObjToString((*oneQy)["s_entname"])))
+	// }
+	// if (*oneQy)["a_visited"] != nil {
+	// 	a_visited = (*oneQy)["a_visited"]
+	// }
 	follow = "y"
 	winner = util.ObjToString((*oneQy)["s_entname"])
 	f.T["data"] = public.GetWinnerNewestDatas(winner)

+ 22 - 1
src/jfw/modules/followent/src/web/templates/weixin/list.html

@@ -21,12 +21,22 @@ if(sessionStorage){
 
 </head>
 <style>
-    #pro_footer{
+  #pro_footer{
 		position: fixed;
 		left: 0;
 		right: 0;
 		bottom: 0;
 	}
+  
+  .listpage .redspot{
+      position: absolute;
+      width: 8px;
+      height: 8px;
+      background: #f12c20;
+      border-radius: 100%;
+      top: 10px;
+      right: -5px;
+  }
 </style>
 <body class="listpage">
 	<ul>
@@ -201,6 +211,7 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
             var lastpushtime = frontarr[f]["l_lastpushtime"];
             var rem = "";
             var tdf ="";
+            var redSpot = "";
             var timestamp = parseInt($.now()/ 1000);
             if (lastpushtime == undefined||lastpushtime==""){
                 lastpushtime = frontarr[f]["l_createtime"];
@@ -217,10 +228,14 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
             if(typeof (entname)=="undefined"){
                 entname = "";
             }
+    				if(frontarr[f]["i_apppushunread"]==1){
+    					redSpot = '<i class="redspot"></i>';
+    				}
             fronthtml +="<li data-id='"+frontarr[f]["fid"]+"' Sort='"+lastpushtime+"'>"
                 +"<div class='jyfwlistno'>"+listno+".</div>"
                 +"<div class='jyfwlisttitle'>"+entname+"</div>"
                 +"<div style='clear:both;'></div>"+rem
+                +redSpot
                 +"<img src='/jylab/followent/images/wx/d.png' class='arrow-right'>"
                 +"<div class='jytimest'>"
                 +tdf+"</li>";
@@ -232,6 +247,7 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
             var lastpushtime = lastarr[l]["l_lastpushtime"];
             var rem = "";
             var tdf ="";
+            var redSpot = "";
             var timestamp = parseInt($.now()/ 1000);
             if (lastpushtime == undefined || lastpushtime==""){
                 lastpushtime = lastarr[l]["l_createtime"];
@@ -244,11 +260,15 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
                 tdf=""
             }
 
+    				if(lastarr[l]["i_apppushunread"]==1){
+    					redSpot = '<i class="redspot"></i>';
+    				}
             var listno = parseInt(l)+parseInt(1)+jyno;
             lasthtml +="<li class='jyovertime' data-id='"+lastarr[l]["fid"]+"'>"
             +"<div class='jyfwlistno'>"+listno+".</div>"
             +"<div class='jyfwlisttitle'>"+lastarr[l]["s_entname"]+"</div>"
             +"<div style='clear:both;'></div>"+rem
+				    +redSpot
             +"<img src='/jylab/followent/images/wx/d.png' class='arrow-right'>"
             +"<div class='jytimest'>"
             +tdf+"</li>";
@@ -262,6 +282,7 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
             if(sessionStorage){
                 sessionStorage.version="0";
             }
+            $(this).find(".redspot").remove();
             window.location.href = "/jylab/followent/detail/"+$(this).attr("data-id");
         });
 

+ 0 - 1
src/web/staticres/js/ent-search-index-pc.js

@@ -633,7 +633,6 @@ var vm = new Vue({
             $.ajax({
                 url: '/bigmember/portrait/subVipPortrait/usage',
                 method: 'POST',
-                data: data,
                 success: function (res) {
                     if (res.error_code === 0) {
                         if (res.data.total) {

+ 1 - 0
src/web/templates/common/pcbottom.html

@@ -38,6 +38,7 @@
                       <dd><a href="/big/page/qy">竞争对手分析</a></dd>
                       <dd><a href="/big/page/sc">市场分析</a></dd>
                       <dd><a href="/big/page/cg">客户分析</a></dd>
+                      <dd><a href="/jyblog/index.html">剑鱼博客</a></dd>
                     </dl>
                     <dl>
                         <dt>数据</dt>

+ 4 - 2
src/web/templates/pc/index.html

@@ -480,12 +480,14 @@
           slidesPerView: 1,
           centeredSlides: true,
           observer: true,
-          speed: 500,
+          speed: 800,
           pagination: {
             el: '.swiper-pagination',
             clickable :true
           },
-          autoplay: $('#bannerSwiper').find('.swiper-slide').length > 1 ? true : false, // imageList.length > 1 ? true : false
+          autoplay: $('#bannerSwiper').find('.swiper-slide').length > 1 ? {
+            delay: 10000
+          } : false, // imageList.length > 1 ? true : false
           paginationClickable: true,
           loop: $('#bannerSwiper').find('.swiper-slide').length > 1 ? true : false, // imageList.length > 1 ? true : false
           on: {