瀏覽代碼

fix:拟建&采购意向不展示遮罩

duxin 2 年之前
父節點
當前提交
04ce2a1011
共有 4 個文件被更改,包括 738 次插入695 次删除
  1. 0 0
      src/config.json
  2. 61 5
      src/jfw/front/shorturl.go
  3. 1 2
      src/jfw/front/swordfish.go
  4. 676 688
      src/jfw/modules/app/src/app/front/shorturl.go

File diff suppressed because it is too large
+ 0 - 0
src/config.json


+ 61 - 5
src/jfw/front/shorturl.go

@@ -431,8 +431,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 				if !canRead { //登录拟建&采购不展示遮罩 只打码
 					canRead = true
 					//打码显示引导
-					Filter(obj)
-					s.T["isGuide"] = true
+					otherFilter(obj, userId != "")
 				}
 				s.T["advertcode"] = s.GetString("advertcode")
 			} else {
@@ -583,8 +582,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 				}
 				if !node {
 					//打码遮罩
-					Filter(obj)
-					s.T["isGuide"] = true
+					s.T["canRead"] = true
+					otherFilter(obj, userId != "")
 				}
 			} else {
 				obj = map[string]interface{}{
@@ -987,6 +986,9 @@ func Filter(obj map[string]interface{}) map[string]interface{} {
 	//	}
 	//}
 	//
+	if detailNeedMosaic == nil {
+		detailNeedMosaic, _ = config.Sysconfig["detailNeedMosaic"].(map[string]interface{})
+	}
 	for dk, dv := range detailNeedMosaic {
 		if !dv.(bool) {
 			continue
@@ -1021,6 +1023,56 @@ func Filter(obj map[string]interface{}) map[string]interface{} {
 	return obj
 }
 
+// 拟建采购意向用户进行数据过滤 name 配置文件
+func otherFilter(obj map[string]interface{}, isLogin bool) map[string]interface{} {
+	txt := util.If(isLogin, "解锁会员查看", "登陆后解锁会员查看").(string)
+	detail := fmt.Sprint(obj["detail"])
+	mosaicText := fmt.Sprintf(`<span style="color:#2ABED1;">%s</span>`, txt)
+	detailText := fmt.Sprintf(`<span class="noLoginMosaic" style="color: #2ABED1;">%s</span>`, txt)
+	var otherMosaic map[string]interface{}
+	if obj["subtype"] == "拟建" {
+		otherMosaic, _ = config.Sysconfig["planBuildMosaic"].(map[string]interface{})
+	} else if obj["subtype"] == "采购意向" {
+		otherMosaic, _ = config.Sysconfig["purchaseMosaic"].(map[string]interface{})
+		pattern := regexp.MustCompile(`<td>(.*?)</td>`)
+		detail = pattern.ReplaceAllString(detail, fmt.Sprintf("<td>%s</td>", detailText))
+	}
+
+	for dk, dv := range otherMosaic {
+		if !dv.(bool) {
+			continue
+		}
+		//if util.ObjToString(obj[dk]) != "" {
+		//	detail = strings.ReplaceAll(detail, util.ObjToString(obj[dk]), detailText)
+		//}
+
+		if vs, ok := obj[dk]; ok && vs != nil {
+			value, b := obj[dk].(float64)
+			if b {
+				replaceStr := fmt.Sprintf("%v", int64(value))
+				detail = strings.ReplaceAll(detail, replaceStr, detailText)
+			} else {
+				detail = strings.ReplaceAll(detail, util.InterfaceToStr(obj[dk]), detailText)
+			}
+		}
+
+		if dk == "winnerMap" {
+			winnerNewMap := map[string]interface{}{}
+			if obj[dk] != nil {
+				winnerMap := util.ObjToMap(obj[dk])
+				for _, wv := range *winnerMap {
+					winnerNewMap[mosaicText] = wv
+				}
+			}
+			obj[dk] = winnerNewMap
+		} else {
+			obj[dk] = mosaicText
+		}
+	}
+	obj["detail"] = detail
+	return obj
+}
+
 // 未登录用户进行数据过滤 name 配置文件
 func SearchFilter(obj map[string]interface{}) map[string]interface{} {
 	//detail := fmt.Sprint(obj["detail"])
@@ -1125,7 +1177,11 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
 				obj["projectnameTitle"] = obj["projectname"]
 				obj["projectcodeTitle"] = obj["projectcode"]
 				log.Println(time.Now().UnixNano())
-				obj = Filter(obj)
+				if obj["subtype"] == "拟建" || obj["subtype"] == "采购意向" {
+					otherFilter(obj, false)
+				} else {
+					obj = Filter(obj)
+				}
 				//obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
 			}
 			obj["agency"] = ""

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

@@ -699,13 +699,12 @@ func ObjData(isPayUser bool, sid, content string, lent int) (t bool, obj map[str
 		t = true
 		if !isPayUser && (content != "indexcontent") && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
 			if lent == 0 {
-				delete(obj, "detail")
+				//delete(obj, "detail")
 				delete(obj, "projectinfo")
 				goto env
 			}
 			for k, _ := range obj {
 				if k != "title" && k != "area" && k != "subtype" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" && k != "site" && k != "spidercode" && k != "recommended_service" &&
-					//"owner":1,"total_investment":1,"projectaddr":1,"projectperiod":1,"approvedept":1,"approvecontent":1,"approvecode":1,"approvenumber":1,"approvetime":1,"approvestatus":1,"project_scale":1
 					k != "owner" && k != "total_investment" && k != "projectaddr" && k != "projectperiod" && k != "approvedept" && k != "approvecontent" && k != "approvecode" && k != "approvenumber" && k != "approvetime" && k != "approvestatus" && k != "project_scale" && k != "projectname" {
 					delete(obj, k)
 				}

+ 676 - 688
src/jfw/modules/app/src/app/front/shorturl.go

@@ -1,764 +1,752 @@
 package front
 
 import (
-    "database/sql"
-    "errors"
-    "fmt"
-    utils "jy/src/jfw/modules/app/src/app/jyutil"
-    "jy/src/jfw/modules/app/src/jfw/config"
-    "regexp"
-    "strconv"
-    "strings"
-    "time"
+	"database/sql"
+	"errors"
+	"fmt"
+	utils "jy/src/jfw/modules/app/src/app/jyutil"
+	"jy/src/jfw/modules/app/src/jfw/config"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
 
-    "github.com/gogf/gf/v2/util/gconv"
+	"github.com/gogf/gf/v2/util/gconv"
 
-    "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
 
-    //"math/rand"
-    . "jy/src/jfw/modules/app/src/app/jyutil"
-    "log"
+	//"math/rand"
+	. "jy/src/jfw/modules/app/src/app/jyutil"
+	"log"
 
-    util "app.yhyue.com/moapp/jybase/common"
-    elastic "app.yhyue.com/moapp/jybase/es"
-    "app.yhyue.com/moapp/jybase/go-xweb/xweb"
-    "app.yhyue.com/moapp/jybase/redis"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-    "app.yhyue.com/moapp/jypkg/public"
+	util "app.yhyue.com/moapp/jybase/common"
+	elastic "app.yhyue.com/moapp/jybase/es"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"app.yhyue.com/moapp/jypkg/public"
 )
 
 type Short struct {
-    *xweb.Action
-    article     xweb.Mapper `xweb:"/jyapp/article/(\\w+)/(.*).html"` //([pm])
-    replication xweb.Mapper `xweb:"/jyapp/shorturl/replication"`     //用户复制操作记录入库
+	*xweb.Action
+	article     xweb.Mapper `xweb:"/jyapp/article/(\\w+)/(.*).html"` //([pm])
+	replication xweb.Mapper `xweb:"/jyapp/shorturl/replication"`     //用户复制操作记录入库
 }
 
 func init() {
-    xweb.AddAction(&Short{})
+	xweb.AddAction(&Short{})
 }
 
 var DateFullLayout = "2006-01-02 15:04:05"
 var suffix_msgt = "_SX"
 var TypeCodeMap = map[string]string{
-    "拟建":     "拟建项目",
-    "采购意向": "采购意向",
-    "预告":     "招标预告",
-    "预审":     "资格预审",
-    "预审结果": "资格预审结果",
-    "论证意见": "论证意见",
-    "需求公示": "需求公示",
-    "招标":     "公开招标",
-    "邀标":     "邀请招标",
-    "询价":     "询价采购",
-    "竞谈":     "竞争性谈判",
-    "单一":     "单一来源采购",
-    "竞价":     "竞价公告",
-    "变更":     "变更公告",
-    "中标":     "中标公示",
-    "成交":     "成交公告",
-    "废标":     "废标公告",
-    "流标":     "流标公告",
-    "合同":     "合同公告信息",
-    "验收":     "验收公告信息",
-    "违规":     "违规信息",
+	"拟建":   "拟建项目",
+	"采购意向": "采购意向",
+	"预告":   "招标预告",
+	"预审":   "资格预审",
+	"预审结果": "资格预审结果",
+	"论证意见": "论证意见",
+	"需求公示": "需求公示",
+	"招标":   "公开招标",
+	"邀标":   "邀请招标",
+	"询价":   "询价采购",
+	"竞谈":   "竞争性谈判",
+	"单一":   "单一来源采购",
+	"竞价":   "竞价公告",
+	"变更":   "变更公告",
+	"中标":   "中标公示",
+	"成交":   "成交公告",
+	"废标":   "废标公告",
+	"流标":   "流标公告",
+	"合同":   "合同公告信息",
+	"验收":   "验收公告信息",
+	"违规":   "违规信息",
 }
 
 func (s *Short) Article(stype, id string) error {
-    //先判断是否有session
-    userId, _ := s.GetSession("userId").(string)
-    log.Printf("三级页userid:%s", userId)
-    //if userId == "" {
-    //	return s.Redirect("/jyapp/free/swordfish/about", 302)
-    //}
-    disWord := s.GetString("disWord")
-    userPower := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
-    var (
-        belongUserId, email string
+	//先判断是否有session
+	userId, _ := s.GetSession("userId").(string)
+	log.Printf("三级页userid:%s", userId)
+	//if userId == "" {
+	//	return s.Redirect("/jyapp/free/swordfish/about", 302)
+	//}
+	disWord := s.GetString("disWord")
+	userPower := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
+	var (
+		belongUserId, email string
 
-        isEntnicheNew, isOldVip, isVip, isMember, isEntniche, isEntService bool
-    )
-    //userId = "637dcf3ff143ed326e9e1589"
-    //登录用户 权限
-    if userId != "" {
-        belongUserId = GetbelongUserId(disWord, userId)
-        b, _ := redis.Exists("sso", "req_"+userId)
-        if b {
-            return s.Redirect("/jyapp/free/mob/err")
-        }
-        isEntnicheNew = userPower.EntIsNew                                                          //新版超级订阅
-        isOldVip = false                                                                            //新购超级订阅不能查看拟建项目详情页
-        isVip = userPower.VipStatus > 0                                                             //超级订阅
-        isMember = userPower.Status > 0                                                             //大会员
-        isEntniche = userPower.EntnicheStatus > 0                                                   //商机管理
-        email = userPower.Email                                                                     //用户邮箱
-        isEntService = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
-        _, isOldVip, _, _, _ = UserPermission(userId)
-        entId := util.IntAll(s.GetSession("entId"))
-        if entId > 0 && userPower.EntInfo[entId] != nil {
-            isEntniche = userPower.EntInfo[entId].Status == 1 && userPower.EntInfo[entId].IsPower
-            isEntnicheNew = userPower.EntInfo[entId].IsNew && isEntniche
-            if isEntService = userPower.EntInfo[entId].IsService && userPower.EntInfo[entId].IsPower; isEntService {
-                isEntnicheNew = false
-                isEntniche = false
-            }
-        }
-    }
-    s.T["isVip"] = isVip
-    s.T["member_status"] = userPower.Status
-    s.T["email"] = email
-    s.T["isEntniche"] = isEntniche
-    s.T["isMember"] = isMember
-    s.T["isEntService"] = isEntService
-    s.T["isEntnicheNew"] = isEntnicheNew
-    surl := s.GetString("url")
-    kds := s.GetString("keywords")
-    industry := s.GetString("industry")
-    var sid string
-    sid_openid := encrypt.CommonDecodeArticle(stype, id)
-    if len(sid_openid) == 0 {
-        return s.Redirect("/jyapp/free/swordfish/about", 302)
-    } else {
-        sid = sid_openid[0]
-    }
+		isEntnicheNew, isOldVip, isVip, isMember, isEntniche, isEntService bool
+	)
+	//userId = "637dcf3ff143ed326e9e1589"
+	//登录用户 权限
+	if userId != "" {
+		belongUserId = GetbelongUserId(disWord, userId)
+		b, _ := redis.Exists("sso", "req_"+userId)
+		if b {
+			return s.Redirect("/jyapp/free/mob/err")
+		}
+		isEntnicheNew = userPower.EntIsNew                                                          //新版超级订阅
+		isOldVip = false                                                                            //新购超级订阅不能查看拟建项目详情页
+		isVip = userPower.VipStatus > 0                                                             //超级订阅
+		isMember = userPower.Status > 0                                                             //大会员
+		isEntniche = userPower.EntnicheStatus > 0                                                   //商机管理
+		email = userPower.Email                                                                     //用户邮箱
+		isEntService = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
+		_, isOldVip, _, _, _ = UserPermission(userId)
+		entId := util.IntAll(s.GetSession("entId"))
+		if entId > 0 && userPower.EntInfo[entId] != nil {
+			isEntniche = userPower.EntInfo[entId].Status == 1 && userPower.EntInfo[entId].IsPower
+			isEntnicheNew = userPower.EntInfo[entId].IsNew && isEntniche
+			if isEntService = userPower.EntInfo[entId].IsService && userPower.EntInfo[entId].IsPower; isEntService {
+				isEntnicheNew = false
+				isEntniche = false
+			}
+		}
+	}
+	s.T["isVip"] = isVip
+	s.T["member_status"] = userPower.Status
+	s.T["email"] = email
+	s.T["isEntniche"] = isEntniche
+	s.T["isMember"] = isMember
+	s.T["isEntService"] = isEntService
+	s.T["isEntnicheNew"] = isEntnicheNew
+	surl := s.GetString("url")
+	kds := s.GetString("keywords")
+	industry := s.GetString("industry")
+	var sid string
+	sid_openid := encrypt.CommonDecodeArticle(stype, id)
+	if len(sid_openid) == 0 {
+		return s.Redirect("/jyapp/free/swordfish/about", 302)
+	} else {
+		sid = sid_openid[0]
+	}
 
-    s.T["keywords"] = kds
-    var obj map[string]interface{}
-    var canRead bool
-    obj = wxvisitD(sid, userId, (isVip && isOldVip) || isEntniche || isMember)
-    if len(obj) > 0 {
-        if userId != "" {
-            if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
-                ((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) { //新超级订阅非采购意向”和“拟建项目”
-                canRead = true
-            } else {
-                watchKey := fmt.Sprintf("article_count_%d_%s_%d_%s", time.Now().Year(), time.Now().Month(), time.Now().Day(), userId)
-                subTypeStr, _ := obj["subtype"].(string)
-                if strings.Contains(subTypeStr, "拟建") || strings.Contains(subTypeStr, "采购意向") {
-                    canRead = false
-                } else {
-                    if resVal := redis.GetStr("other", watchKey); resVal != "" {
-                        sidss := strings.Split(resVal, "_")
-                        canReadNotice := config.Sysconfig["canReadNotice"]
-                        if len(sidss) < util.IntAll(canReadNotice) {
-                            canRead = true
-                            sidss = append(sidss, sid)
-                            arrs := RemoveDuplicatesAndEmpty(sidss)
-                            newVal := strings.Join(arrs, "_")
-                            redis.Put("other", watchKey, newVal, jy.GetExpire())
-                        } else {
-                            canRead = false
-                            for _, v := range sidss {
-                                if sid == v {
-                                    canRead = true
-                                    break
-                                }
-                            }
-                        }
-                    } else {
-                        redis.Put("other", watchKey, sid, jy.GetExpire())
-                        canRead = true
-                    }
-                    //检验是否留资
-                    ok := CNode(userId)
-                    if ok {
-                        canRead = true
-                    }
-                }
-            }
-        }
-        //超前项目推送处理
-        s.T["canRead"] = canRead
-        if stype == "advancedProject" {
-            newCanRead := false
-            //判断此用户是否有打开的权限
-            newUserId := s.GetSession("base_user_id")
-            pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
-            //访问次数加1
-            if pushData == nil {
-                newCanRead = false
-            } else {
-                public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET  visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
-                newCanRead = true
-            }
-            if newCanRead || canRead {
-                obj = wxvisitD(sid, userId, true)
-                canRead = true
-            }
-            s.T["canRead"] = canRead
-        }
-        if userId == "" {
-            canRead = true
-            s.T["canRead"] = canRead
-        }
-        if canRead || (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
-            if belongUserId != "" && belongUserId != userId && util.ObjToString(obj["subtype"]) != "拟建" && userId != "" { //分享开打的
-                article_id := encrypt.CommonDecodeArticle(stype, id)[0]
-                key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, belongUserId, userId)
-                if redis.Incr("other", key) == 1 {
-                    redis.SetExpire("other", key, 60*60*24)
-                    err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), config.Sysconfig["nsq_topic"].(string), jy.Jyweb_article_open, belongUserId, jy.Jyapp_node1)
-                    if err != nil {
-                        log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, belongUserId)
-                    }
-                }
-            }
-            //获取打赏文案
-            //util.ReadConfig(&config.Sysconfig)
-            if obj["entidlist"] != nil { //大会员中标企业跳转至画像
-                entIdArr, winnerMap := []string{}, map[string]interface{}{}
-                eidList, _ := obj["entidlist"].([]interface{})
-                swinnerArr := strings.Split(util.ObjToString(obj["s_winner"]), ",")
-                //先查询entlist 如果长度和s_winner不一致 根据企业名称查询id
-                if len(eidList) != len(swinnerArr) {
-                    for _, v := range swinnerArr {
-                        winnerMap[v] = ""
-                        //临时更改为企业名称查询企业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}`, v, v))
-                        if rData != nil && len(*rData) == 1 {
-                            if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
-                                entIdArr = append(entIdArr, encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"])))
-                                winnerMap[v] = encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
-                            }
-                        }
-                    }
-                } else {
-                    for k, v := range eidList {
-                        vstr := util.ObjToString(v)
-                        if vstr == "-" {
-                            continue
-                        }
-                        winnerMap[swinnerArr[k]] = encrypt.EncodeArticleId2ByCheck(vstr)
-                    }
-                }
-                obj["entId"] = entIdArr
-                obj["winnerMap"] = winnerMap
-            }
-            //判断是否公开联系人信息
-            if util.Int64All(obj["buyerhint"]) == 2 {
-                obj["buyerperson"] = ""
-                obj["buyertel"] = ""
-            }
-            //免费用户正文手机号替换
-            if obj["site"] == "剑鱼信息发布平台" && !isMember && userId != "" {
-                //采购电话中标单位电话置空
-                if util.InterfaceToStr(obj["buyertel"]) != "" {
-                    obj["buyertel"] = "freeView"
-                }
-                if util.InterfaceToStr(obj["winnertel"]) != "" {
-                    obj["winnertel"] = "freeView"
-                }
-                //正文电话 手机号 邮箱处理
-                if detail, _ := obj["detail"].(string); detail != "" {
-                    //手机号
-                    re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
-                    detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
-                    code := util.InterfaceToStr(obj["projectcode"])
-                    if code != "" {
-                        detail1 = strings.ReplaceAll(detail1, code, "*********")
-                    }
-                    //座机
-                    re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
-                    detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
-                    re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
-                    detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
-                    //邮箱
-                    re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
-                    detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
-                    obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
-                }
-            }
-            if userId == "" {
-                obj = Filter(obj)
-                obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
-            }
-            if !canRead { //登录拟建&采购不展示遮罩 只打码
-                obj = Filter(obj)
-                canRead = true
-                s.T["isGuide"] = true
-            }
-            if obj["l_publishtime"] != nil {
-                obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["l_publishtime"]), 0).Format(date.Date_Short_Layout)
-            }
-        } else {
-            obj = map[string]interface{}{
-                "title":   obj["title"],
-                "_id":     obj["_id"],
-                "subtype": obj["subtype"],
-            }
-        }
-        if userId != "" {
-            s.T["userId"] = se.Encode2Hex(userId) //加密用户userid
-        }
-        s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail, config.Sysconfig)
-        s.T["rewardText"], s.T["advertText"] = getRewardText()
-        s.T["advertImg"] = config.Sysconfig["advertImg"]
-        s.T["advertName"] = config.Sysconfig["advertName"]
-        s.T["advertUrl"] = config.Sysconfig["advertUrl"]
-        obj["industry"] = industry
-        obj["keywords"] = KeyWordHandle(obj)
-        obj["description"] = DescriptionHandle(stype, obj)
-        s.T["obj"] = obj
-        s.T["isIosExam"], s.T["isIosExamPhone"], _, _ = IosExamInfo(s.Action, false, false)
-        content, err := s.Render4Cache("/weixin/wxinfocontent.html", &s.T)
-        if err != nil {
-            log.Println("模板数据写入失败:", err.Error())
-        }
-        return s.SetBody(content)
-    }
-    if surl != "" {
-        return s.Redirect(surl)
-    }
-    return s.Redirect("/jyapp/free/mob/err")
-}
-
-func NoLoginArticle(stype, sid string) map[string]interface{} {
-    obj := make(map[string]interface{})
-    catchKey := fmt.Sprintf("jypcdetail_nologin_app_%s_%s", stype, sid)
-    //if res := redis.Get("other", catchKey); res != nil && res != "" {
-    //	if data := util.ObjToMap(res); data != nil {
-    //		obj = *data
-    //		return obj
-    //	}
-    //}
-    obj = wxvisitD(sid, "", false)
-    if len(obj) > 0 {
-        if obj["entidlist"] != nil { //大会员中标企业跳转至画像
-            entIdArr, winnerMap := []string{}, map[string]interface{}{}
-            eidList, _ := obj["entidlist"].([]interface{})
-            swinnerArr := strings.Split(util.ObjToString(obj["s_winner"]), ",")
-            //先查询entlist 如果长度和s_winner不一致 根据企业名称查询id
-            if len(eidList) != len(swinnerArr) {
-                for _, v := range swinnerArr {
-                    winnerMap[v] = ""
-                    //临时更改为企业名称查询企业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}`, v, v))
-                    if rData != nil && len(*rData) == 1 {
-                        if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
-                            entIdArr = append(entIdArr, encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"])))
-                            winnerMap[v] = encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
-                        }
-                    }
-                }
-            } else {
-                for k, v := range eidList {
-                    vstr := util.ObjToString(v)
-                    if vstr == "-" {
-                        continue
-                    }
-                    winnerMap[swinnerArr[k]] = encrypt.EncodeArticleId2ByCheck(vstr)
-                }
-            }
-            obj["entId"] = entIdArr
-            obj["winnerMap"] = winnerMap
-        }
-        //判断是否公开联系人信息
-        if util.Int64All(obj["buyerhint"]) == 2 {
-            obj["buyerperson"] = ""
-            obj["buyertel"] = ""
-        }
-        if obj["l_publishtime"] != nil {
-            obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["l_publishtime"]), 0).Format(date.Date_Short_Layout)
-        }
-        obj["winnerTitle"] = obj["winner"]
-        obj["buyerTitle"] = obj["buyer"]
-        obj["projectnameTitle"] = obj["projectname"]
-        obj["projectcodeTitle"] = obj["projectcode"]
-        obj["keywords"] = KeyWordHandle(obj)
-        obj["description"] = DescriptionHandle("nologin", obj)
-        obj = Filter(obj)
-        redis.Put("other", catchKey, obj, 60*2)
-    }
-    return obj
+	s.T["keywords"] = kds
+	var obj map[string]interface{}
+	var canRead bool
+	obj = wxvisitD(sid, userId, (isVip && isOldVip) || isEntniche || isMember)
+	if len(obj) > 0 {
+		if userId != "" {
+			if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
+				((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) { //新超级订阅非采购意向”和“拟建项目”
+				canRead = true
+			} else {
+				watchKey := fmt.Sprintf("article_count_%d_%s_%d_%s", time.Now().Year(), time.Now().Month(), time.Now().Day(), userId)
+				subTypeStr, _ := obj["subtype"].(string)
+				if strings.Contains(subTypeStr, "拟建") || strings.Contains(subTypeStr, "采购意向") {
+					canRead = false
+				} else {
+					if resVal := redis.GetStr("other", watchKey); resVal != "" {
+						sidss := strings.Split(resVal, "_")
+						canReadNotice := config.Sysconfig["canReadNotice"]
+						if len(sidss) < util.IntAll(canReadNotice) {
+							canRead = true
+							sidss = append(sidss, sid)
+							arrs := RemoveDuplicatesAndEmpty(sidss)
+							newVal := strings.Join(arrs, "_")
+							redis.Put("other", watchKey, newVal, jy.GetExpire())
+						} else {
+							canRead = false
+							for _, v := range sidss {
+								if sid == v {
+									canRead = true
+									break
+								}
+							}
+						}
+					} else {
+						redis.Put("other", watchKey, sid, jy.GetExpire())
+						canRead = true
+					}
+					//检验是否留资
+					ok := CNode(userId)
+					if ok {
+						canRead = true
+					}
+				}
+			}
+		}
+		//超前项目推送处理
+		s.T["canRead"] = canRead
+		if stype == "advancedProject" {
+			newCanRead := false
+			//判断此用户是否有打开的权限
+			newUserId := s.GetSession("base_user_id")
+			pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
+			//访问次数加1
+			if pushData == nil {
+				newCanRead = false
+			} else {
+				public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET  visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
+				newCanRead = true
+			}
+			if newCanRead || canRead {
+				obj = wxvisitD(sid, userId, true)
+				canRead = true
+			}
+			s.T["canRead"] = canRead
+		}
+		if userId == "" {
+			canRead = true
+			s.T["canRead"] = canRead
+		}
+		if canRead || (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
+			if belongUserId != "" && belongUserId != userId && util.ObjToString(obj["subtype"]) != "拟建" && userId != "" { //分享开打的
+				article_id := encrypt.CommonDecodeArticle(stype, id)[0]
+				key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, belongUserId, userId)
+				if redis.Incr("other", key) == 1 {
+					redis.SetExpire("other", key, 60*60*24)
+					err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), config.Sysconfig["nsq_topic"].(string), jy.Jyweb_article_open, belongUserId, jy.Jyapp_node1)
+					if err != nil {
+						log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, belongUserId)
+					}
+				}
+			}
+			//获取打赏文案
+			//util.ReadConfig(&config.Sysconfig)
+			if obj["entidlist"] != nil { //大会员中标企业跳转至画像
+				entIdArr, winnerMap := []string{}, map[string]interface{}{}
+				eidList, _ := obj["entidlist"].([]interface{})
+				swinnerArr := strings.Split(util.ObjToString(obj["s_winner"]), ",")
+				//先查询entlist 如果长度和s_winner不一致 根据企业名称查询id
+				if len(eidList) != len(swinnerArr) {
+					for _, v := range swinnerArr {
+						winnerMap[v] = ""
+						//临时更改为企业名称查询企业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}`, v, v))
+						if rData != nil && len(*rData) == 1 {
+							if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
+								entIdArr = append(entIdArr, encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"])))
+								winnerMap[v] = encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
+							}
+						}
+					}
+				} else {
+					for k, v := range eidList {
+						vstr := util.ObjToString(v)
+						if vstr == "-" {
+							continue
+						}
+						winnerMap[swinnerArr[k]] = encrypt.EncodeArticleId2ByCheck(vstr)
+					}
+				}
+				obj["entId"] = entIdArr
+				obj["winnerMap"] = winnerMap
+			}
+			//判断是否公开联系人信息
+			if util.Int64All(obj["buyerhint"]) == 2 {
+				obj["buyerperson"] = ""
+				obj["buyertel"] = ""
+			}
+			//免费用户正文手机号替换
+			if obj["site"] == "剑鱼信息发布平台" && !isMember && userId != "" {
+				//采购电话中标单位电话置空
+				if util.InterfaceToStr(obj["buyertel"]) != "" {
+					obj["buyertel"] = "freeView"
+				}
+				if util.InterfaceToStr(obj["winnertel"]) != "" {
+					obj["winnertel"] = "freeView"
+				}
+				//正文电话 手机号 邮箱处理
+				if detail, _ := obj["detail"].(string); detail != "" {
+					//手机号
+					re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
+					detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
+					code := util.InterfaceToStr(obj["projectcode"])
+					if code != "" {
+						detail1 = strings.ReplaceAll(detail1, code, "*********")
+					}
+					//座机
+					re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
+					detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
+					re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
+					detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
+					//邮箱
+					re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
+					detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
+					obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
+				}
+			}
+			if !canRead { //登录拟建&采购不展示遮罩 只打码
+				obj = otherFilter(obj, userId != "")
+				s.T["canRead"] = true
+			} else if userId == "" {
+				obj = Filter(obj)
+				obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
+			}
+			if obj["l_publishtime"] != nil {
+				obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["l_publishtime"]), 0).Format(date.Date_Short_Layout)
+			}
+		} else {
+			obj = map[string]interface{}{
+				"title":   obj["title"],
+				"_id":     obj["_id"],
+				"subtype": obj["subtype"],
+			}
+		}
+		if userId != "" {
+			s.T["userId"] = se.Encode2Hex(userId) //加密用户userid
+		}
+		s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail, config.Sysconfig)
+		s.T["rewardText"], s.T["advertText"] = getRewardText()
+		s.T["advertImg"] = config.Sysconfig["advertImg"]
+		s.T["advertName"] = config.Sysconfig["advertName"]
+		s.T["advertUrl"] = config.Sysconfig["advertUrl"]
+		obj["industry"] = industry
+		obj["keywords"] = KeyWordHandle(obj)
+		obj["description"] = DescriptionHandle(stype, obj)
+		s.T["obj"] = obj
+		s.T["isIosExam"], s.T["isIosExamPhone"], _, _ = IosExamInfo(s.Action, false, false)
+		content, err := s.Render4Cache("/weixin/wxinfocontent.html", &s.T)
+		if err != nil {
+			log.Println("模板数据写入失败:", err.Error())
+		}
+		return s.SetBody(content)
+	}
+	if surl != "" {
+		return s.Redirect(surl)
+	}
+	return s.Redirect("/jyapp/free/mob/err")
 }
 
 // 未登录用户进行数据过滤
 func Filter(obj map[string]interface{}) map[string]interface{} {
-    detail := fmt.Sprint(obj["detail"])
-    //mosaicText := fmt.Sprintf(`<span class="noLoginMosaic">%s</span>`, util.ObjToString(config.Sysconfig["detailMosaic"]))
-    mosaicText := fmt.Sprintf(`<span style="color: #2ABED1;">%s</span>`, util.ObjToString(config.Sysconfig["detailMosaic"]))
-    detailText := fmt.Sprintf(`<span class="noLoginMosaic" style="color: #2ABED1;">%s</span>`, util.ObjToString(config.Sysconfig["detailMosaic"]))
-    detailNeedMosaic, _ := config.Sysconfig["detailNeedMosaic"].(map[string]interface{})
-    //for k, _ := range obj {
-    //	if ok, _ := detailNeedMosaic[k].(bool); ok {
-    //		if util.ObjToString(obj[k]) != "" {
-    //			detail = strings.ReplaceAll(detail, util.ObjToString(obj[k]), detailText)
-    //		}
-    //		//中标企业信息
-    //		if k == "winnerMap" && obj[k] != nil {
-    //			winnerNewMap := map[string]interface{}{}
-    //			winnerMap := util.ObjToMap(obj[k])
-    //			for _, wv := range *winnerMap {
-    //				winnerNewMap[mosaicText] = wv
-    //			}
-    //			obj[k] = winnerNewMap
-    //		} else {
-    //			obj[k] = mosaicText
-    //		}
-    //	}
-    //}
-    for dk, dv := range detailNeedMosaic {
-        if !dv.(bool) {
-            continue
-        }
-        //if util.ObjToString(obj[dk]) != "" {
-        //	detail = strings.ReplaceAll(detail, util.ObjToString(obj[dk]), detailText)
-        //}
-        if util.InterfaceToStr(obj[dk]) != "" {
-            value, b := obj[dk].(float64)
-            if b {
-                replaceStr := fmt.Sprintf("%v", int64(value))
-                detail = strings.ReplaceAll(detail, replaceStr, detailText)
-            } else {
-                detail = strings.ReplaceAll(detail, util.InterfaceToStr(obj[dk]), detailText)
-            }
-        }
-        //中标企业信息
-        if dk == "winnerMap" {
-            winnerNewMap := map[string]interface{}{}
-            if obj[dk] != nil {
-                winnerMap := util.ObjToMap(obj[dk])
-                for _, wv := range *winnerMap {
-                    winnerNewMap[mosaicText] = wv
-                }
-            }
-            obj[dk] = winnerNewMap
-        } else {
-            obj[dk] = mosaicText
-        }
-    }
-    obj["detail"] = detail
-    return obj
+	detail := fmt.Sprint(obj["detail"])
+	//mosaicText := fmt.Sprintf(`<span class="noLoginMosaic">%s</span>`, util.ObjToString(config.Sysconfig["detailMosaic"]))
+	mosaicText := fmt.Sprintf(`<span style="color: #2ABED1;">%s</span>`, util.ObjToString(config.Sysconfig["detailMosaic"]))
+	detailText := fmt.Sprintf(`<span class="noLoginMosaic" style="color: #2ABED1;">%s</span>`, util.ObjToString(config.Sysconfig["detailMosaic"]))
+	detailNeedMosaic, _ := config.Sysconfig["detailNeedMosaic"].(map[string]interface{})
+	//for k, _ := range obj {
+	//	if ok, _ := detailNeedMosaic[k].(bool); ok {
+	//		if util.ObjToString(obj[k]) != "" {
+	//			detail = strings.ReplaceAll(detail, util.ObjToString(obj[k]), detailText)
+	//		}
+	//		//中标企业信息
+	//		if k == "winnerMap" && obj[k] != nil {
+	//			winnerNewMap := map[string]interface{}{}
+	//			winnerMap := util.ObjToMap(obj[k])
+	//			for _, wv := range *winnerMap {
+	//				winnerNewMap[mosaicText] = wv
+	//			}
+	//			obj[k] = winnerNewMap
+	//		} else {
+	//			obj[k] = mosaicText
+	//		}
+	//	}
+	//}
+	for dk, dv := range detailNeedMosaic {
+		if !dv.(bool) {
+			continue
+		}
+		//if util.ObjToString(obj[dk]) != "" {
+		//	detail = strings.ReplaceAll(detail, util.ObjToString(obj[dk]), detailText)
+		//}
+		if util.InterfaceToStr(obj[dk]) != "" {
+			value, b := obj[dk].(float64)
+			if b {
+				replaceStr := fmt.Sprintf("%v", int64(value))
+				detail = strings.ReplaceAll(detail, replaceStr, detailText)
+			} else {
+				detail = strings.ReplaceAll(detail, util.InterfaceToStr(obj[dk]), detailText)
+			}
+		}
+		//中标企业信息
+		if dk == "winnerMap" {
+			winnerNewMap := map[string]interface{}{}
+			if obj[dk] != nil {
+				winnerMap := util.ObjToMap(obj[dk])
+				for _, wv := range *winnerMap {
+					winnerNewMap[mosaicText] = wv
+				}
+			}
+			obj[dk] = winnerNewMap
+		} else {
+			obj[dk] = mosaicText
+		}
+	}
+	obj["detail"] = detail
+	return obj
+}
+
+// 拟建采购意向用户进行数据过滤 name 配置文件
+func otherFilter(obj map[string]interface{}, isLogin bool) map[string]interface{} {
+	txt := util.If(isLogin, "解锁会员查看", "登陆后解锁会员查看").(string)
+	detail := fmt.Sprint(obj["detail"])
+	mosaicText := fmt.Sprintf(`<span style="color:#2ABED1;">%s</span>`, txt)
+	detailText := fmt.Sprintf(`<span class="noLoginMosaic" style="color: #2ABED1;">%s</span>`, txt)
+	var otherMosaic map[string]interface{}
+	if obj["subtype"] == "拟建" {
+		otherMosaic, _ = config.Sysconfig["planBuildMosaic"].(map[string]interface{})
+	} else if obj["subtype"] == "采购意向" {
+		otherMosaic, _ = config.Sysconfig["purchaseMosaic"].(map[string]interface{})
+		pattern := regexp.MustCompile(`<td>(.*?)</td>`)
+		detail = pattern.ReplaceAllString(detail, fmt.Sprintf("<td>%s</td>", detailText))
+	}
+
+	for dk, dv := range otherMosaic {
+		if !dv.(bool) {
+			continue
+		}
+		//if util.ObjToString(obj[dk]) != "" {
+		//	detail = strings.ReplaceAll(detail, util.ObjToString(obj[dk]), detailText)
+		//}
+
+		if vs, ok := obj[dk]; ok && vs != nil {
+			value, b := obj[dk].(float64)
+			if b {
+				replaceStr := fmt.Sprintf("%v", int64(value))
+				detail = strings.ReplaceAll(detail, replaceStr, detailText)
+			} else {
+				detail = strings.ReplaceAll(detail, util.InterfaceToStr(obj[dk]), detailText)
+			}
+		}
+
+		if dk == "winnerMap" {
+			winnerNewMap := map[string]interface{}{}
+			if obj[dk] != nil {
+				winnerMap := util.ObjToMap(obj[dk])
+				for _, wv := range *winnerMap {
+					winnerNewMap[mosaicText] = wv
+				}
+			}
+			obj[dk] = winnerNewMap
+		} else {
+			obj[dk] = mosaicText
+		}
+	}
+	obj["detail"] = detail
+	return obj
 }
 
 func ReplaceStringByRegex(str, rule, replace string) (string, error) {
-    reg, err := regexp.Compile(rule)
-    if reg == nil || err != nil {
-        return "", errors.New("正则MustCompile错误:" + err.Error())
-    }
-    return reg.ReplaceAllString(str, replace), nil
+	reg, err := regexp.Compile(rule)
+	if reg == nil || err != nil {
+		return "", errors.New("正则MustCompile错误:" + err.Error())
+	}
+	return reg.ReplaceAllString(str, replace), nil
 }
 
 // 分段匹配数字打码
 func RegDetail(html string) string {
-    mosaicText := util.ObjToString(config.Sysconfig["detailMosaicTxt"])
-    reg := regexp.MustCompile("<[^<>]{1,1000}>") //分段正则
-    s := reg.FindAllStringIndex(html, -1)        //全文匹配分段
-    if len(s) > 0 {                              //走分段替换
-        arr := []string{}
-        index := 0
-        for _, v := range s {
-            if len(v) == 2 {
-                // log.Println(html[index:v[0]])
-                txt, _ := ReplaceStringByRegex(html[index:v[0]], "[0-9]+", mosaicText)
-                arr = append(arr, txt) //替换
-                arr = append(arr, html[v[0]:v[1]])
-                index = v[1]
-            }
-        }
-        return strings.Join(arr, "")
-    }
-    return ""
+	mosaicText := util.ObjToString(config.Sysconfig["detailMosaicTxt"])
+	reg := regexp.MustCompile("<[^<>]{1,1000}>") //分段正则
+	s := reg.FindAllStringIndex(html, -1)        //全文匹配分段
+	if len(s) > 0 {                              //走分段替换
+		arr := []string{}
+		index := 0
+		for _, v := range s {
+			if len(v) == 2 {
+				// log.Println(html[index:v[0]])
+				txt, _ := ReplaceStringByRegex(html[index:v[0]], "[0-9]+", mosaicText)
+				arr = append(arr, txt) //替换
+				arr = append(arr, html[v[0]:v[1]])
+				index = v[1]
+			}
+		}
+		return strings.Join(arr, "")
+	}
+	return ""
 }
 
 func CNode(userId string) bool {
-    if hasRetainedCapital(userId, "jyarticle_see3_plus") {
-        return true
-    }
-    rM := map[string]interface{}{}
-    rdata, ok := mongodb.Find("saleLeads", map[string]interface{}{
-        "userid": userId,
-    }, `{"createtime":-1}`, nil, false, 0, 10)
-    if rdata != nil && len(*rdata) > 0 && ok {
-        for _, v := range *rdata {
-            for kk, vv := range v {
-                if vv == nil {
-                    continue
-                }
-                if rM[kk] != nil {
-                    continue
-                }
-                rM[kk] = vv
-            }
-        }
-        delete(rM, "_id")
-        delete(rM, "userid")
-        delete(rM, "createtime")
-        delete(rM, "client")
-    }
-    if userinfo := utils.Compatible.Select(userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
-        s_phone := util.ObjToString((*userinfo)["s_phone"])
-        phone := util.If(s_phone == "", util.ObjToString((*userinfo)["s_m_phone"]), s_phone)
-        if rM["phone"] == nil || rM["phone"] == "" {
-            rM["phone"] = phone
-        }
-        if rM["company"] == nil || rM["company"] == "" {
-            rM["company"] = util.ObjToString((*userinfo)["s_company"])
-        }
-    }
-    if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" && rM["companyType"] != "" {
+	if hasRetainedCapital(userId, "jyarticle_see3_plus") {
+		return true
+	}
+	rM := map[string]interface{}{}
+	rdata, ok := mongodb.Find("saleLeads", map[string]interface{}{
+		"userid": userId,
+	}, `{"createtime":-1}`, nil, false, 0, 10)
+	if rdata != nil && len(*rdata) > 0 && ok {
+		for _, v := range *rdata {
+			for kk, vv := range v {
+				if vv == nil {
+					continue
+				}
+				if rM[kk] != nil {
+					continue
+				}
+				rM[kk] = vv
+			}
+		}
+		delete(rM, "_id")
+		delete(rM, "userid")
+		delete(rM, "createtime")
+		delete(rM, "client")
+	}
+	if userinfo := utils.Compatible.Select(userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
+		s_phone := util.ObjToString((*userinfo)["s_phone"])
+		phone := util.If(s_phone == "", util.ObjToString((*userinfo)["s_m_phone"]), s_phone)
+		if rM["phone"] == nil || rM["phone"] == "" {
+			rM["phone"] = phone
+		}
+		if rM["company"] == nil || rM["company"] == "" {
+			rM["company"] = util.ObjToString((*userinfo)["s_company"])
+		}
+	}
+	if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" && rM["companyType"] != "" {
 
-        if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
-            return false
-        }
-        return true
+		if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
+			return false
+		}
+		return true
 
-    }
-    return false
+	}
+	return false
 }
 
 func GetbelongUserId(disWord, userId string) (belongUserId string) {
-    if disWord != "" {
-        redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
-        if redisDis != "" {
-            suffix := disWord[len(disWord)-3:]
-            //公告三级页处理
-            if suffix == suffix_msgt {
-                effectiveTimeStr := strings.Split(redisDis, "##")[3]
-                effectiveTime, _ := strconv.ParseInt(effectiveTimeStr, 10, 64)
-                //是否计算佣金
-                if time.Now().Unix() <= effectiveTime {
-                    belongUserId = strings.Split(redisDis, "##")[1]
-                    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 {
-                            //新增口号使用
-                            start_time := time.Now().Format(DateFullLayout)
-                            termValidityInt, _ := strconv.Atoi(fmt.Sprint(config.Sysconfig["termValidity"]))
-                            stop_time := TimeProcessing(time.Now().Format(DateFullLayout), termValidityInt).Format(DateFullLayout)
-                            insert := map[string]interface{}{
-                                "password":      disWord,
-                                "userId":        userId,
-                                "belong_userid": belongUserId,
-                                "start_time":    start_time,
-                                "stop_time":     stop_time,
-                            }
-                            insert_1 := public.Mysql.InsertByTx(tx, "dis_word", insert) //口号使用表
-                            log.Println("插入口号使用表", insert_1)
-                        }
-                        return true
-                    })
-                }
-            }
-        }
-    }
-    return
+	if disWord != "" {
+		redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
+		if redisDis != "" {
+			suffix := disWord[len(disWord)-3:]
+			//公告三级页处理
+			if suffix == suffix_msgt {
+				effectiveTimeStr := strings.Split(redisDis, "##")[3]
+				effectiveTime, _ := strconv.ParseInt(effectiveTimeStr, 10, 64)
+				//是否计算佣金
+				if time.Now().Unix() <= effectiveTime {
+					belongUserId = strings.Split(redisDis, "##")[1]
+					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 {
+							//新增口号使用
+							start_time := time.Now().Format(DateFullLayout)
+							termValidityInt, _ := strconv.Atoi(fmt.Sprint(config.Sysconfig["termValidity"]))
+							stop_time := TimeProcessing(time.Now().Format(DateFullLayout), termValidityInt).Format(DateFullLayout)
+							insert := map[string]interface{}{
+								"password":      disWord,
+								"userId":        userId,
+								"belong_userid": belongUserId,
+								"start_time":    start_time,
+								"stop_time":     stop_time,
+							}
+							insert_1 := public.Mysql.InsertByTx(tx, "dis_word", insert) //口号使用表
+							log.Println("插入口号使用表", insert_1)
+						}
+						return true
+					})
+				}
+			}
+		}
+	}
+	return
 }
 
 func TimeProcessing(hour interface{}, duration int) time.Time {
-    todayZero, _ := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprint(hour), time.Local)
-    mm, _ := time.ParseDuration(fmt.Sprint(duration) + "m")
-    t := todayZero.Add(mm)
-    return t
+	todayZero, _ := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprint(hour), time.Local)
+	mm, _ := time.ParseDuration(fmt.Sprint(duration) + "m")
+	t := todayZero.Add(mm)
+	return t
 }
 
 // 三级页复制操作记录
 func (s *Short) Replication() {
-    mongodb.Save("copyaction", map[string]interface{}{
-        "userid":     s.GetSession("userId").(string),
-        "createtime": time.Now().Unix(),
-        "url":        s.Request.Referer(),
-        "client":     s.Header("User-Agent"),
-    })
+	mongodb.Save("copyaction", map[string]interface{}{
+		"userid":     s.GetSession("userId").(string),
+		"createtime": time.Now().Unix(),
+		"url":        s.Request.Referer(),
+		"client":     s.Header("User-Agent"),
+	})
 }
 
 func isbid(typ interface{}) bool {
-    if typ != nil {
-        subtype := util.ObjToString(typ)
-        if subtype == "中标" || subtype == "合同" || subtype == "成交" {
-            return true
-        }
-    }
-    return false
+	if typ != nil {
+		subtype := util.ObjToString(typ)
+		if subtype == "中标" || subtype == "合同" || subtype == "成交" {
+			return true
+		}
+	}
+	return false
 }
 
 func getwinnertel(company interface{}) string {
-    if company != nil {
-        data, _ := public.Mgo_Ent.FindOne("winner_enterprise", map[string]interface{}{
-            "company_name": util.ObjToString(company),
-        })
-        if (*data)["company_phone"] != nil {
-            return util.ObjToString((*data)["company_phone"])
-        }
-    }
-    return ""
+	if company != nil {
+		data, _ := public.Mgo_Ent.FindOne("winner_enterprise", map[string]interface{}{
+			"company_name": util.ObjToString(company),
+		})
+		if (*data)["company_phone"] != nil {
+			return util.ObjToString((*data)["company_phone"])
+		}
+	}
+	return ""
 }
 
 func UserPermission(userId string) (isVip, isOldVip, isEntniche bool, i_member_status int, email string) {
-    var phone string
-    data := utils.Compatible.Select(userId, `{"i_vip_status":1,"i_member_status":1,"s_myemail":1,"s_phone":1,"s_m_phone":1,"l_vip_starttime":1}`)
-    if data != nil && len(*data) > 0 {
-        i_vip_status := util.IntAll((*data)["i_vip_status"])
-        if i_vip_status > 0 {
-            isVip = true
-            if util.Int64All((*data)["l_vip_starttime"]) < util.Int64All(config.Sysconfig["contextOldVipLimit"]) {
-                isOldVip = 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
-        }
-    }
-    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
-    return
+	var phone string
+	data := utils.Compatible.Select(userId, `{"i_vip_status":1,"i_member_status":1,"s_myemail":1,"s_phone":1,"s_m_phone":1,"l_vip_starttime":1}`)
+	if data != nil && len(*data) > 0 {
+		i_vip_status := util.IntAll((*data)["i_vip_status"])
+		if i_vip_status > 0 {
+			isVip = true
+			if util.Int64All((*data)["l_vip_starttime"]) < util.Int64All(config.Sysconfig["contextOldVipLimit"]) {
+				isOldVip = 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
+		}
+	}
+	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
+	return
 }
 func RemoveDuplicatesAndEmpty(a []string) (ret []string) {
-    a_len := len(a)
-    for i := 0; i < a_len; i++ {
-        if (i > 0 && a[i-1] == a[i]) || len(a[i]) == 0 {
-            continue
-        }
-        ret = append(ret, a[i])
-    }
-    return
+	a_len := len(a)
+	for i := 0; i < a_len; i++ {
+		if (i > 0 && a[i-1] == a[i]) || len(a[i]) == 0 {
+			continue
+		}
+		ret = append(ret, a[i])
+	}
+	return
 }
 
 // 该节点是否留资
 func hasRetainedCapital(uid, source string) bool {
-    if count, err := mongodb.CountByErr("saleLeads", map[string]interface{}{"userid": uid, "source": source}); err != nil || count > 0 {
-        return true
-    }
-    return false
+	if count, err := mongodb.CountByErr("saleLeads", map[string]interface{}{"userid": uid, "source": source}); err != nil || count > 0 {
+		return true
+	}
+	return false
 }
 
 /*
 TDK description
 */
 func baseInfo(obj map[string]interface{}) string {
-    info := ""
-    info += "省份:"
-    //{{if eq .T.obj.area "A"}}全国{{else}}{{.T.obj.area}}{{end}}
-    if area := util.ObjToString(obj["area"]); area == "A" {
-        info += "全国"
-    } else {
-        info += area
-    }
-    info += ",城市:" + util.ObjToString(obj["city"])
-    info += ",招标代理机构:" + util.ObjToString(obj["agency"])
-    info += ",项目名称:" + util.ObjToString(obj["projectname"])
-    info += ",采购单位:" + util.ObjToString(obj["buyer"])
-    info += ",采购联系人:" + util.ObjToString(obj["buyerperson"])
-    info += ",采购电话:" + util.ObjToString(obj["buyertel"])
-    if obj["package"] == nil {
-        info += ",项目预算(元):" + util.ObjToString(obj["budget"])
-    }
-    if util.ObjToString(obj["subtype"]) == "单一" && util.ObjToString(obj["package"]) == "" {
-        info += ",拟定单一来源采购供应商:" + util.ObjToString(obj["winner"])
-    }
-    subtype := util.ObjToString(obj["subtype"])
-    if subtype == "中标" || subtype == "成交" || subtype == "合同" {
-        if obj["winnerMap"] != nil {
-            info += ",中标单位:"
-            i := 0
-            for k, _ := range *util.ObjToMap(obj["winnerMap"]) {
-                i++
-                info += k
-                if i != len(*util.ObjToMap(obj["winnerMap"])) {
-                    info += "、"
-                }
-            }
-        }
-        if obj["bidamount"] != nil {
-            info += ",中标金额(元):" + util.ObjToString(obj["bidamount"])
-        }
+	info := ""
+	info += "省份:"
+	//{{if eq .T.obj.area "A"}}全国{{else}}{{.T.obj.area}}{{end}}
+	if area := util.ObjToString(obj["area"]); area == "A" {
+		info += "全国"
+	} else {
+		info += area
+	}
+	info += ",城市:" + util.ObjToString(obj["city"])
+	info += ",招标代理机构:" + util.ObjToString(obj["agency"])
+	info += ",项目名称:" + util.ObjToString(obj["projectname"])
+	info += ",采购单位:" + util.ObjToString(obj["buyer"])
+	info += ",采购联系人:" + util.ObjToString(obj["buyerperson"])
+	info += ",采购电话:" + util.ObjToString(obj["buyertel"])
+	if obj["package"] == nil {
+		info += ",项目预算(元):" + util.ObjToString(obj["budget"])
+	}
+	if util.ObjToString(obj["subtype"]) == "单一" && util.ObjToString(obj["package"]) == "" {
+		info += ",拟定单一来源采购供应商:" + util.ObjToString(obj["winner"])
+	}
+	subtype := util.ObjToString(obj["subtype"])
+	if subtype == "中标" || subtype == "成交" || subtype == "合同" {
+		if obj["winnerMap"] != nil {
+			info += ",中标单位:"
+			i := 0
+			for k, _ := range *util.ObjToMap(obj["winnerMap"]) {
+				i++
+				info += k
+				if i != len(*util.ObjToMap(obj["winnerMap"])) {
+					info += "、"
+				}
+			}
+		}
+		if obj["bidamount"] != nil {
+			info += ",中标金额(元):" + util.ObjToString(obj["bidamount"])
+		}
 
-        if obj["bidamount"] != nil {
-            info += ",联系方式:" + util.ObjToString(obj["bidamount"])
-        }
-    }
-    return info
+		if obj["bidamount"] != nil {
+			info += ",联系方式:" + util.ObjToString(obj["bidamount"])
+		}
+	}
+	return info
 }
 func KeyWordHandle(obj map[string]interface{}) string {
-    keywordArr := []string{}
-    owner := util.InterfaceToStr(obj["owner"])
-    buyer := util.InterfaceToStr(obj["buyer"])
-    if buyer == "" {
-        buyer = owner
-    }
-    if buyer != "" && buyer != config.Sysconfig["detailMosaicTxt"] {
-        keywordArr = append(keywordArr, util.InterfaceToStr(obj["buyer"]))
-    }
-    if util.InterfaceToStr(obj["s_winner"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
-        keywordArr = append(keywordArr, util.InterfaceToStr(obj["s_winner"]))
-    }
-    if obj["purchasinglist"] != nil && obj["purchasinglist"] != "" {
-        i := 0
-        for _, v := range gconv.SliceMap(obj["purchasinglist"]) {
-            if i == 5 {
-                break
-            }
-            if util.InterfaceToStr(v["itemname"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
-                keywordArr = append(keywordArr, util.InterfaceToStr(v["itemname"]))
-                i++
-            }
-        }
-    }
-    if util.InterfaceToStr(obj["subtype"]) != "" && util.InterfaceToStr(obj["subtype"]) != "其它" {
-        keywordArr = append(keywordArr, TypeCodeMap[util.InterfaceToStr(obj["subtype"])])
-    }
-    if util.InterfaceToStr(obj["area"]) != "" {
-        keywordArr = append(keywordArr, util.InterfaceToStr(obj["area"])+"招标")
-    }
-    if util.InterfaceToStr(obj["city"]) != "" {
-        keywordArr = append(keywordArr, util.InterfaceToStr(obj["city"])+"招标")
-    }
-    keywordArr = append(keywordArr, "剑鱼标讯")
-    keyword := strings.Join(keywordArr, ",")
-    return keyword
+	keywordArr := []string{}
+	owner := util.InterfaceToStr(obj["owner"])
+	buyer := util.InterfaceToStr(obj["buyer"])
+	if buyer == "" {
+		buyer = owner
+	}
+	if buyer != "" && buyer != config.Sysconfig["detailMosaicTxt"] {
+		keywordArr = append(keywordArr, util.InterfaceToStr(obj["buyer"]))
+	}
+	if util.InterfaceToStr(obj["s_winner"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
+		keywordArr = append(keywordArr, util.InterfaceToStr(obj["s_winner"]))
+	}
+	if obj["purchasinglist"] != nil && obj["purchasinglist"] != "" {
+		i := 0
+		for _, v := range gconv.SliceMap(obj["purchasinglist"]) {
+			if i == 5 {
+				break
+			}
+			if util.InterfaceToStr(v["itemname"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
+				keywordArr = append(keywordArr, util.InterfaceToStr(v["itemname"]))
+				i++
+			}
+		}
+	}
+	if util.InterfaceToStr(obj["subtype"]) != "" && util.InterfaceToStr(obj["subtype"]) != "其它" {
+		keywordArr = append(keywordArr, TypeCodeMap[util.InterfaceToStr(obj["subtype"])])
+	}
+	if util.InterfaceToStr(obj["area"]) != "" {
+		keywordArr = append(keywordArr, util.InterfaceToStr(obj["area"])+"招标")
+	}
+	if util.InterfaceToStr(obj["city"]) != "" {
+		keywordArr = append(keywordArr, util.InterfaceToStr(obj["city"])+"招标")
+	}
+	keywordArr = append(keywordArr, "剑鱼标讯")
+	keyword := strings.Join(keywordArr, ",")
+	return keyword
 }
 func DescriptionHandle(stype string, obj map[string]interface{}) string {
-    description := ""
-    pushTime := time.Unix(util.Int64All(obj["l_publishtime"]), 0)
-    title := util.InterfaceToStr(obj["title"])
-    owner := util.InterfaceToStr(obj["owner"])
-    buyer := util.InterfaceToStr(obj["buyer"])
-    if buyer == "" {
-        buyer = owner
-    }
-    s_winner := util.InterfaceToStr(obj["s_winner"])
-    publishtime := util.Int64All(obj["l_publishtime"])
-    area := util.InterfaceToStr(obj["area"])
-    city := util.InterfaceToStr(obj["city"])
-    if stype == "bdprivate" {
-        //bdprivate
-        //{项目标题},采购单位:{采购单位名称},成交供应商:{中标企业名称},公告日期:{公告日期}。
-        descriptionArr := []string{}
-        if title != "" {
-            descriptionArr = append(descriptionArr, title)
-        }
-        if buyer != "" {
-            descriptionArr = append(descriptionArr, fmt.Sprintf("采购单位:%s", buyer))
-        }
-        if s_winner != "" {
-            descriptionArr = append(descriptionArr, fmt.Sprintf("成交供应商:%s", s_winner))
-        }
-        if publishtime != 0 {
-            descriptionArr = append(descriptionArr, fmt.Sprintf("公告日期:%s", pushTime.Format("2006年01月02日")))
-        }
-        descriptionArr = append(descriptionArr, "查看该项目信息详情请访问剑鱼标讯官网。")
-        description = strings.Join(descriptionArr, ",")
-    } else {
-        //descriptionStr = "%s,项目所属地区是%s%s,项目采购单位是%s,项目发布时间是%s"
-        descriptionArr := []string{}
-        if title != "" {
-            descriptionArr = append(descriptionArr, title)
-        }
-        if area != "" || city != "" {
-            descriptionArr = append(descriptionArr, fmt.Sprintf("项目所属地区是%s%s", area, city))
-        }
-        if buyer != "" {
-            descriptionArr = append(descriptionArr, fmt.Sprintf("项目采购单位是%s", buyer))
-        }
-        if publishtime != 0 {
-            descriptionArr = append(descriptionArr, fmt.Sprintf("项目发布时间是%s", pushTime.Format("2006年01月02日")))
-        }
-        descriptionArr = append(descriptionArr, "查看该项目信息详情请访问剑鱼标讯官网。")
-        description = strings.Join(descriptionArr, ",")
-    }
-    return description
+	description := ""
+	pushTime := time.Unix(util.Int64All(obj["l_publishtime"]), 0)
+	title := util.InterfaceToStr(obj["title"])
+	owner := util.InterfaceToStr(obj["owner"])
+	buyer := util.InterfaceToStr(obj["buyer"])
+	if buyer == "" {
+		buyer = owner
+	}
+	s_winner := util.InterfaceToStr(obj["s_winner"])
+	publishtime := util.Int64All(obj["l_publishtime"])
+	area := util.InterfaceToStr(obj["area"])
+	city := util.InterfaceToStr(obj["city"])
+	if stype == "bdprivate" {
+		//bdprivate
+		//{项目标题},采购单位:{采购单位名称},成交供应商:{中标企业名称},公告日期:{公告日期}。
+		descriptionArr := []string{}
+		if title != "" {
+			descriptionArr = append(descriptionArr, title)
+		}
+		if buyer != "" {
+			descriptionArr = append(descriptionArr, fmt.Sprintf("采购单位:%s", buyer))
+		}
+		if s_winner != "" {
+			descriptionArr = append(descriptionArr, fmt.Sprintf("成交供应商:%s", s_winner))
+		}
+		if publishtime != 0 {
+			descriptionArr = append(descriptionArr, fmt.Sprintf("公告日期:%s", pushTime.Format("2006年01月02日")))
+		}
+		descriptionArr = append(descriptionArr, "查看该项目信息详情请访问剑鱼标讯官网。")
+		description = strings.Join(descriptionArr, ",")
+	} else {
+		//descriptionStr = "%s,项目所属地区是%s%s,项目采购单位是%s,项目发布时间是%s"
+		descriptionArr := []string{}
+		if title != "" {
+			descriptionArr = append(descriptionArr, title)
+		}
+		if area != "" || city != "" {
+			descriptionArr = append(descriptionArr, fmt.Sprintf("项目所属地区是%s%s", area, city))
+		}
+		if buyer != "" {
+			descriptionArr = append(descriptionArr, fmt.Sprintf("项目采购单位是%s", buyer))
+		}
+		if publishtime != 0 {
+			descriptionArr = append(descriptionArr, fmt.Sprintf("项目发布时间是%s", pushTime.Format("2006年01月02日")))
+		}
+		descriptionArr = append(descriptionArr, "查看该项目信息详情请访问剑鱼标讯官网。")
+		description = strings.Join(descriptionArr, ",")
+	}
+	return description
 }

Some files were not shown because too many files changed in this diff