Преглед изворни кода

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

# Conflicts:
#	src/jfw/modules/common/src/qfw/util/jy/subscribepush.go
WH01243 пре 3 година
родитељ
комит
b889b005ae
29 измењених фајлова са 1632 додато и 824 уклоњено
  1. 3 0
      src/config.json
  2. 298 5
      src/jfw/front/dataExport.go
  3. 11 1
      src/jfw/front/front.go
  4. 15 0
      src/jfw/front/frontRouter.go
  5. 12 0
      src/jfw/front/login.go
  6. 191 0
      src/jfw/front/org_structure.go
  7. 44 0
      src/jfw/front/shorturl.go
  8. 1 1
      src/jfw/jyutil/sessionkeep.go
  9. 9 2
      src/jfw/modules/app/src/app/front/front.go
  10. 2 0
      src/jfw/modules/app/src/app/front/swordfish.go
  11. 2 1
      src/jfw/modules/app/src/seo.json
  12. 10 7
      src/jfw/modules/app/src/web/templates/weixin/historypush.html
  13. 0 2
      src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html
  14. 1 0
      src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html
  15. 1 1
      src/jfw/modules/bigmember/src/service/use/use.go
  16. 4 0
      src/jfw/modules/common/src/qfw/util/jy/jy.go
  17. 690 777
      src/jfw/modules/common/src/qfw/util/jy/subscribepush.go
  18. 11 0
      src/jfw/modules/weixin/src/jrpc/jrpc.go
  19. BIN
      src/jfw/modules/weixin/src/微信模板消息.xlsx
  20. 18 0
      src/jfw/public/rpccall.go
  21. 3 1
      src/phoneFilter.json
  22. 2 1
      src/seo.json
  23. 45 12
      src/web/staticres/js/login.js
  24. 12 6
      src/web/staticres/js/pur-search-index-pc.js
  25. 4 3
      src/web/staticres/public-pc/js/article-content.js
  26. 118 0
      src/web/templates/frontRouter/pc/entpc/sess/index.html
  27. 118 0
      src/web/templates/frontRouter/pc/page_entbase_pc/sess/index.html
  28. 6 4
      src/web/templates/pc/index.html
  29. 1 0
      src/web/templates/weixin/orgStructure/invitationPage.html

+ 3 - 0
src/config.json

@@ -309,6 +309,9 @@
     "sessionTimeout":168,
     "pcSessionTimeout":168,
     "shareRedisName":"other",
+    "wxWebdomain": "https://web-ws.jydev.jianyu360.com",
+    "wxOrgUrl": "/page_entbase_mobile/page/invite/inviting.html",
+    "pcOrgUrl":"/orgpc/inviting",
     "criticality":2,
     "indexcontentTimeOut":86400,
     "seoBeforeTimeHour":12160

+ 298 - 5
src/jfw/front/dataExport.go

@@ -14,6 +14,7 @@ import (
 	"regexp"
 	"strconv"
 	"strings"
+	"sync"
 	"time"
 
 	"github.com/go-xweb/xweb"
@@ -49,8 +50,14 @@ type DataExport struct {
 	integralDetail       xweb.Mapper `xweb:"/front/integral/integralDetail"`             //剑鱼币订单详情
 
 	getPcEntAuth xweb.Mapper `xweb:"/front/entExportAuth/getAuth"` //获取企业权限
+
+	//gettest            xweb.Mapper `xweb:"/front/order/gettest"`                    //模拟
+	//entDataExport      xweb.Mapper `xweb:"/front/entDataExport/(.*)"`               //企业数据导出
+	//isEntExportSuccess xweb.Mapper `xweb:"/front/entExportAuth/isEntExportSuccess"` //企业导出是否成功
 }
 
+var order_pageSize = 10
+
 type Filters struct {
 	FilterId string
 }
@@ -60,8 +67,15 @@ func init() {
 }
 
 var (
-	layout_date     = "2006.01.02"
-	tableName_order = "dataexport_order" //订单表
+	layout_date         = "2006.01.02"
+	orderStatus_unPaid  = "0"                //订单状态-待支付
+	orderStatus_paid    = "1"                //订单状态-已完成
+	orderStatus_deleted = "-1"               //订单状态-已删除
+	orderStatus_cancel  = "-2"               //订单状态-已取消
+	tableName_order     = "dataexport_order" //订单表
+	SE                  = util.SimpleEncrypt{Key: "topJYBX2019"}
+	exportLock          = sync.Mutex{}
+	exportLockMap       = map[int]sync.Mutex{}
 )
 
 func (d *DataExport) ToSieve() error {
@@ -92,38 +106,57 @@ func (d *DataExport) SieveData() error {
 	var cityArr []string
 	var regionArr []string
 	var industryArr []string
+	var subTypeArr []string
 	var buyerArr []string
 	var buyerclassArr []string
 	var winnerArr []string
 	var keywordList []dataexport.KeyWord
 
+	log.Println("price", minPrice, maxPrice)
+	if publishtime != "" {
+		log.Println("publishtime", publishtime)
+	}
 	if area != "" {
 		areaArr = strings.Split(area, ",")
+		log.Println("areaArr", areaArr)
 	}
 	if city != "" {
 		cityArr = strings.Split(city, ",")
+		log.Println("cityArr", cityArr)
 	}
 	if region != "" {
 		regionArr = strings.Split(region, ",")
+		log.Println("regionArr", regionArr)
 	}
 	if industry != "" {
 		industryArr = strings.Split(industry, ",")
 		log.Println("industryArr", industryArr)
 	}
+	if subType != "" {
+		subTypeArr = strings.Split(subType, ",")
+		log.Println("subTypeArr", subTypeArr)
+	}
+	log.Println("keywordParam", keyword)
 	if keyword != "" {
 		err := json.Unmarshal([]byte(keyword), &keywordList)
 		if err != nil {
 			log.Println("keyword param 反序列化异常,查看前后台字段是否对应")
+		} else {
+			log.Println("keywordList", len(keywordList), keywordList)
 		}
 	}
+	log.Println("selectType", selectType)
 	if buyer != "" {
 		buyerArr = strings.Split(buyer, ",")
+		log.Println("buyerArr", buyerArr)
 	}
 	if buyerclass != "" {
 		buyerclassArr = strings.Split(buyerclass, ",")
+		log.Println("buyerclassArr", buyerclassArr)
 	}
 	if winner != "" {
 		winnerArr = strings.Split(winner, ",")
+		log.Println("winnerArr", winnerArr)
 	}
 	sieveCondition := map[string]interface{}{
 		"publishtime": publishtime,
@@ -197,6 +230,7 @@ func (d *DataExport) ToOrderDetail(orderCode string) error {
 	if orderCode != "" {
 		orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
 	}
+	//	log.Println("ToOrderDetail", orderCode, orderDetail)
 	if orderDetail["pay_money"] != nil {
 		orderDetail["pay_money"] = float64(orderDetail["pay_money"].(int64))
 	}
@@ -687,6 +721,15 @@ func (d *DataExport) Check_invoice(order_code string) error {
 	return d.Render("/_error.html")
 }
 
+//func (d *DataExport) Gettest() {
+//	order_code := d.GetString("order_code")
+//	info := public.Mysql.FindOne("invoice", map[string]interface{}{"order_code": order_code}, "", "")
+//	d.ServeJson(map[string]interface{}{
+//		"data": info,
+//	})
+//	return
+//}
+
 func (d *DataExport) InvoicetimeOut() {
 	d.Render("/pc/invoice_error.html")
 }
@@ -700,6 +743,86 @@ func (d *DataExport) ValuationList(order_code string) error {
 	return d.Render("/_error.html")
 }
 
+//
+//func (d *DataExport) EntDataExport(_id string) error {
+//	id := util.SE.Decode4Hex(_id)
+//	userId := util.ObjToString(d.GetSession("userId"))
+//	entId := util.IntAll(d.GetSession("entId"))
+//	entUserId := util.IntAll(d.GetSession("entUserId"))
+//	isFirst, err := d.GetBool("isFirst")
+//	if err != nil {
+//		isFirst = true
+//	}
+//	if userId == "" {
+//		return errors.New("未登录")
+//	}
+//	exportLock.Lock()
+//	exportLockMap[entId] = sync.Mutex{}
+//	entLock := exportLockMap[entId]
+//	exportLock.Unlock()
+//	entLock.Lock()
+//	query := map[string]interface{}{"ent_id": entId, "user_id": entUserId}
+//	data_limit, remain_nums, export_nums := 0, 0, 0
+//	limit := public.Mysql.FindOne("entniche_export_limit", query, "data_limit,remain_nums,export_nums", "")
+//	if limit != nil {
+//		data_limit = util.IntAll((*limit)["data_limit"])
+//		remain_nums = util.IntAll((*limit)["remain_nums"])
+//		export_nums = util.IntAll((*limit)["export_nums"])
+//	}
+//	count := 0
+//	newCount := 0
+//	data := &[]map[string]interface{}{}
+//	current := GetCurrentCount(entId)
+//	log.Println("企业总条数", current)
+//	url := config.Sysconfig["dedupUrl"].(string)
+//	count, newCount, data = public.GetEntDataExportCount(id, entId, entUserId, remain_nums, current, isFirst, util.ObjToString(config.Sysconfig["webdomain"]), url)
+//	isExport := true
+//	isEntExport := true
+//	if newCount > current {
+//		isEntExport = false
+//	}
+//	if newCount > remain_nums {
+//		isExport = false
+//	}
+//	//current 企业总条数   count 筛选条数  newCount 去重后条数  exportNum 今日已导出  limit 今日剩余 limitDay 今日限额
+//	result := map[string]interface{}{
+//		"newCount":    newCount,
+//		"count":       count,
+//		"limit":       remain_nums,
+//		"limitDay":    data_limit,
+//		"exportNum":   export_nums,
+//		"current":     current,
+//		"isExport":    isExport,
+//		"isEntExport": isEntExport,
+//	}
+//	if isFirst || !isExport || !isEntExport {
+//		entLock.Unlock()
+//		d.ServeJson(result)
+//	} else {
+//		go func() {
+//			data = public.FormatExportDatas(data, config.Sysconfig["webdomain"].(string), "2", entId)
+//			xlsxUrl := GetXlsx(*data, entId, entUserId)
+//			if xlsxUrl != "" {
+//				filter := Filters{
+//					FilterId: id,
+//				}
+//				filterStr, _ := json.Marshal(filter)
+//				SaveExportLog(entId, entUserId, count, newCount, remain_nums, export_nums, xlsxUrl, "2", string(filterStr))
+//				DeductNum(entId, newCount)
+//				go func() {
+//					for _, v := range *data {
+//						mongodb.Save("entdataexport", v)
+//					}
+//				}()
+//				redis.Put("other", "entexportdata_"+fmt.Sprintln(entId), xlsxUrl, 60)
+//				entLock.Unlock()
+//			}
+//		}()
+//		d.ServeJson(result)
+//	}
+//	return nil
+//}
+
 //剑鱼pc判断登录用户是否有我的企业、商机管理菜单
 func (this *DataExport) GetPcEntAuth() {
 	userId, _ := this.GetSession("userId").(string)
@@ -736,7 +859,7 @@ func (this *DataExport) GetPcEntAuth() {
 					if hideUsers[util.IntAll(val["id"])] {
 						entnicheMenu = false
 					} else {
-						if  util.IntAll(val["isNew"])==1{
+						if util.IntAll(val["isNew"]) == 1 {
 							isNew = true
 						}
 						entnicheMenu = true
@@ -760,7 +883,7 @@ func (this *DataExport) GetPcEntAuth() {
 									if hideUsers[util.IntAll(vv["id"])] {
 										entnicheMenu = false
 									} else {
-										if  util.IntAll(vv["isNew"])==1{
+										if util.IntAll(vv["isNew"]) == 1 {
 											isNew = true
 										}
 										entnicheMenu = true
@@ -780,7 +903,7 @@ func (this *DataExport) GetPcEntAuth() {
 	}
 
 	data := map[string]interface{}{
-		"myEntMenu":    myEntMenu,
+		"myEntMenu":    true,
 		"entnicheMenu": entnicheMenu,
 		"isNew":        isNew,
 		"privatedata":  privatedata,
@@ -788,6 +911,176 @@ func (this *DataExport) GetPcEntAuth() {
 	this.ServeJson(data)
 }
 
+//
+////判断是否导出成功
+//func (this *DataExport) IsEntExportSuccess() {
+//	entId := util.IntAll(this.GetSession("entId"))
+//	res := map[string]interface{}{
+//		"state": false,
+//	}
+//	if entId != 0 {
+//		key := "entexportdata_" + fmt.Sprintln(entId)
+//		log.Println(key)
+//		xlsxUrl := redis.Get("other", key)
+//		log.Println(xlsxUrl)
+//		if xlsxUrl != nil {
+//			res["state"] = true
+//			res["xlsxUrl"] = xlsxUrl
+//			redis.Del("other", key)
+//		}
+//	}
+//	this.ServeJson(res)
+//}
+//
+////生成xlsx
+//func GetXlsx(mMap []map[string]interface{}, entId, entUserId int) string {
+//	xf, err := xlsx.OpenFile("./web/staticres/fields.xlsx")
+//	if err != nil {
+//		log.Println("fields file not foud", err.Error())
+//	}
+//	sh := xf.Sheets[1]
+//	for _, v := range mMap {
+//		row := sh.AddRow()
+//		row.AddCell().SetValue(v["area"])
+//		row.AddCell().SetValue(v["city"])
+//		row.AddCell().SetValue(v["title"])
+//		row.AddCell().SetValue(v["subtype"])
+//		row.AddCell().SetValue(v["detail"])
+//		if v["publishtime"] != nil {
+//			row.AddCell().SetValue(v["publishtime"])
+//		} else {
+//			row.AddCell()
+//		}
+//		row.AddCell().SetValue(v["href"])
+//		row.AddCell().SetValue(v["url"])
+//		row.AddCell().SetValue(v["projectname"])
+//		row.AddCell().SetValue(v["projectcode"])
+//		row.AddCell().SetValue(v["projectscope"])
+//		if v["budget"] != nil {
+//			row.AddCell().SetFloat(util.Float64All(v["budget"]))
+//		} else {
+//			row.AddCell()
+//		}
+//		if v["bidamount"] != nil {
+//			row.AddCell().SetFloat(util.Float64All(v["bidamount"]))
+//		} else {
+//			row.AddCell()
+//		}
+//		if v["bidopentime"] != nil {
+//			row.AddCell().SetValue(v["bidopentime"])
+//		} else {
+//			row.AddCell()
+//		}
+//		row.AddCell().SetValue(v["buyer"])
+//		row.AddCell().SetValue(v["buyerperson"])
+//		row.AddCell().SetValue(v["buyertel"])
+//		row.AddCell().SetValue(v["agency"])
+//		row.AddCell().SetValue(v["s_winner"])
+//		row.AddCell().SetValue(v["winnerperson"])
+//		row.AddCell().SetValue(v["winnertel"])
+//		row.AddCell().SetValue(v["legal_person"])
+//		row.AddCell().SetValue(v["company_phone"])
+//		row.AddCell().SetValue(v["company_email"])
+//	}
+//	xf.Sheets = xf.Sheets[1:2]
+//	xf.Sheets[0].Name = "数据导出"
+//	//生文件
+//	t := strconv.FormatInt(time.Now().Unix(), 10)
+//	entIds := strconv.Itoa(entId)
+//	entUserIds := strconv.Itoa(entUserId)
+//	dir := "./web/staticres/xlsx/entsearchexport/" + entIds + "_" + entUserIds + "_" + t + "/"
+//	if b, _ := PathExists(dir); !b {
+//		err1 := os.MkdirAll(dir, os.ModePerm)
+//		if err1 != nil {
+//			log.Println("mkdir err", dir)
+//		}
+//	}
+//	fname := entIds + "_" + entUserIds + "_" + "entdataexport.xlsx"
+//	xlsxUrl := dir + fname
+//	xlsxUrls := "/xlsx/entsearchexport/" + entIds + "_" + entUserIds + "_" + t + "/" + fname
+//	err = xf.Save(xlsxUrl)
+//	if err != nil {
+//		log.Println("xls error", fname)
+//		xlsxUrls = ""
+//	}
+//	return xlsxUrls
+//}
+//
+//func PathExists(path string) (bool, error) {
+//	_, err := os.Stat(path)
+//	if err == nil {
+//		return true, nil
+//	}
+//	if os.IsNotExist(err) {
+//		return false, nil
+//	}
+//	return false, err
+//}
+//
+//func SaveExportLog(entId, entUserId, count, newCount, remain_nums, export_nums int, xlsxUrl, types, filterStr string) {
+//	query := map[string]interface{}{
+//		"id":     entUserId,
+//		"ent_id": entId,
+//	}
+//	set := map[string]interface{}{
+//		"remain_nums": remain_nums - newCount,
+//		"export_nums": export_nums + newCount,
+//	}
+//	ok := public.Mysql.Update("entniche_export_limit", map[string]interface{}{"ent_id": entId, "user_id": entUserId}, set)
+//	if !ok {
+//		log.Println("修改导出条数失败", query, remain_nums, newCount)
+//	}
+//	userData := public.Mysql.FindOne("entniche_user", query, "name,phone", "")
+//	if userData != nil {
+//		name := util.ObjToString((*userData)["name"])
+//		phone := util.ObjToString((*userData)["phone"])
+//		now := time.Now()
+//		public.Mysql.Insert("entniche_export_log", map[string]interface{}{
+//			"user_name":    name,
+//			"export_time":  util.FormatDate(&now, util.Date_Full_Layout),
+//			"data_source":  "2",
+//			"export_num":   count,
+//			"deduct_num":   newCount,
+//			"download_url": xlsxUrl,
+//			"ent_id":       entId,
+//			"phone":        phone,
+//			"user_id":      entUserId,
+//			"filter":       filterStr,
+//		})
+//	}
+//}
+//
+//func DeductNum(entId, newCount int) {
+//	query := map[string]interface{}{
+//		"id": entId,
+//	}
+//	userData := public.Mysql.FindOne("entniche_info", query, "name,phone", "")
+//	if userData != nil {
+//		name := util.ObjToString((*userData)["name"])
+//		phone := util.ObjToString((*userData)["phone"])
+//		public.Mgo_Qyfw.Update("user", map[string]interface{}{"phone": phone, "username": name}, map[string]interface{}{
+//			"$inc": map[string]interface{}{
+//				"plan.current": -newCount,
+//			},
+//		}, false, false)
+//	}
+//}
+//
+//func GetCurrentCount(entId int) int {
+//	count := 0
+//	userData := public.Mysql.FindOne("entniche_info", map[string]interface{}{"id": entId}, "name,phone", "")
+//	if userData == nil {
+//		return count
+//	}
+//	current, ok := public.Mgo_Qyfw.FindOne("user", map[string]interface{}{"phone": util.ObjToString((*userData)["phone"]), "username": util.ObjToString((*userData)["name"])})
+//	if current == nil || !ok {
+//		return count
+//	}
+//	plan, _ := (*current)["plan"].(map[string]interface{})
+//	count = util.IntAll(plan["current"])
+//	return count
+//}
+
 //获取当前登录用户的手机号
 func GetPhone(userId string) (string, string) {
 	u, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1}`)

+ 11 - 1
src/jfw/front/front.go

@@ -153,6 +153,7 @@ func init() {
 	sewx = util.SimpleEncrypt{Key: "topnet"}
 	xweb.AddAction(&Front{})
 	xweb.AddAction(&Short{})
+	xweb.AddAction(&OrgStructure{})
 	urlMap = config.Sysconfig["redirect"].(map[string]interface{})
 }
 
@@ -609,6 +610,12 @@ func (f *Front) HasSign() error {
 			"s_headimage": f.GetSession("s_avatar"),
 			"encryptId":   se.EncodeString(userId),
 		}
+		//是否需要重新登录,企业基础架构给虚拟账号重置密码后,需要重新登录
+		if resetpwd, _ := redis.Exists("other", "resetpwd_"+userId); resetpwd {
+			redis.Del("other", "resetpwd_"+userId)
+			redis.Del("session", f.Session().Id())
+			m["resetpwd"] = resetpwd
+		}
 		if openid, _ := f.GetSession("s_m_openid").(string); openid != "" {
 			m["openid"] = se.EncodeString(openid)
 		}
@@ -773,8 +780,8 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 	if person == nil {
 		return false, nil, nil
 	}
+	userid := util.ObjToString(sessionVal["userId"])
 	if pcSessionFlag, ok := config.Sysconfig["pcSessionFlag"].(bool); pcSessionFlag && ok && flag {
-		userid := util.ObjToString(sessionVal["userId"])
 		//无限制登陆用户
 		if util.IntAll(sessionVal["i_unlimited"]) <= 0 {
 			redis.Put("other", jyutil.LoginRedisKey(userid), sess.Id(), 3600*util.IntAllDef(config.Sysconfig["pcSessionTimeout"], 168))
@@ -794,6 +801,8 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 	}
 	//大会员动画 清除首页缓存
 	redis.Del("other", "jypcindex")
+	//清除企业基础架构给虚拟账号重置密码后需要重新登录的标识
+	redis.Del("other", "resetpwd_"+userid)
 	return true, person, infoData
 }
 
@@ -815,6 +824,7 @@ func (m *Front) Sess(ostr string) error {
 		} else {
 			ok, _, _ = FindUserAndCreateSess(openid, m.Session(), "wx", false)
 		}
+		log.Println("ok:", ok)
 		if ok {
 			actionurl := util.ObjToString(urlMap[str[3]])
 			if actionurl != "" {

+ 15 - 0
src/jfw/front/frontRouter.go

@@ -45,6 +45,10 @@ type CommonRouter struct {
 
 	//双十一活动留资
 	activityLeads xweb.Mapper `xweb:"/weixin/leads/(.*)"`
+
+	//组织机构:organizational structure
+	orgpcIndex xweb.Mapper `xweb:"/orgpc/"`
+	orgpcPage  xweb.Mapper `xweb:"/orgpc/(.*)"`
 }
 
 func init() {
@@ -243,3 +247,14 @@ func (this *CommonRouter) ActivityLeads(sign string) error {
 	}
 	return this.Redirect(fmt.Sprintf("/weixin/frontPage/bigmember/free/perfect_info?source=%v", sign))
 }
+
+//组织架构
+func (this *CommonRouter) OrgpcIndex() error {
+	return this.doEntpcPage()
+}
+func (this *CommonRouter) OrgpcPage(htmlPage string) error {
+	return this.doOrgpcPage()
+}
+func (this *CommonRouter) doOrgpcPage() error {
+	return this.Render(fmt.Sprintf("/frontRouter/pc/page_entbase_pc/sess/index.html"))
+}

+ 12 - 0
src/jfw/front/login.go

@@ -317,3 +317,15 @@ func GetModule(source string) string {
 	sourceModuleMap, _ := config.Seoconfig["cookieSource"].(map[string]interface{})
 	return qutil.ObjToString(sourceModuleMap[source])
 }
+
+//当前用户是否存在
+func isExistsByPO(phone, openId string) bool {
+	return mongodb.Count("user", map[string]interface{}{
+		"i_appid": 2,
+		"$or": []map[string]interface{}{
+			{"s_phone": phone},
+			{"s_m_phone": phone},
+			{"s_m_openid": openId},
+		},
+	}) > 0
+}

+ 191 - 0
src/jfw/front/org_structure.go

@@ -0,0 +1,191 @@
+/**
+组织结构
+大会员&商机管理 企业组织架构优化
+2022-2-11
+王山
+**/
+
+package front
+
+import (
+	"fmt"
+	"jfw/config"
+	"jfw/jyutil"
+	"jfw/public"
+	"log"
+	"net/url"
+	"time"
+
+	"qfw/util"
+
+	"github.com/SKatiyar/qr"
+	"github.com/go-xweb/xweb"
+)
+
+type OrgStructure struct {
+	*xweb.Action
+	invitationQR   xweb.Mapper `xweb:"/orgstructure/invaction/(.*)"` //邀请加入组织的二维码 参数是部门id
+	invitationPage xweb.Mapper `xweb:"/orgstructure/invpage"`        //邀请路由
+	authorize      xweb.Mapper `xweb:"/orgstructure/authorize"`      //微信用户授权 获取用户信息
+	autoLogon      xweb.Mapper `xweb:"/orgstructure/autoLogon"`      //非剑鱼用户接收邀请注册为剑鱼用户
+}
+
+//
+func (this *OrgStructure) InvitationQR(depId string) {
+	wxWebdomain := util.ObjToString(config.Sysconfig["wxWebdomain"])
+	entId := this.GetString("entId")         //加密后-企业id
+	entUserId := this.GetString("entUserId") //加密后-企业用户id
+	depcname := this.GetString("depcname")
+	if wxWebdomain != "" {
+		qrUrl := wxWebdomain + "/orgstructure/invpage?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+		log.Println("qrUrl:", qrUrl)
+		//生二维码
+		_r, err := qr.Encode(qrUrl, qr.L)
+		if err != nil {
+			log.Println(err.Error())
+		} else {
+			w := this.ResponseWriter
+			w.Header().Set("Cache-Control", "no-cache,no-store,must-revalidate")
+			w.Header().Set("Prama", "no-cache")
+			w.Header().Set("Expires", "0")
+			w.Header().Set("Content-Type", "image/png")
+			w.Write((*_r).PNG())
+		}
+	}
+}
+
+//
+func (this *OrgStructure) InvitationPage() error {
+	client := this.Header("User-Agent")
+	entUserId := this.GetString("entUserId") //加密后-企业邀请人id
+	depId := this.GetString("depId")         //加密后-部门id
+	entId := this.GetString("entId")         //加密后-企业id
+	depcname := this.GetString("depcname")
+	registered := "0"                                     //是否是剑鱼用户:0:未关注; 1:已关注
+	entUserId_str := util.SE.Decode4HexByCheck(entUserId) //解密
+	entUserId_sess := this.GetSession("entUserId")
+	OrgUrl := util.ObjToString(config.Sysconfig["wxOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+	if !mobileReg.MatchString(client) {
+		OrgUrl = util.ObjToString(config.Sysconfig["pcOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+	} else if entUserId_sess == nil || util.ObjToString(entUserId_sess) != entUserId_str {
+		userId := util.ObjToString(this.Session().Get("userId"))
+		openId := util.ObjToString(this.Session().Get("s_m_openid"))
+		phone := util.ObjToString(this.Session().Get("phone"))
+		isSubscribe := false //是否关注
+		if userId == "" {
+			if this.GetString("state") == "wx" {
+				//微信跳回来的
+				code := this.GetString("code")
+				if code != "" {
+					openId = jyutil.Getopenid(code)
+				}
+			} else if public.CheckWxBrowser(this.Request) {
+				//所有参数都不再使用,跳到微信验证用户
+				return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
+			}
+		}
+		if openId != "" {
+			isSubscribe = CheckUserIsSubscribe(openId)
+			if isSubscribe {
+				registered = "1"
+				FindUserAndCreateSess(openId, this.Session(), "wx", false)
+				phone = util.If(this.GetSession("phone") != nil, this.GetSession("phone"), "").(string)
+			}
+		}
+		if phone != "" {
+			phone = util.SE.EncodeString(phone)
+		}
+		OrgUrl = OrgUrl + "&openId=" + util.SE.EncodeString(openId) + "&phone=" + phone + "&registered=" + registered
+	}
+	return this.Redirect(OrgUrl)
+
+}
+
+//暂时不用
+func (this *OrgStructure) Authorize() error {
+	openId := util.ObjToString(this.Session().Get("s_m_openid"))
+	unionId := ""
+	isSubscribe := false //是否关注
+	if openId == "" && this.GetString("state") == "authorize" {
+		//微信授权
+		code := this.GetString("code")
+		if code != "" {
+			openId = jyutil.Getopenid(code)
+		}
+	}
+	if openId != "" {
+		isSubscribe = CheckUserIsSubscribe(openId)
+		if isSubscribe {
+			FindUserAndCreateSess(openId, this.Session(), "wx", false)
+		} else { //获取未关注用户uninoid
+			unionId = public.GetUnionid(openId)
+		}
+	}
+	this.ServeJson(map[string]interface{}{
+		"openId":      util.SE.EncodeString(openId),
+		"unionId":     util.SE.EncodeString(unionId),
+		"isSubscribe": isSubscribe,
+		"phone":       util.If(this.GetSession("phone") != nil, this.GetSession("phone"), ""),
+	})
+	return nil
+}
+
+//移动端(PC端已注册)
+func (this *OrgStructure) AutoLogon() error {
+	openId := this.GetString("openId")
+	phone := this.GetString("phone")
+	name := this.GetString("name")
+	mail := this.GetString("email")
+	rb := false
+	if openId != "" && phone != "" {
+		//解密
+		openId = util.SE.DecodeString(openId)
+		//当前用户未成为剑鱼用户
+		if !isExistsByPO(phone, openId) {
+			unionId := public.GetUnionid(openId)
+			if openId == unionId {
+				unionId = "uni_" + unionId
+			}
+			//新用户 保存新信息  微信未关注;手机号可使用
+			data := map[string]interface{}{
+				"i_ispush":         0,
+				"i_appid":          2,
+				"s_phone":          phone,
+				"s_m_phone":        phone,
+				"s_m_openid":       openId,
+				"s_unionid":        unionId,
+				"s_unique":         "wx_" + unionId,
+				"i_applystatus":    1,
+				"s_registersource": "org_structure_share", //组织机构优化 邀请加入剑鱼
+				"l_registedate":    time.Now().Unix(),
+				"i_ts_guide":       2,
+				"s_platform":       "wx",
+				"o_jy": map[string]interface{}{
+					"s_email":      mail,
+					"i_apppush":    1,
+					"i_wxpush":     1,
+					"i_ratemode":   2,
+					"l_modifydate": time.Now().Unix(),
+					"i_newfree":    1,
+				},
+				"s_regsource": "wx_org_structure_share",
+				"s_nickname":  name,
+				"s_myemail":   mail,
+			}
+			source := this.GetString("source")
+			if ck, err := this.GetCookie("source"); err == nil && ck.Value != "" {
+				//cookie中记录用户的来源
+				data["s_newsource"] = ck.Value
+				data["s_module"] = GetModule(ck.Value) //根据cookie中记录的来源获取模块
+			}
+			if source != "" {
+				data["s_tracksource"] = source
+			}
+			if mongodb.Save("user", data) != "" {
+				rb = true
+			}
+		}
+	}
+	this.ServeJson(map[string]interface{}{"flag": rb})
+	return nil
+}

+ 44 - 0
src/jfw/front/shorturl.go

@@ -212,6 +212,50 @@ func (s *Short) Article(stype, id string) error {
 			s.T["advertName"] = config.Sysconfig["advertName"]
 			s.T["advertUrl"] = config.Sysconfig["advertUrl"]
 			s.T["obj"] = obj
+			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"]))
+						}
+					}
+					//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)
+					//}
+				}
+			}
+			if from_userid != "" && se.Decode4Hex(from_userid) != "" && se.Decode4Hex(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))
+					}
+				}
+			}
 			s.T["advertcode"] = s.GetString("advertcode")
 			content, _ := s.Render4Cache("/weixin/wxinfocontent_rec.html", &s.T)
 			return s.SetBody(content)

+ 1 - 1
src/jfw/jyutil/sessionkeep.go

@@ -41,7 +41,7 @@ func (sk *SessionKeep) Do() bool {
 		}
 	}()
 	rqu := sk.R.URL.Path
-	if strings.HasSuffix(rqu, "/notin/page") || strings.HasSuffix(rqu, "/swordfish/about") {
+	if strings.HasSuffix(rqu, "/notin/page") || strings.HasSuffix(rqu, "/swordfish/about") || strings.HasSuffix(rqu, "/orgstructure/invpage") {
 		return true
 	} else {
 		rhd := sk.R.Header

+ 9 - 2
src/jfw/modules/app/src/app/front/front.go

@@ -73,7 +73,8 @@ type Front struct {
 
 	qRCodePage xweb.Mapper `xweb:"/jyapp/free/qRCodePage"` //二维码页面
 
-	appConfig xweb.Mapper `xweb:"/jyapp/free/config"` //app配置项
+	appConfig   xweb.Mapper `xweb:"/jyapp/free/config"`      //app配置项
+	shareDomain xweb.Mapper `xweb:"/jyapp/free/shareDomain"` //app分享 域名配置项
 }
 
 var sewx util.SimpleEncrypt //微信的加密方法
@@ -652,7 +653,8 @@ func (s *Front) EntnichePushList() error {
 			s.SetSession("entUserId", entUserId)
 		}
 	}
-	return s.Redirect("/page_entniche/home?f=push&selectTime=" + s.GetString("selectTime"))
+	return s.Redirect("/jyapp/swordfish/historypush?f=push&t=entniche&pushtime=" + s.GetString("selectTime"))
+	//return s.Redirect("/page_entniche/home?f=push&selectTime=" + s.GetString("selectTime"))
 }
 
 //删除模板缓存
@@ -704,3 +706,8 @@ func (s *Front) QRCodePage() error {
 func (s *Front) AppConfig() {
 	s.ServeJson(config.Sysconfig["appConfig"])
 }
+
+//app微信分享域名
+func (s *Front) ShareDomain() {
+	s.ServeJson(config.Seoconfig["wxDomain"].(string))
+}

+ 2 - 0
src/jfw/modules/app/src/app/front/swordfish.go

@@ -424,6 +424,8 @@ func (f *Front) Historypush() error {
 	if f.GetString("f") == "push" {
 		if f.GetString("t") == "member" {
 			f.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
+		} else if f.GetString("t") == "entniche" {
+			f.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Entniche)
 		} else {
 			f.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
 		}

+ 2 - 1
src/jfw/modules/app/src/seo.json

@@ -99,5 +99,6 @@
 	},
 	"structedUploadA":"/structuredata/file/【剑鱼标讯】结构化招标数据.xlsx",
 	"buryingPointUrl":"https://md.jianyu360.com",
-	"distance":"0"
+	"distance":"0",
+	"wxDomain":"http://web1-jydev-zxl.jianyu360.cn"
 }

+ 10 - 7
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -567,9 +567,6 @@
     var productType = 0 // 0免费用户 1超级订阅 2大会员 // 3商机管理
     var historyVt = ''
 </script>
-<!-- vConsole debug -->
-<script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>
-<script>new VConsole()</script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
@@ -700,7 +697,7 @@
   var pageIndex = 1;
   var closeAdvert = false//是否关闭广告
   var isread = {{.T.isread}}
-  var isPageShow = document.hidden
+  var isPageShow = localStorage.getItem('hideBottom')
   // '/jyapp/myinfo'这个接口的返回值(同步请求,放心使用)
 //   有无关键词同意用这个myInfo中的内容判断
   var myInfo = {}
@@ -846,6 +843,10 @@
                 $(".open_remind").show();
             }
         }
+        // 商机管理隐藏弹窗
+        if(r.userType == 'entniche') {
+          $(".open_remind").hide();
+        }
         if (r.isExpire < 0 && r.vipStatus == -1) {
           if (localStorage.getItem("nv_vip_" + userId) == null) {
             // $(".nv_renew_toast").show();
@@ -909,7 +910,8 @@
           thisClass.LoadDatas(r);
       }
       this.LoadDatas=function(r){
-        if(isPageShow) {
+        if(isPageShow == '1') {
+          localStorage.removeItem('hideBottom')
           JyObj.hiddenBottom("0");
         }
         $(".app-content").css("display","flex");
@@ -1676,7 +1678,7 @@ function hasNoData() {
   //
   function appendList(content) {
       content.children(".tslist").on("click", function (event) {
-        if (!window.userNewType&&!(vm.rootInfo.vipStatus>0||vm.rootInfo.memberStatus>0)) {
+        if (!window.userNewType&&!(vm.rootInfo.vipStatus>0||vm.rootInfo.memberStatus>0||myInfo.userType == 'entniche')) {
             $('#tipsType').show()
           } else {
             $('#tipsType').hide()
@@ -1763,7 +1765,8 @@ function hasNoData() {
       if(!time && !area && !city && !subscopeclass && !buyerclass && !key && !subtype){
         afterJyObjInit();
       }
-      if(isPageShow) {
+      if(isPageShow == '1') {
+        localStorage.removeItem('hideBottom')
         JyObj.hiddenBottom("0");
       }
       $.ajax({

+ 0 - 2
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -628,8 +628,6 @@
 </script>
 
 <!--S-当前页面的资源-->
-<script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>
-<script>new VConsole()</script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>

+ 1 - 0
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -1390,6 +1390,7 @@
               changeClaimState(claimData)
               if (claimData) {
                 EasyAlert.show('认领成功')
+                getActionState ({{.T.obj.buyer}}, 'r')
               } else {
                 EasyAlert.show('取消认领成功')
               }

+ 1 - 1
src/jfw/modules/bigmember/src/service/use/use.go

@@ -38,7 +38,7 @@ type Use struct {
 
 func (u *Use) SubPageMoveTip() {
 	flag := false
-	if userId := u.GetSession("userId").(string); userId != "" {
+	if userId := qu.ObjToString(u.GetSession("userId")); userId != "" {
 		if u.GetString("doType") == "know" { //我知道了 更新
 			flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
 				"$set": map[string]interface{}{

+ 4 - 0
src/jfw/modules/common/src/qfw/util/jy/jy.go

@@ -434,7 +434,11 @@ func LoginOutPush(mongodb MongodbSim, userid, sessid, apppushRpc string) {
 	if err2 != nil {
 		log.Println("json Unmarshal err:", err)
 	}
+	if apppush.JgPushId == "" {
+		return
+	}
 	mongodb.UpdateById("user", userid, map[string]interface{}{
+		"$unset":    map[string]interface{}{"s_jpushid": "", "s_opushid": ""},
 		"$addToSet": map[string]interface{}{"a_jpushid": apppush.JgPushId},
 	})
 	//

+ 690 - 777
src/jfw/modules/common/src/qfw/util/jy/subscribepush.go

@@ -1,882 +1,795 @@
 package jy
 
 import (
-    "encoding/json"
-    "fmt"
-    "log"
-    mg "mongodb"
-    . "qfw/util"
-    "qfw/util/elastic"
-    "qfw/util/mysql"
-    "qfw/util/redis"
-    "strconv"
-    "strings"
-    "time"
-
-    "go.mongodb.org/mongo-driver/bson/primitive"
+	"encoding/json"
+	"fmt"
+	"log"
+	mg "mongodb"
+	. "qfw/util"
+	"qfw/util/elastic"
+	"qfw/util/mysql"
+	"qfw/util/redis"
+	"strconv"
+	"strings"
+	"time"
+
+	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
 const (
-    threeDay  = 172800
-    halfOfDay = 43200
+	threeDay  = 172800
+	halfOfDay = 43200
 )
 
 type SubPushList struct {
-    Id              string      `json:"_id"`
-    Title           string      `json:"title"`
-    Area            string      `json:"area"`
-    Buyerclass      string      `json:"buyerclass"`
-    Type            string      `json:"type"`
-    S_subscopeclass string      `json:"s_subscopeclass"`
-    Publishtime     int64       `json:"publishtime"`
-    Ca_index        int64       `json:"ca_index"`
-    Ca_date         int64       `json:"ca_date"`
-    Ca_isvisit      int         `json:"ca_isvisit"`
-    Ca_isvip        int         `json:"ca_isvip"`
-    Ca_type         int         `json:"ca_type"`
-    Matchkeys       []string    `json:"matchkeys"`
-    Budget          interface{} `json:"budget"`
-    Bidamount       interface{} `json:"bidamount"`
-    Collection      int         `json:"collection"`
-    Buyer           string      `json:"buyer"`
-    ProjectName     string      `json:"projectName"`
-    S_winner        string      `json:"s_winner"`
-    Bidopentime     int64       `json:"bidopentime"`
+	Id              string      `json:"_id"`
+	Title           string      `json:"title"`
+	Area            string      `json:"area"`
+	Buyerclass      string      `json:"buyerclass"`
+	Type            string      `json:"type"`
+	S_subscopeclass string      `json:"s_subscopeclass"`
+	Publishtime     int64       `json:"publishtime"`
+	Ca_index        int64       `json:"ca_index"`
+	Ca_date         int64       `json:"ca_date"`
+	Ca_isvisit      int         `json:"ca_isvisit"`
+	Ca_isvip        int         `json:"ca_isvip"`
+	Ca_type         int         `json:"ca_type"`
+	Matchkeys       []string    `json:"matchkeys"`
+	Budget          interface{} `json:"budget"`
+	Bidamount       interface{} `json:"bidamount"`
+	Collection      int         `json:"collection"`
+	Buyer           string      `json:"buyer"`
+	ProjectName     string      `json:"projectName"`
+	S_winner        string      `json:"s_winner"`
+	Bidopentime     int64       `json:"bidopentime"`
 }
 
 const (
-    pageSize            = 50
-    pageSizes           = 10
-    AllSubPushCacheSize = 250
-    query               = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","area", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "buyerclass","bidamount","budget","projectname","buyer","bidopentime","s_winner"],"from":0,"size":%d}`
-    mongodb_fields      = `{"_id":1,"area":1,"publishtime":1,"s_subscopeclass":1,"subtype":1,"title":1,"toptype":1,"type":1, "buyerclass":1,"budget":1,"bidamount":1,"s_winner":1,"bidopentime":1,"buyer":1,"projectname":1}`
-    querys              = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","title","detail","area","city","publishtime","projectname","buyer","buyerclass","s_winner","bidamount","subtype","toptype","href","projectcode","buyerperson","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel"]}`
-
-    MemberFlag   = "m"
-    SubVipFlag   = "v"
-    EntnicheFlag = "s"
-    SubFreeFlag  = ""
+	pageSize            = 50
+	pageSizes           = 10
+	AllSubPushCacheSize = 250
+	query               = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","area", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "buyerclass","bidamount","budget","projectname","buyer","bidopentime","s_winner"],"from":0,"size":%d}`
+	mongodb_fields      = `{"_id":1,"area":1,"publishtime":1,"s_subscopeclass":1,"subtype":1,"title":1,"toptype":1,"type":1, "buyerclass":1,"budget":1,"bidamount":1,"s_winner":1,"bidopentime":1,"buyer":1,"projectname":1}`
+	querys              = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","title","detail","area","city","publishtime","projectname","buyer","buyerclass","s_winner","bidamount","subtype","toptype","href","projectcode","buyerperson","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel"]}`
+
+	MemberFlag   = "m"
+	SubVipFlag   = "v"
+	EntnicheFlag = "s"
+	SubFreeFlag  = ""
 )
 
 var aboutDbMsg map[string]*AboutDbMsg = map[string]*AboutDbMsg{
-    SubFreeFlag:  &AboutDbMsg{"pushsubscribe", "subpush"},
-    SubVipFlag:   &AboutDbMsg{"pushsubscribe", "subpush"},
-    MemberFlag:   &AboutDbMsg{"pushmember", "memberpush"},
-    EntnicheFlag: &AboutDbMsg{"pushentniche", "pushentniche"},
+	SubFreeFlag: &AboutDbMsg{"pushsubscribe", "subpush"},
+	SubVipFlag:  &AboutDbMsg{"pushsubscribe", "subpush"},
+	MemberFlag:  &AboutDbMsg{"pushmember", "memberpush"},
+	EntnicheFlag:  &AboutDbMsg{"pushentniche", "pushentniche"},
 }
 
 type AboutDbMsg struct {
-    MysqlTable   string
-    RedisKeyFlag string
+	MysqlTable   string
+	RedisKeyFlag string
 }
 
 type SubPush struct {
-    Date  string
-    Datas []*SubPushList
-    Count int64
+	Date  string
+	Datas []*SubPushList
+	Count int64
 }
 
 type PushCa struct {
-    Date   int64
-    InfoId string
-    Visit  int
-    Index  int64
-    Keys   []string
-    Type   int
-    Isvip  int
+	Date   int64
+	InfoId string
+	Visit  int
+	Index  int64
+	Keys   []string
+	Type   int
+	Isvip  int
 }
 
 //查询参数
 type SubPushQueryParam struct {
-    Mgo_bidding   mg.MongodbSim //
-    Bidding       string        //
-    Bidding_back  string        //
-    PushMysql     *mysql.Mysql  //
-    UserId        string        //用户id
-    PageNum       int           //页面
-    PageSize      int           //每页数量
-    SelectTime    string        //时间
-    Area          string        //区域
-    City          string        //城市
-    Buyerclass    string        //采购单位行业
-    Subtype       string        //信息类型 二级分类
-    Subscopeclass string        //信息行业
-    Key           string        //订阅词
-    Export        bool          //导出
-    EntId         int
+	Mgo_bidding   mg.MongodbSim //
+	Bidding       string        //
+	Bidding_back  string        //
+	PushMysql     *mysql.Mysql  //
+	UserId        string        //用户id
+	PageNum       int           //页面
+	PageSize      int           //每页数量
+	SelectTime    string        //时间
+	Area          string        //区域
+	City          string        //城市
+	Buyerclass    string        //采购单位行业
+	Subtype       string        //信息类型 二级分类
+	Subscopeclass string        //信息行业
+	Key           string        //订阅词
+	Export        bool          //导出
 }
 
 func (spqp *SubPushQueryParam) IsEmpty() bool {
-    return spqp.SelectTime == "" && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == ""
+	return spqp.SelectTime == "" && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == ""
 }
 
 type subscribePush struct {
-    ModuleFlag string
+	ModuleFlag string
 }
 
 func NewSubscribePush(module ...string) *subscribePush {
-    m := ""
-    if len(module) > 0 {
-        m = module[0]
-    }
-    return &subscribePush{m}
+	m := ""
+	if len(module) > 0 {
+		m = module[0]
+	}
+	return &subscribePush{m}
 }
 
 //从pushcache_2_a中取
-func (s *subscribePush) GetTodayCache(userId string) (*SubPush, error) {
-    pc_a, err := redis.GetNewBytes("pushcache_2_b", s.todayKey(userId))
-    if err != nil {
-        return nil, err
-    }
-    if pc_a == nil {
-        return nil, nil
-    }
-    var p *SubPush
-    if err := json.Unmarshal(*pc_a, &p); err != nil {
-        return nil, err
-    }
-    return p, nil
-}
-
-//从pushcache_2_a中取
-func (s *subscribePush) GetTodayCacheEntniche(entId int, userId string) (*SubPush, error) {
-    pc_a, err := redis.GetNewBytes("pushcache_2_b", s.todayKeyEntniche(entId, userId))
-    if err != nil {
-        return nil, err
-    }
-    if pc_a == nil {
-        return nil, nil
-    }
-    var p *SubPush
-    if err := json.Unmarshal(*pc_a, &p); err != nil {
-        return nil, err
-    }
-    return p, nil
+func (h *subscribePush) GetTodayCache(userId string) (*SubPush, error) {
+	pc_a, err := redis.GetNewBytes("pushcache_2_b", h.todayKey(userId))
+	if err != nil {
+		return nil, err
+	}
+	if pc_a == nil {
+		return nil, nil
+	}
+	var p *SubPush
+	if err := json.Unmarshal(*pc_a, &p); err != nil {
+		return nil, err
+	}
+	return p, nil
 }
 
 //往pushcache_2_a中放
-func (s *subscribePush) PutTodayCache(userId string, pc_a *SubPush) {
-    redis.Put("pushcache_2_b", s.todayKey(userId), pc_a, threeDay)
-}
-
-//往pushcache_2_a中放
-func (s *subscribePush) PutTodayCacheEntniche(entId int, userId string, pc_a *SubPush) {
-    redis.Put("pushcache_2_b", s.todayKeyEntniche(entId, userId), pc_a, threeDay)
+func (h *subscribePush) PutTodayCache(userId string, pc_a *SubPush) {
+	redis.Put("pushcache_2_b", h.todayKey(userId), pc_a, threeDay)
 }
 
 //获取redis key
 func (s *subscribePush) todayKey(userId string) string {
-    return fmt.Sprintf("%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId)
-}
-
-//获取redis key
-func (s *subscribePush) todayKeyEntniche(entId int, userId string) string {
-    return fmt.Sprintf("entnichepush_%d_%s", entId, userId)
+	return fmt.Sprintf("%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId)
 }
 func (s *subscribePush) allKey(userId string) string {
-    log.Println(fmt.Sprintf("all_%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId))
-    return fmt.Sprintf("all_%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId)
-}
-
-//查看全部列表缓存
-func (s *subscribePush) allKeyEntniche(entId int, userId string) string {
-    return fmt.Sprintf("all_entnichepush_%d_%s", entId, userId)
+	log.Println(fmt.Sprintf("all_%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId))
+	return fmt.Sprintf("all_%s_%s", aboutDbMsg[s.ModuleFlag].RedisKeyFlag, userId)
 }
 
 //历史推送记录中单条信息格式化
 func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}) *SubPushList {
-    area := ObjToString((*info)["area"])
-    if area == "A" {
-        area = "全国"
-    }
-    industry := ObjToString((*info)["s_subscopeclass"])
-    scs := strings.Split(industry, ",")
-    if len(scs) > 0 {
-        industry = scs[0]
-        if industry != "" {
-            iss := strings.Split(industry, "_")
-            if len(iss) > 0 {
-                industry = iss[0]
-            }
-        }
-    }
-    infotype := ObjToString((*info)["subtype"])
-    if infotype == "" {
-        infotype = ObjToString((*info)["toptype"])
-    }
-    if infotype == "" {
-        infotype = ObjToString((*info)["type"])
-        if infotype == "tender" {
-            infotype = "招标"
-        } else if infotype == "bid" {
-            infotype = "中标"
-        }
-    }
-    _id := p.InfoId
-    if _id == "" {
-        _id = ObjToString((*info)["_id"])
-    }
-    return &SubPushList{
-        Id:              EncodeArticleId2ByCheck(_id),
-        Title:           ObjToString((*info)["title"]),
-        Area:            area,
-        Buyerclass:      ObjToString((*info)["buyerclass"]),
-        Type:            infotype,
-        S_subscopeclass: industry,
-        Publishtime:     Int64All((*info)["publishtime"]),
-        Ca_index:        p.Index,
-        Ca_date:         p.Date,
-        Ca_isvisit:      p.Visit,
-        Ca_isvip:        p.Isvip,
-        Ca_type:         p.Type,
-        Matchkeys:       p.Keys,
-        Budget:          (*info)["budget"],
-        Bidamount:       (*info)["bidamount"],
-        Buyer:           ObjToString((*info)["buyer"]),
-        ProjectName:     ObjToString((*info)["projectname"]),
-        S_winner:        ObjToString((*info)["s_winner"]),
-        Bidopentime:     Int64All((*info)["bidopentime"]),
-    }
+	area := ObjToString((*info)["area"])
+	if area == "A" {
+		area = "全国"
+	}
+	industry := ObjToString((*info)["s_subscopeclass"])
+	scs := strings.Split(industry, ",")
+	if len(scs) > 0 {
+		industry = scs[0]
+		if industry != "" {
+			iss := strings.Split(industry, "_")
+			if len(iss) > 0 {
+				industry = iss[0]
+			}
+		}
+	}
+	infotype := ObjToString((*info)["subtype"])
+	if infotype == "" {
+		infotype = ObjToString((*info)["toptype"])
+	}
+	if infotype == "" {
+		infotype = ObjToString((*info)["type"])
+		if infotype == "tender" {
+			infotype = "招标"
+		} else if infotype == "bid" {
+			infotype = "中标"
+		}
+	}
+	_id := p.InfoId
+	if _id == "" {
+		_id = ObjToString((*info)["_id"])
+	}
+	return &SubPushList{
+		Id:              EncodeArticleId2ByCheck(_id),
+		Title:           ObjToString((*info)["title"]),
+		Area:            area,
+		Buyerclass:      ObjToString((*info)["buyerclass"]),
+		Type:            infotype,
+		S_subscopeclass: industry,
+		Publishtime:     Int64All((*info)["publishtime"]),
+		Ca_index:        p.Index,
+		Ca_date:         p.Date,
+		Ca_isvisit:      p.Visit,
+		Ca_isvip:        p.Isvip,
+		Ca_type:         p.Type,
+		Matchkeys:       p.Keys,
+		Budget:          (*info)["budget"],
+		Bidamount:       (*info)["bidamount"],
+		Buyer:           ObjToString((*info)["buyer"]),
+		ProjectName:     ObjToString((*info)["projectname"]),
+		S_winner:        ObjToString((*info)["s_winner"]),
+		Bidopentime:     Int64All((*info)["bidopentime"]),
+	}
 }
 
 func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total int64, result []*SubPushList) {
-    log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
-    if spqp.UserId == "" {
-        return
-    }
-    if spqp.PageNum < 1 {
-        spqp.PageNum = 1
-    }
-    if spqp.PageSize < 1 || spqp.PageSize > pageSize {
-        if !spqp.Export {
-            spqp.PageSize = pageSize
-        } else { //数据导出查询20000条限制
-            if spqp.PageSize < 1 || spqp.PageSize > 20000 {
-                spqp.PageSize = 20000
-            }
-        }
-    }
-    starttime, endtime := int64(0), int64(0)
-    st, et := "", ""
-    now := time.Now()
-    log.Println(4444)
-    if spqp.SelectTime == "today" { //今天
-        starttime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
-    } else if spqp.SelectTime == "yesterday" { //昨天
-        starttime = time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, time.Local).Unix()
-        endtime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
-    } else if spqp.SelectTime == "lately-7" { //最近7天
-        starttime = time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix()
-    } else if spqp.SelectTime == "lately-30" { //最近30天
-        starttime = time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix()
-    } else if spqp.SelectTime == "lastyear" { //去年
-        starttime = time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix()
-        endtime = time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix()
-    } else if len(strings.Split(spqp.SelectTime, "_")) == 2 {
-        st = strings.Split(spqp.SelectTime, "_")[0]
-        starttime, _ = strconv.ParseInt(st, 0, 64)
-        et = strings.Split(spqp.SelectTime, "_")[1]
-        endtime, _ = strconv.ParseInt(et, 0, 64)
-        if endtime > 0 {
-            etTime := time.Unix(endtime, 0)
-            endtime = time.Date(etTime.Year(), etTime.Month(), etTime.Day(), 23, 59, 59, 0, time.Local).Unix()
-        }
-    }
-    nowFormat := NowFormat(Date_Short_Layout)
-    start := (spqp.PageNum - 1) * spqp.PageSize
-    end := start + spqp.PageSize
-    //时间是今天,没有别的过滤条件
-    if nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
-        var subPush *SubPush
-        var err error
-        if s.ModuleFlag == "s" {
-            subPush, err = s.GetTodayCacheEntniche(spqp.EntId, spqp.UserId)
-        } else {
-            subPush, err = s.GetTodayCache(spqp.UserId)
-        }
-        if err != nil {
-            log.Println(spqp.UserId, "GetTodayCache Error", err)
-        }
-        if err != nil || subPush == nil || subPush.Date != nowFormat || len(subPush.Datas) == 0 {
-            list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, false)
-            subPush = &SubPush{
-                Date:  nowFormat,
-                Datas: list,
-                Count: countSearch,
-            }
-            if s.ModuleFlag == "s" {
-                s.PutTodayCacheEntniche(spqp.EntId, spqp.UserId, subPush)
-            } else {
-                s.PutTodayCache(spqp.UserId, subPush)
-            }
-
-        }
-        length := len(subPush.Datas)
-        if end > length {
-            end = length
-        }
-        if start < length {
-            result = subPush.Datas[start:end]
-        }
-        total = int64(length)
-    } else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize <= 250 { //全部,没有过滤条件 之前缓存5页*50条=250
-        log.Println("a2")
-        var allCache *SubPush
-        var err error
-        if s.ModuleFlag == "s" {
-            allCache, err = s.GetAllCacheEntniche(spqp.EntId,spqp.UserId)
-        } else
-        {
-            allCache, err = s.GetAllCache(spqp.UserId)
-        }
-
-        if err != nil {
-            log.Println(spqp.UserId, "GetAllCache Error", err)
-        }
-        if err != nil || allCache == nil || allCache.Date != nowFormat || len(allCache.Datas) == 0 {
-            log.Println("a3")
-            spqp.PageNum = 1
-            log.Println(1111)
-            list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
-            allCache = &SubPush{
-                Date:  nowFormat,
-                Datas: list,
-                Count: countSearch,
-            }
-            if s.ModuleFlag == "s" {
-                s.PutAllCacheEntniche(spqp.EntId, spqp.UserId,allCache)
-            } else {
-                s.PutAllCache(spqp.UserId, allCache)
-            }
-
-        }
-        length := len(allCache.Datas)
-        if end > length {
-            end = length
-        }
-        if start < length {
-            result = allCache.Datas[start:end]
-        }
-        total = allCache.Count
-    } else {
-        log.Println("a4")
-        result, total = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
-    }
-    if result == nil {
-        result = []*SubPushList{}
-    }
-    hasNextPage = len(result) >= spqp.PageSize
-    return
+	 log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
+	if spqp.UserId == "" {
+		return
+	}
+	if spqp.PageNum < 1 {
+		spqp.PageNum = 1
+	}
+	if spqp.PageSize < 1 || spqp.PageSize > pageSize {
+		if !spqp.Export {
+			spqp.PageSize = pageSize
+		} else { //数据导出查询20000条限制
+			if spqp.PageSize < 1 || spqp.PageSize > 20000 {
+				spqp.PageSize = 20000
+			}
+		}
+	}
+	starttime, endtime := int64(0), int64(0)
+	st, et := "", ""
+	now := time.Now()
+	log.Println(4444)
+	if spqp.SelectTime == "today" { //今天
+		starttime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
+	} else if spqp.SelectTime == "yesterday" { //昨天
+		starttime = time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, time.Local).Unix()
+		endtime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
+	} else if spqp.SelectTime == "lately-7" { //最近7天
+		starttime = time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix()
+	} else if spqp.SelectTime == "lately-30" { //最近30天
+		starttime = time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix()
+	} else if spqp.SelectTime == "lastyear" { //去年
+		starttime = time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix()
+		endtime = time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix()
+	} else if len(strings.Split(spqp.SelectTime, "_")) == 2 {
+		st = strings.Split(spqp.SelectTime, "_")[0]
+		starttime, _ = strconv.ParseInt(st, 0, 64)
+		et = strings.Split(spqp.SelectTime, "_")[1]
+		endtime, _ = strconv.ParseInt(et, 0, 64)
+		if endtime > 0 {
+			etTime := time.Unix(endtime, 0)
+			endtime = time.Date(etTime.Year(), etTime.Month(), etTime.Day(), 23, 59, 59, 0, time.Local).Unix()
+		}
+	}
+	log.Println(2222)
+	nowFormat := NowFormat(Date_Short_Layout)
+	start := (spqp.PageNum - 1) * spqp.PageSize
+	end := start + spqp.PageSize
+	//时间是今天,没有别的过滤条件
+	if nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
+
+		log.Println("a1")
+		subPush, err := s.GetTodayCache(spqp.UserId)
+		if err != nil {
+			log.Println(spqp.UserId, "GetTodayCache Error", err)
+		}
+		if err != nil || subPush == nil || subPush.Date != nowFormat || len(subPush.Datas) == 0 {
+			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, false)
+			subPush = &SubPush{
+				Date:  nowFormat,
+				Datas: list,
+				Count: countSearch,
+			}
+			s.PutTodayCache(spqp.UserId, subPush)
+		}
+		length := len(subPush.Datas)
+		if end > length {
+			end = length
+		}
+		if start < length {
+			result = subPush.Datas[start:end]
+		}
+		total = int64(length)
+	} else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize <= 250 { //全部,没有过滤条件 之前缓存5页*50条=250
+		log.Println("a2")
+	allCache, err := s.GetAllCache(spqp.UserId)
+		if err != nil {
+			log.Println(spqp.UserId, "GetAllCache Error", err)
+		}
+		if err != nil || allCache == nil || allCache.Date != nowFormat || len(allCache.Datas) == 0 {
+			log.Println("a3")
+			spqp.PageNum = 1
+			log.Println(1111)
+			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
+			allCache = &SubPush{
+				Date:  nowFormat,
+				Datas: list,
+				Count: countSearch,
+			}
+			s.PutAllCache(spqp.UserId, allCache)
+		}
+		length := len(allCache.Datas)
+		if end > length {
+			end = length
+		}
+		if start < length {
+			result = allCache.Datas[start:end]
+		}
+		total = allCache.Count
+	} else {
+		log.Println("a4")
+		result, total = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
+	}
+	if result == nil {
+		result = []*SubPushList{}
+	}
+	hasNextPage = len(result) >= spqp.PageSize
+	return
 }
 func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, endtime int64, size int, isLimit bool) (result []*SubPushList, count int64) {
-    querys := []string{fmt.Sprintf("userid='%s'", spqp.UserId)}
-    //时间
-    if starttime > 0 && endtime > 0 {
-        querys = append(querys, fmt.Sprintf("date>=%d and date<=%d", starttime, endtime))
-    } else if starttime > 0 && endtime == 0 {
-        querys = append(querys, fmt.Sprintf("date>=%d", starttime))
-    } else if starttime == 0 && endtime > 0 {
-        querys = append(querys, fmt.Sprintf("date<=%d", endtime))
-    }
-    if spqp.Area != "" || spqp.City != "" {
-        var sqlAreaCity = ""
-        //城市
-        city := []string{}
-        for _, v := range strings.Split(spqp.City, ",") {
-            if PushMapping.City[v] > 0 {
-                city = append(city, fmt.Sprint(PushMapping.City[v]))
-            } else {
-                city = append(city, "-1")
-            }
-        }
-        if len(city) == 1 {
-            city = append(city, "9999")
-        }
-        if len(city) > 0 {
-            sqlAreaCity = fmt.Sprintf("city in (%s)", strings.Join(city, ","))
-        }
-        //区域
-        var sqlArea = ""
-        area := []string{}
-        for _, v := range strings.Split(spqp.Area, ",") {
-            if PushMapping.Area[v] > 0 {
-                area = append(area, fmt.Sprint(PushMapping.Area[v]))
-            } else {
-                area = append(area, "-1")
-            }
-        }
-        if len(area) == 1 {
-            area = append(area, "9999")
-        }
-        if len(area) > 0 {
-            sqlArea = fmt.Sprintf("area in (%s)", strings.Join(area, ","))
-        }
-        if sqlAreaCity != "" && sqlArea != "" {
-            sqlAreaCity = "( " + sqlAreaCity + " or " + sqlArea + " )"
-        } else if sqlAreaCity == "" && sqlArea != "" {
-            sqlAreaCity = sqlArea
-        }
-        if sqlAreaCity != "" {
-            querys = append(querys, sqlAreaCity)
-        }
-    }
-    //采购单位行业
-    if spqp.Buyerclass != "" {
-        buyerclass := []string{}
-        for _, v := range strings.Split(spqp.Buyerclass, ",") {
-            buyerclass = append(buyerclass, fmt.Sprint(PushMapping.Buyerclass[v]))
-        }
-        if len(buyerclass) == 1 {
-            buyerclass = append(buyerclass, "9999")
-        }
-        if len(buyerclass) > 0 {
-            querys = append(querys, fmt.Sprintf("buyerclass in (%s)", strings.Join(buyerclass, ",")))
-        }
-    }
-    //信息类型
-    if spqp.Subtype != "" {
-        subtype := []string{}
-        for _, v := range strings.Split(spqp.Subtype, ",") {
-            subtype = append(subtype, fmt.Sprint(PushMapping.Subtype[v]))
-        }
-        if len(subtype) == 1 {
-            subtype = append(subtype, "9999")
-        }
-        if len(subtype) > 0 {
-            querys = append(querys, fmt.Sprintf("subtype in (%s)", strings.Join(subtype, ",")))
-        }
-    }
-    //信息行业
-    if spqp.Subscopeclass != "" {
-        find_in_set := []string{}
-        for _, v := range strings.Split(spqp.Subscopeclass, ",") {
-            find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%d',subscopeclass)", PushMapping.Subscopeclass[v]))
-        }
-        if len(find_in_set) == 1 {
-            querys = append(querys, find_in_set[0])
-        } else if len(find_in_set) > 1 {
-            querys = append(querys, fmt.Sprintf("(%s)", strings.Join(find_in_set, " or ")))
-        }
-    }
-    //关键词
-    if spqp.Key != "" {
-        find_in_set := []string{}
-        for _, v := range strings.Split(spqp.Key, ",") {
-            find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(matchkeys,'+',','),' ',','))", v))
-        }
-        if len(find_in_set) == 1 {
-            querys = append(querys, find_in_set[0])
-        } else if len(find_in_set) > 1 {
-            querys = append(querys, fmt.Sprintf("(%s)", strings.Join(find_in_set, " or ")))
-        }
-    }
-    searchSql := fmt.Sprintf(" from %s where %s order by id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "))
-    fmt.Println("searchSql", searchSql)
-    //查询总数
-    count = spqp.PushMysql.CountBySql(fmt.Sprintf("select count(id)" + searchSql))
-
-    findSql := "select id,date,infoid,isvisit,matchkeys,type"
-    if s.ModuleFlag != MemberFlag {
-        if s.ModuleFlag == EntnicheFlag {
-
-        } else {
-            findSql += ",isvip"
-        }
-
-    }
-
-    findSql += searchSql
-    if isLimit {
-        findSql += fmt.Sprintf(" limit %d,%d", (spqp.PageNum-1)*size, size)
-    }
-
-    log.Println(spqp.UserId, "subscribePush query sql:", findSql)
-    list := spqp.PushMysql.SelectBySql(findSql)
-    if list != nil && len(*list) > 0 {
-        pushCas := s.GetJyPushs(*list)
-        result = s.GetInfoByIds(spqp.Mgo_bidding, spqp.Bidding, spqp.Bidding_back, pushCas)
-    } else {
-        result = []*SubPushList{}
-    }
-    return
+	querys := []string{fmt.Sprintf("userid='%s'", spqp.UserId)}
+	//时间
+	if starttime > 0 && endtime > 0 {
+		querys = append(querys, fmt.Sprintf("date>=%d and date<=%d", starttime, endtime))
+	} else if starttime > 0 && endtime == 0 {
+		querys = append(querys, fmt.Sprintf("date>=%d", starttime))
+	} else if starttime == 0 && endtime > 0 {
+		querys = append(querys, fmt.Sprintf("date<=%d", endtime))
+	}
+	if spqp.Area != "" || spqp.City != "" {
+		var sqlAreaCity = ""
+		//城市
+		city := []string{}
+		for _, v := range strings.Split(spqp.City, ",") {
+			if PushMapping.City[v] > 0 {
+				city = append(city, fmt.Sprint(PushMapping.City[v]))
+			} else {
+				city = append(city, "-1")
+			}
+		}
+		if len(city) == 1 {
+			city = append(city, "9999")
+		}
+		if len(city) > 0 {
+			sqlAreaCity = fmt.Sprintf("city in (%s)", strings.Join(city, ","))
+		}
+		//区域
+		var sqlArea = ""
+		area := []string{}
+		for _, v := range strings.Split(spqp.Area, ",") {
+			if PushMapping.Area[v] > 0 {
+				area = append(area, fmt.Sprint(PushMapping.Area[v]))
+			} else {
+				area = append(area, "-1")
+			}
+		}
+		if len(area) == 1 {
+			area = append(area, "9999")
+		}
+		if len(area) > 0 {
+			sqlArea = fmt.Sprintf("area in (%s)", strings.Join(area, ","))
+		}
+		if sqlAreaCity != "" && sqlArea != "" {
+			sqlAreaCity = "( " + sqlAreaCity + " or " + sqlArea + " )"
+		} else if sqlAreaCity == "" && sqlArea != "" {
+			sqlAreaCity = sqlArea
+		}
+		if sqlAreaCity != "" {
+			querys = append(querys, sqlAreaCity)
+		}
+	}
+	//采购单位行业
+	if spqp.Buyerclass != "" {
+		buyerclass := []string{}
+		for _, v := range strings.Split(spqp.Buyerclass, ",") {
+			buyerclass = append(buyerclass, fmt.Sprint(PushMapping.Buyerclass[v]))
+		}
+		if len(buyerclass) == 1 {
+			buyerclass = append(buyerclass, "9999")
+		}
+		if len(buyerclass) > 0 {
+			querys = append(querys, fmt.Sprintf("buyerclass in (%s)", strings.Join(buyerclass, ",")))
+		}
+	}
+	//信息类型
+	if spqp.Subtype != "" {
+		subtype := []string{}
+		for _, v := range strings.Split(spqp.Subtype, ",") {
+			subtype = append(subtype, fmt.Sprint(PushMapping.Subtype[v]))
+		}
+		if len(subtype) == 1 {
+			subtype = append(subtype, "9999")
+		}
+		if len(subtype) > 0 {
+			querys = append(querys, fmt.Sprintf("subtype in (%s)", strings.Join(subtype, ",")))
+		}
+	}
+	//信息行业
+	if spqp.Subscopeclass != "" {
+		find_in_set := []string{}
+		for _, v := range strings.Split(spqp.Subscopeclass, ",") {
+			find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%d',subscopeclass)", PushMapping.Subscopeclass[v]))
+		}
+		if len(find_in_set) == 1 {
+			querys = append(querys, find_in_set[0])
+		} else if len(find_in_set) > 1 {
+			querys = append(querys, fmt.Sprintf("(%s)", strings.Join(find_in_set, " or ")))
+		}
+	}
+	//关键词
+	if spqp.Key != "" {
+		find_in_set := []string{}
+		for _, v := range strings.Split(spqp.Key, ",") {
+			find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(matchkeys,'+',','),' ',','))", v))
+		}
+		if len(find_in_set) == 1 {
+			querys = append(querys, find_in_set[0])
+		} else if len(find_in_set) > 1 {
+			querys = append(querys, fmt.Sprintf("(%s)", strings.Join(find_in_set, " or ")))
+		}
+	}
+	searchSql := fmt.Sprintf(" from %s where %s order by id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "))
+	fmt.Println("searchSql", searchSql)
+	//查询总数
+	count = spqp.PushMysql.CountBySql(fmt.Sprintf("select count(id)" + searchSql))
+
+	findSql := "select id,date,infoid,isvisit,matchkeys,type"
+	if s.ModuleFlag != MemberFlag {
+		if s.ModuleFlag==EntnicheFlag{
+
+		}else{
+			findSql += ",isvip"
+		}
+
+	}
+
+	findSql += searchSql
+	if isLimit {
+		findSql += fmt.Sprintf(" limit %d,%d", (spqp.PageNum-1)*size, size)
+	}
+
+	log.Println(spqp.UserId, "subscribePush query sql:", findSql)
+	list := spqp.PushMysql.SelectBySql(findSql)
+	if list != nil && len(*list) > 0 {
+		pushCas := s.GetJyPushs(*list)
+		result = s.GetInfoByIds(spqp.Mgo_bidding, spqp.Bidding, spqp.Bidding_back, pushCas)
+	} else {
+		result = []*SubPushList{}
+	}
+	return
 }
 
 //获取历史推送
 func (s *subscribePush) GetJyPushs(datas []map[string]interface{}) (pushCas []*PushCa) {
-    pushCas = []*PushCa{}
-    for _, v := range datas {
-        keys := []string{}
-        if matchkeys := ObjToString(v["matchkeys"]); matchkeys != "" {
-            keys = strings.Split(matchkeys, " ")
-        }
-        pushCas = append(pushCas, &PushCa{
-            Date:   Int64All(v["date"]),
-            InfoId: ObjToString(v["infoid"]),
-            Visit:  IntAll(v["isvisit"]),
-            Index:  Int64All(v["id"]),
-            Keys:   keys,
-            Type:   IntAll(v["type"]),
-            Isvip:  IntAll(v["isvip"]),
-        })
-    }
-    return
+	pushCas = []*PushCa{}
+	for _, v := range datas {
+		keys := []string{}
+		if matchkeys := ObjToString(v["matchkeys"]); matchkeys != "" {
+			keys = strings.Split(matchkeys, " ")
+		}
+		pushCas = append(pushCas, &PushCa{
+			Date:   Int64All(v["date"]),
+			InfoId: ObjToString(v["infoid"]),
+			Visit:  IntAll(v["isvisit"]),
+			Index:  Int64All(v["id"]),
+			Keys:   keys,
+			Type:   IntAll(v["type"]),
+			Isvip:  IntAll(v["isvip"]),
+		})
+	}
+	return
 }
 
 //根据id取内容
 func (s *subscribePush) GetInfoByIds(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, pushCas []*PushCa) []*SubPushList {
-    array := make([]*SubPushList, len(pushCas))
-    if len(pushCas) == 0 {
-        return array
-    }
-    m := map[string]bool{}
-    ids := []string{}
-    for _, v := range pushCas {
-        if m[v.InfoId] {
-            continue
-        }
-        m[v.InfoId] = true
-        ids = append(ids, v.InfoId)
-    }
-    infos := map[string]map[string]interface{}{}
-    //redis
-
-    es_ids := []string{}
-    for _, v := range ids {
-        info_i := redis.Get("pushcache_1", fmt.Sprintf("info_%s", v))
-        if info_i != nil {
-            info_m, _ := info_i.(map[string]interface{})
-            info_m["_id"] = v
-            infos[v] = info_m
-        } else {
-            es_ids = append(es_ids, v)
-        }
-    }
-    //	log.Println(es_ids)
-    //elasticsearch
-    if len(es_ids) > 0 {
-        list := elastic.Get("bidding", "bidding", fmt.Sprintf(query, strings.Join(es_ids, `","`), len(es_ids)))
-        if list != nil {
-            for _, v := range *list {
-                _id := ObjToString(v["_id"])
-                infos[_id] = v
-            }
-        }
-    }
-    //mongodb bidding
-    mgo_ids := []primitive.ObjectID{}
-    for _, v := range es_ids {
-        if infos[v] == nil {
-            _id, _ := primitive.ObjectIDFromHex(v)
-            mgo_ids = append(mgo_ids, _id)
-        }
-    }
-    if len(mgo_ids) > 0 {
-        list, ok := Mgo_bidding.Find(bidding, map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_ids}}, nil, mongodb_fields, false, -1, -1)
-        if ok && *list != nil {
-            for _, v := range *list {
-                _id := mg.BsonIdToSId(v["_id"])
-                v["_id"] = _id
-                infos[_id] = v
-            }
-        }
-    }
-    //mongodb bidding_back
-    mgo_back_ids := []primitive.ObjectID{}
-    for _, v := range mgo_ids {
-        if infos[mg.BsonIdToSId(v)] == nil {
-            mgo_back_ids = append(mgo_back_ids, v)
-        }
-    }
-    if len(mgo_back_ids) > 0 {
-        list, ok := Mgo_bidding.Find(bidding_back, map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_back_ids}}, nil, mongodb_fields, false, -1, -1)
-        if ok && *list != nil {
-            for _, v := range *list {
-                _id := mg.BsonIdToSId(v["_id"])
-                v["_id"] = _id
-                infos[_id] = v
-            }
-        }
-    }
-    //
-    for k, v := range pushCas {
-        info := infos[v.InfoId]
-        if info == nil {
-            info = map[string]interface{}{}
-        }
-        array[k] = s.InfoFormat(v, &info)
-    }
-    return array
+	array := make([]*SubPushList, len(pushCas))
+	if len(pushCas) == 0 {
+		return array
+	}
+	m := map[string]bool{}
+	ids := []string{}
+	for _, v := range pushCas {
+		if m[v.InfoId] {
+			continue
+		}
+		m[v.InfoId] = true
+		ids = append(ids, v.InfoId)
+	}
+	infos := map[string]map[string]interface{}{}
+	//redis
+
+	es_ids := []string{}
+	for _, v := range ids {
+		info_i := redis.Get("pushcache_1", fmt.Sprintf("info_%s", v))
+		if info_i != nil {
+			info_m, _ := info_i.(map[string]interface{})
+			info_m["_id"] = v
+			infos[v] = info_m
+		} else {
+			es_ids = append(es_ids, v)
+		}
+	}
+	//	log.Println(es_ids)
+	//elasticsearch
+	if len(es_ids) > 0 {
+		list := elastic.Get("bidding", "bidding", fmt.Sprintf(query, strings.Join(es_ids, `","`), len(es_ids)))
+		if list != nil {
+			for _, v := range *list {
+				_id := ObjToString(v["_id"])
+				infos[_id] = v
+			}
+		}
+	}
+	//mongodb bidding
+	mgo_ids := []primitive.ObjectID{}
+	for _, v := range es_ids {
+		if infos[v] == nil {
+			_id, _ := primitive.ObjectIDFromHex(v)
+			mgo_ids = append(mgo_ids, _id)
+		}
+	}
+	if len(mgo_ids) > 0 {
+		list, ok := Mgo_bidding.Find(bidding, map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_ids}}, nil, mongodb_fields, false, -1, -1)
+		if ok && *list != nil {
+			for _, v := range *list {
+				_id := mg.BsonIdToSId(v["_id"])
+				v["_id"] = _id
+				infos[_id] = v
+			}
+		}
+	}
+	//mongodb bidding_back
+	mgo_back_ids := []primitive.ObjectID{}
+	for _, v := range mgo_ids {
+		if infos[mg.BsonIdToSId(v)] == nil {
+			mgo_back_ids = append(mgo_back_ids, v)
+		}
+	}
+	if len(mgo_back_ids) > 0 {
+		list, ok := Mgo_bidding.Find(bidding_back, map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_back_ids}}, nil, mongodb_fields, false, -1, -1)
+		if ok && *list != nil {
+			for _, v := range *list {
+				_id := mg.BsonIdToSId(v["_id"])
+				v["_id"] = _id
+				infos[_id] = v
+			}
+		}
+	}
+	//
+	for k, v := range pushCas {
+		info := infos[v.InfoId]
+		if info == nil {
+			info = map[string]interface{}{}
+		}
+		array[k] = s.InfoFormat(v, &info)
+	}
+	return array
 }
 
 //保存最近7天的数据到历史记录
 func (s *subscribePush) MakeHistoryDatas(MQFW mg.MongodbSim, PushMysql *mysql.Mysql, userId string, PushView func(userid, allquery, field string, pageNum, pageSize int) (keys []interface{}, list *[]map[string]interface{})) (bool, []*SubPushList) {
-    log.Println("匹配最近7天数据", userId)
-    field := `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount"`
-    allquery := `{"range":{"publishtime":{"gt":%s}}}`
-    allquery = fmt.Sprintf(allquery, fmt.Sprint(time.Now().AddDate(0, 0, -7).Unix()))
-    //allquery = ``
-    keys, list := PushView(userId, allquery, field, 1, 50)
-    if list == nil || len(*list) == 0 {
-        return true, nil
-    }
-    matchkeys := []string{}
-    for _, v := range keys {
-        matchkeys = append(matchkeys, strings.Join(ObjArrToStringArr(v.([]interface{})), "+"))
-    }
-    publishTitle := map[string]bool{}
-    now := time.Now().Unix()
-    var array []*SubPushList
-    for i := len(*list) - 1; i >= 0; i-- {
-        v := (*list)[i]
-        var myInsert = make(map[string]interface{})
-        title := strings.Replace(v["title"].(string), "\n", "", -1)
-        area_check := ObjToString(v["area"])
-        if area_check == "A" {
-            area_check = "全国"
-        }
-        if publishTitle[area_check+title] {
-            continue
-        } else {
-            publishTitle[area_check+title] = true
-        }
-        myInsert["userid"] = userId
-        _id := ObjToString(v["_id"])
-        myInsert["infoid"] = _id
-        redisKey := fmt.Sprintf("pushinfo_%s_%s", userId, _id)
-        if isExists, _ := redis.Exists("pushcache_2_a", redisKey); isExists {
-            continue
-        }
-        myInsert["date"] = now
-        myInsert["matchkeys"] = strings.Join(matchkeys, " ")
-        if area_check != "" {
-            if area_check == "全国" {
-                myInsert["area"] = 0
-            } else if area_mapping, ok := PushMapping.Area[area_check]; ok {
-                myInsert["area"] = area_mapping
-            }
-        }
-        if city_check := ObjToString(v["city"]); city_check != "" {
-            if city_mapping, ok := PushMapping.City[city_check]; ok {
-                myInsert["city"] = city_mapping
-            }
-        }
-        if subtype := ObjToString(v["subtype"]); subtype != "" {
-            if subtype_mapping, ok := PushMapping.Subtype[subtype]; ok {
-                myInsert["subtype"] = subtype_mapping
-            }
-        }
-        if toptype := ObjToString(v["toptype"]); toptype != "" {
-            if toptype_mapping, ok := PushMapping.Toptype[toptype]; ok {
-                myInsert["toptype"] = toptype_mapping
-            }
-        }
-        if buyerclass := ObjToString(v["buyerclass"]); buyerclass != "" {
-            if buyerclass_mapping, ok := PushMapping.Buyerclass[buyerclass]; ok {
-                myInsert["buyerclass"] = buyerclass_mapping
-            }
-        }
-        if s_subscopeclass := ObjToString(v["s_subscopeclass"]); s_subscopeclass != "" {
-            subscopeclass := []string{}
-            for _, v := range strings.Split(s_subscopeclass, ",") {
-                if subscopeclass_mapping, ok := PushMapping.Subscopeclass[v]; ok {
-                    subscopeclass = append(subscopeclass, fmt.Sprint(subscopeclass_mapping))
-                }
-            }
-            if len(subscopeclass) > 0 {
-                myInsert["subscopeclass"] = strings.Join(subscopeclass, ",")
-            }
-        }
-        id := PushMysql.Insert("pushsubscribe", myInsert)
-        if id > 0 {
-            redis.Put("pushcache_2_a", redisKey, 1, 86400)
-        } else {
-            continue
-        }
-        array = append(array, s.InfoFormat(&PushCa{
-            InfoId: _id,
-            Date:   now,
-            Index:  id,
-            Keys:   matchkeys,
-        }, &v))
-    }
-    var resultList []*SubPushList
-    for i := len(array) - 1; i >= 0; i-- {
-        resultList = append(resultList, array[i])
-    }
-    return true, resultList
+	log.Println("匹配最近7天数据", userId)
+	field := `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount"`
+	allquery := `{"range":{"publishtime":{"gt":%s}}}`
+	allquery = fmt.Sprintf(allquery, fmt.Sprint(time.Now().AddDate(0, 0, -7).Unix()))
+	//allquery = ``
+	keys, list := PushView(userId, allquery, field, 1, 50)
+	if list == nil || len(*list) == 0 {
+		return true, nil
+	}
+	matchkeys := []string{}
+	for _, v := range keys {
+		matchkeys = append(matchkeys, strings.Join(ObjArrToStringArr(v.([]interface{})), "+"))
+	}
+	publishTitle := map[string]bool{}
+	now := time.Now().Unix()
+	var array []*SubPushList
+	for i := len(*list) - 1; i >= 0; i-- {
+		v := (*list)[i]
+		var myInsert = make(map[string]interface{})
+		title := strings.Replace(v["title"].(string), "\n", "", -1)
+		area_check := ObjToString(v["area"])
+		if area_check == "A" {
+			area_check = "全国"
+		}
+		if publishTitle[area_check+title] {
+			continue
+		} else {
+			publishTitle[area_check+title] = true
+		}
+		myInsert["userid"] = userId
+		_id := ObjToString(v["_id"])
+		myInsert["infoid"] = _id
+		redisKey := fmt.Sprintf("pushinfo_%s_%s", userId, _id)
+		if isExists, _ := redis.Exists("pushcache_2_a", redisKey); isExists {
+			continue
+		}
+		myInsert["date"] = now
+		myInsert["matchkeys"] = strings.Join(matchkeys, " ")
+		if area_check != "" {
+			if area_check == "全国" {
+				myInsert["area"] = 0
+			} else if area_mapping, ok := PushMapping.Area[area_check]; ok {
+				myInsert["area"] = area_mapping
+			}
+		}
+		if city_check := ObjToString(v["city"]); city_check != "" {
+			if city_mapping, ok := PushMapping.City[city_check]; ok {
+				myInsert["city"] = city_mapping
+			}
+		}
+		if subtype := ObjToString(v["subtype"]); subtype != "" {
+			if subtype_mapping, ok := PushMapping.Subtype[subtype]; ok {
+				myInsert["subtype"] = subtype_mapping
+			}
+		}
+		if toptype := ObjToString(v["toptype"]); toptype != "" {
+			if toptype_mapping, ok := PushMapping.Toptype[toptype]; ok {
+				myInsert["toptype"] = toptype_mapping
+			}
+		}
+		if buyerclass := ObjToString(v["buyerclass"]); buyerclass != "" {
+			if buyerclass_mapping, ok := PushMapping.Buyerclass[buyerclass]; ok {
+				myInsert["buyerclass"] = buyerclass_mapping
+			}
+		}
+		if s_subscopeclass := ObjToString(v["s_subscopeclass"]); s_subscopeclass != "" {
+			subscopeclass := []string{}
+			for _, v := range strings.Split(s_subscopeclass, ",") {
+				if subscopeclass_mapping, ok := PushMapping.Subscopeclass[v]; ok {
+					subscopeclass = append(subscopeclass, fmt.Sprint(subscopeclass_mapping))
+				}
+			}
+			if len(subscopeclass) > 0 {
+				myInsert["subscopeclass"] = strings.Join(subscopeclass, ",")
+			}
+		}
+		id := PushMysql.Insert("pushsubscribe", myInsert)
+		if id > 0 {
+			redis.Put("pushcache_2_a", redisKey, 1, 86400)
+		} else {
+			continue
+		}
+		array = append(array, s.InfoFormat(&PushCa{
+			InfoId: _id,
+			Date:   now,
+			Index:  id,
+			Keys:   matchkeys,
+		}, &v))
+	}
+	var resultList []*SubPushList
+	for i := len(array) - 1; i >= 0; i-- {
+		resultList = append(resultList, array[i])
+	}
+	return true, resultList
 }
 
 //获取用户信息
 func (s *subscribePush) UserInfo(MQFW mg.MongodbSim, userId string) (*map[string]interface{}, int64) {
-    user, ok := MQFW.FindById("user", userId, `{"s_m_openid":1,"a_m_openid":1,"s_phone":1,"a_mergeorder":1,"o_jy":1,"l_firstpushtime":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1,"i_member_status":1,"o_member_jy":1}`)
-    if !ok || user == nil {
-        return nil, 0
-    }
-    return user, Int64All((*user)["l_firstpushtime"])
+	user, ok := MQFW.FindById("user", userId, `{"s_m_openid":1,"a_m_openid":1,"s_phone":1,"a_mergeorder":1,"o_jy":1,"l_firstpushtime":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1,"i_member_status":1,"o_member_jy":1}`)
+	if !ok || user == nil {
+		return nil, 0
+	}
+	return user, Int64All((*user)["l_firstpushtime"])
 }
 func (s *subscribePush) Visit(PushMysql *mysql.Mysql, userId string, id int) {
-    if userId == "" {
-        return
-    }
-    PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), userId, id)
-    todaySubPush, err := s.GetTodayCache(userId)
-    if err == nil && todaySubPush != nil {
-        for _, v := range todaySubPush.Datas {
-            if v.Ca_index == Int64All(id) {
-                v.Ca_isvisit = 1
-                break
-            }
-        }
-        s.PutTodayCache(userId, todaySubPush)
-    }
-    //
-    allSubPush, err := s.GetAllCache(userId)
-    if err == nil && allSubPush != nil {
-        for _, v := range allSubPush.Datas {
-            if v.Ca_index == Int64All(id) {
-                v.Ca_isvisit = 1
-                break
-            }
-        }
-        s.PutAllCache(userId, allSubPush)
-    }
-}
-
-func (s *subscribePush) VisitEntniche(PushMysql *mysql.Mysql, entId int, userId string, id int) {
-    if id <= 0 {
-        return
-    }
-    PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), userId, id)
-
-    todaySubPush, err := s.GetTodayCacheEntniche(entId, userId)
-    if err == nil && todaySubPush != nil {
-        for _, v := range todaySubPush.Datas {
-            if v.Ca_index == Int64All(id) {
-                v.Ca_isvisit = 1
-                break
-            }
-        }
-        s.PutTodayCacheEntniche(entId, userId, todaySubPush)
-    }
-    //
-    allSubPush, err := s.GetAllCacheEntniche(entId, userId)
-    if err == nil && allSubPush != nil {
-        for _, v := range allSubPush.Datas {
-            if v.Ca_index == Int64All(id) {
-                v.Ca_isvisit = 1
-                break
-            }
-        }
-        s.PutAllCacheEntniche(entId, userId, allSubPush)
-    }
+	if userId == "" {
+		return
+	}
+	PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), userId, id)
+	todaySubPush, err := s.GetTodayCache(userId)
+	if err == nil && todaySubPush != nil {
+		for _, v := range todaySubPush.Datas {
+			if v.Ca_index == Int64All(id) {
+				v.Ca_isvisit = 1
+				break
+			}
+		}
+		s.PutTodayCache(userId, todaySubPush)
+	}
+	//
+	allSubPush, err := s.GetAllCache(userId)
+	if err == nil && allSubPush != nil {
+		for _, v := range allSubPush.Datas {
+			if v.Ca_index == Int64All(id) {
+				v.Ca_isvisit = 1
+				break
+			}
+		}
+		s.PutAllCache(userId, allSubPush)
+	}
 }
 
 //查看全部列表缓存
 func (s *subscribePush) PutAllCache(userId string, datas *SubPush) {
-    redis.Put("pushcache_2_a", s.allKey(userId), datas, threeDay)
-}
-func (s *subscribePush) PutAllCacheEntniche(entId int, userId string, datas *SubPush) {
-    redis.Put("pushcache_2_a", s.allKeyEntniche(entId, userId), datas, threeDay)
+	redis.Put("pushcache_2_a", s.allKey(userId), datas, threeDay)
 }
 
 func (s *subscribePush) GetAllCache(userId string) (*SubPush, error) {
-    return s.GetCache("pushcache_2_a", s.allKey(userId))
-}
-func (s *subscribePush) GetAllCacheEntniche(entId int, userId string) (*SubPush, error) {
-    return s.GetCache("pushcache_2_a", s.allKeyEntniche(entId, userId))
+	return s.GetCache("pushcache_2_a", s.allKey(userId))
 }
+
 func (s *subscribePush) GetCache(code, key string) (*SubPush, error) {
-    pc_a, err := redis.GetNewBytes(code, key)
-    if err != nil {
-        return nil, err
-    }
-    if pc_a == nil {
-        return nil, nil
-    }
-    var p *SubPush
-    if err := json.Unmarshal(*pc_a, &p); err != nil {
-        return nil, err
-    }
-    return p, nil
+	pc_a, err := redis.GetNewBytes(code, key)
+	if err != nil {
+		return nil, err
+	}
+	if pc_a == nil {
+		return nil, nil
+	}
+	var p *SubPush
+	if err := json.Unmarshal(*pc_a, &p); err != nil {
+		return nil, err
+	}
+	return p, nil
 }
 
 //是否收藏
 func (s *subscribePush) MakeCollection(userId string, m *mysql.Mysql, list []*SubPushList) {
-    if list == nil || len(list) == 0 {
-        return
-    }
-    param := []interface{}{userId}
-    wh := []string{}
-    for _, v := range list {
-        array := DecodeArticleId2ByCheck(v.Id)
-        if len(array) == 1 && array[0] != "" {
-            param = append(param, array[0])
-            wh = append(wh, "?")
-        }
-    }
-    if len(wh) > 0 {
-        result := m.SelectBySql(`select bid from bdcollection where userid=? and bid in (`+strings.Join(wh, ",")+`)`, param...)
-        bid_map := map[string]bool{}
-        if result != nil {
-            for _, v := range *result {
-                bid_map[EncodeArticleId2ByCheck(ObjToString(v["bid"]))] = true
-            }
-        }
-        for _, v := range list {
-            if bid_map[v.Id] {
-                v.Collection = 1
-            }
-        }
-    }
+	if list == nil || len(list) == 0 {
+		return
+	}
+	param := []interface{}{userId}
+	wh := []string{}
+	for _, v := range list {
+		array := DecodeArticleId2ByCheck(v.Id)
+		if len(array) == 1 && array[0] != "" {
+			param = append(param, array[0])
+			wh = append(wh, "?")
+		}
+	}
+	if len(wh) > 0 {
+		result := m.SelectBySql(`select bid from bdcollection where userid=? and bid in (`+strings.Join(wh, ",")+`)`, param...)
+		bid_map := map[string]bool{}
+		if result != nil {
+			for _, v := range *result {
+				bid_map[EncodeArticleId2ByCheck(ObjToString(v["bid"]))] = true
+			}
+		}
+		for _, v := range list {
+			if bid_map[v.Id] {
+				v.Collection = 1
+			}
+		}
+	}
 }
 
 //仅移动端首页使用,历史推送7天信息
 func (s *subscribePush) sevenDayKey(userId string) string {
-    return fmt.Sprintf("7day_subpush_%s", userId)
+	return fmt.Sprintf("7day_subpush_%s", userId)
 }
 
 func (s *subscribePush) PutSevenDayCache(userId string, datas []*SubPushList) {
-    redis.Put("pushcache_2_a", s.sevenDayKey(userId), SubPush{Datas: datas}, 7*24*60*60)
+	redis.Put("pushcache_2_a", s.sevenDayKey(userId), SubPush{Datas: datas}, 7*24*60*60)
 }
 
 //从pushcache_2_a中取
 func (s *subscribePush) GetSevenDayCache(userId string) ([]*SubPushList, error) {
-    allPush, _ := s.GetCache("pushcache_2_a", s.sevenDayKey(userId))
-    if allPush != nil && allPush.Datas != nil && len(allPush.Datas) > 0 {
-        return allPush.Datas, nil
-    }
-    return nil, nil
+	allPush, _ := s.GetCache("pushcache_2_a", s.sevenDayKey(userId))
+	if allPush != nil && allPush.Datas != nil && len(allPush.Datas) > 0 {
+		return allPush.Datas, nil
+	}
+	return nil, nil
 }
 
 //历史推送记录中单条信息格式化
 func InfoFormats(info map[string]interface{}, tmp map[string]interface{}) map[string]interface{} {
-    area := ObjToString(info["area"])
-    if area == "A" {
-        area = "全国"
-    }
-    industry := ObjToString(info["s_subscopeclass"])
-    scs := strings.Split(industry, ",")
-    if len(scs) > 0 {
-        industry = scs[0]
-        if industry != "" {
-            iss := strings.Split(industry, "_")
-            if len(iss) > 0 {
-                industry = iss[0]
-            }
-        }
-    }
-    infotype := ObjToString(info["subtype"])
-    if infotype == "" {
-        infotype = ObjToString(info["toptype"])
-    }
-    if infotype == "" {
-        infotype = ObjToString(info["type"])
-        if infotype == "tender" {
-            infotype = "招标"
-        } else if infotype == "bid" {
-            infotype = "中标"
-        }
-    }
-    info["type"] = infotype
-    return info
+	area := ObjToString(info["area"])
+	if area == "A" {
+		area = "全国"
+	}
+	industry := ObjToString(info["s_subscopeclass"])
+	scs := strings.Split(industry, ",")
+	if len(scs) > 0 {
+		industry = scs[0]
+		if industry != "" {
+			iss := strings.Split(industry, "_")
+			if len(iss) > 0 {
+				industry = iss[0]
+			}
+		}
+	}
+	infotype := ObjToString(info["subtype"])
+	if infotype == "" {
+		infotype = ObjToString(info["toptype"])
+	}
+	if infotype == "" {
+		infotype = ObjToString(info["type"])
+		if infotype == "tender" {
+			infotype = "招标"
+		} else if infotype == "bid" {
+			infotype = "中标"
+		}
+	}
+	info["type"] = infotype
+	return info
 }

+ 11 - 0
src/jfw/modules/weixin/src/jrpc/jrpc.go

@@ -525,3 +525,14 @@ func permQrCodeFromWx(id string, w *weixin.Weixin) ([]byte, error) {
 	}
 	return r.PNG(), nil
 }
+
+//剑鱼标讯获取未关注用户得unionid
+func (w *WeiXinRpc) GetUnionid(openid string, unionid *string) (err error) {
+	bs, err := w.Wwx.GetUserInfo(openid)
+	if err != nil {
+		log.Println("err:", err.Error())
+		return nil
+	}
+	*unionid = bs.UnionId
+	return nil
+}

BIN
src/jfw/modules/weixin/src/微信模板消息.xlsx


+ 18 - 0
src/jfw/public/rpccall.go

@@ -119,3 +119,21 @@ func GetShareQRStr(url string) string {
 	}, func(e interface{}) {})
 	return ret
 }
+
+//获取未关注用户unionid
+func GetUnionid(openid string) string {
+	var unionid string
+	util.Try(func() {
+		client, err := rpc.DialHTTP("tcp", rpcserver)
+		defer client.Close()
+		if err != nil {
+			log.Println(err.Error())
+			return
+		}
+		err = client.Call("WeiXinRpc.GetUnionid", openid, &unionid)
+		if err != nil {
+			log.Println(err.Error())
+		}
+	}, func(e interface{}) {})
+	return unionid
+}

+ 3 - 1
src/phoneFilter.json

@@ -15,7 +15,9 @@
 		"^/qr$",
 		"^/front/landpage/captcha$",
 		"^/biddetail/(\\w+)/qr/(.*)",
-		"^/swordfish/about$"
+		"^/swordfish/about$",
+		"^/orgstructure/invpage",
+		"^/orgpc/(.*)"
 	],
 	"sessUrl":{
 		"/jyTreasureBox/treasureBox":"",

+ 2 - 1
src/seo.json

@@ -20,7 +20,8 @@
 		"coupon_v:0001",
 		"big_pc_v:0001",
 		"xskc_v:0001",
-        "digital_v:0001"
+        "digital_v:0001",
+        "entbase_v:00001"
     ],
     "area": {
         "QG": {

+ 45 - 12
src/web/staticres/js/login.js

@@ -340,25 +340,25 @@ function checkMenuForEnt () {
     $.ajax({
         type: 'get',
         url: '/entbase/ent/mySelectent?t=' + new Date().getTime(),
-        success: function () {
+        success: function (er) {
             $.ajax({
                 type: 'get',
                 url: '/front/entExportAuth/getAuth?t=' + new Date().getTime(),
                 success: function (r) {
 					$(".myorderDiv[data-ent-menu]").remove()
 					var tempHtml = ''
-                    if(r.myEntMenu){
-                        tempHtml += "<div data-ent-menu class=\"myorderDiv\" onclick=\"window.location.href='/entpc/myent'\">"
+                    if(er.data!=null && er.data.status==1){
+                        tempHtml += "<div data-ent-menu class=\"myorderDiv\" onclick=\"window.location.href='/orgpc/myent'\">"
                         +"<span>我的企业</span>"
                         +"</div>"
                     }
                     if(r.entnicheMenu == true){
                         if (r.isNew == true) {
-                            tempHtml+= "<div class=\"myorderDiv\" onclick=\"window.location.href='/entpc/newBus'\">"
+                            tempHtml+= "<div class=\"myorderDiv\" id=\"entDiv\">"
                                 +"<span>商机管理</span>"
                                 +"</div>"
                         } else {
-                            tempHtml+= "<div data-ent-menu class=\"myorderDiv\" onclick=\"window.location.href='/entpc/bus'\">"
+                            tempHtml+= "<div data-ent-menu id=\"entDiv\" class=\"myorderDiv\">"
                                 +"<span>商机管理</span>"
                                 +"</div>"
                         }
@@ -369,6 +369,21 @@ function checkMenuForEnt () {
                           +"</div>"
                     }
                     $(".infoList .lastBox").before(tempHtml)
+                    $('#entDiv').click(function () {
+                        $.ajax({
+                            type:'POST',
+                            url:'/entnicheNew/buy/whetherbuy',
+                            success:function () {
+                                if(r.entnicheMenu == true){
+                                    if (r.isNew == true) {
+                                        window.location.href='/entpc/newBus'
+                                    } else {
+                                        window.location.href='/entpc/bus'
+                                    }
+                                }
+                            }
+                        })
+                    })
                 }
             })
         }
@@ -478,6 +493,11 @@ var logic = function(data,num){
 
 //登录后处理页面逻辑
 var processpage = function(shareid,num){
+  var backToUrl = getParam('backTo')
+  if (backToUrl) {
+    return location.replace(decodeURIComponent(backToUrl))
+  }
+
 	var toHref=$("#bidLogin").attr("data-rec")
 	switch (toHref) {
 		case "sjdc":
@@ -660,12 +680,8 @@ var signout = function(){
 		if(data=="ok"){
             $('#noticed').hide()
             clearLoginStorage(/-login-clear/)
-			try{
-				$.cookie("userid_secure","",{expires:-1,path:"/",domain:document.domain.replace(/[^.]+/,"")});
-			}catch(e){
-				document.cookie = "userid_secure=;expires=-1;path=/";
-			}
-			window.location.href="/";
+			afterSignoutClearCookit();
+			// window.location.href="/";
             var pt = new RegExp("^/article/content/.+$|^/front/dataExport/.+$|^/front/course/codePay$|^/front/course/orderPay$|^/entpc/.+$|^/bid/pc/page/.+$");
             if(pt.test(window.location.pathname)){
                 window.location.href="/";
@@ -680,6 +696,14 @@ var signout = function(){
 	})
 }
 
+var afterSignoutClearCookit = function(){
+	try{
+		$.cookie("userid_secure","",{expires:-1,path:"/",domain:document.domain.replace(/[^.]+/,"")});
+	}catch(e){
+		document.cookie = "userid_secure=;expires=-1;path=/";
+	}
+}
+
 //查看用户是否已经登录
 var haslogin = function(num,kyorpn,url){
 	mynum = num;//页面logid
@@ -687,6 +711,11 @@ var haslogin = function(num,kyorpn,url){
 	thurl = url;//列表也跳转快照页url
 	$.post("/front/hasSign",function(data, location){
 		if(data){
+			if(data.resetpwd){
+				afterSignoutClearCookit();
+			    window.location.href = "/?nol=2";
+				return;
+			}
 			loginflag = true;
 			encryptId = data.encryptId
 			if(data.s_nickname!=null&&data.s_nickname.length>11){
@@ -773,7 +802,7 @@ var haslogin = function(num,kyorpn,url){
 			loginBtnType();
 			//pc限制登陆
 			var nosess = getParam("nol");
-			if (nosess=="1"&& (!loginflag) ){
+			if (nosess!=null && (!loginflag)){
 			    openLoginDig();
 			}
 		}
@@ -964,6 +993,10 @@ $(function(){
                     e.setAttribute('data-loading', 'false')
                     if (r && r.error_code > -1) {
                         if(r.data.state==1){
+                            var backToUrl = getParam('backTo')
+                            if (backToUrl) {
+                              return location.replace(decodeURIComponent(backToUrl))
+                            }
                             if (isBindPage) {
                               if (history.length === 1) {
                                 goBackOrigin()

+ 12 - 6
src/web/staticres/js/pur-search-index-pc.js

@@ -534,7 +534,7 @@ var vm = new Vue({
             this.selectName = arr1
             this.selectIndustry = arr2
             this.selectId = arr3
-            console.info(this.selectName, this.claimcheckName)
+            // console.info(this.attentionName, this.claimcheckName)
             var tempArray1 = this.arrDefault(this.selectName, this.attentionName)
             var tempArray2 = this.arrDefault(this.selectName, this.claimcheckName)
             if (tempArray1.length == 0) {
@@ -586,12 +586,14 @@ var vm = new Vue({
                 contentType:'application/json;charset=utf-8',
                 success: function (res) {
                     if (res.data.names) {
-                        // this.claimcheckName = res.data.names
+                      this.claimcheckName = []
+                      res.data.names.forEach(s => {
+                        this.claimcheckName.push(s.split(',')[0])
+                      })
                     }
                     arrs.forEach(v => {
                       let renName = res.data.names.join(',')
                       res.data.names.forEach(s => {
-                        this.claimcheckName.push(s.split(',')[0])
                         if (renName.indexOf(v.Buyer) > -1) {
                           v.claim1 = true
                           if (s.split(',')[0] == v.Buyer) {
@@ -628,7 +630,7 @@ var vm = new Vue({
                     D: per ? str : item.claim1,
                 }
             }
-            console.info(obj)
+            // console.info(obj)
             $.ajax({
                 url: '/entnicheNew/customer/attention',
                 method: 'POST',
@@ -662,6 +664,7 @@ var vm = new Vue({
                       this.follow = false
                       this.claim = false
                       $('.custom-checkbox').prop('checked', false)
+                      _this.selectName = []
                       _this.getList(_this.listState.pageNum)
                     }
                 }.bind(this)
@@ -992,6 +995,7 @@ var vm = new Vue({
                 $('.tag-labels').empty()
                 $('.clear-input').val('')
                 $('.tags-list').find('.tags-item').removeClass('tags-active')
+                $('.tags-list').find('.disabled').removeClass('disabled')
                 $('.tag-placeholder').show()
               })
             })
@@ -1083,11 +1087,13 @@ var vm = new Vue({
                 dataType: 'json',
                 success: function (r) {
                   if (r.error_code == 0 && r.data) {
-                    $('.tags-box').slideToggle()
-                    _this.getList(_this.listState.pageNum)
                     _this.follow = false
                     _this.claim = false
                     $('.custom-checkbox').prop('checked', false)
+                    _this.selectName = []
+                    _this.claimcheckName = []
+                    _this.getList(_this.listState.pageNum)
+                    $('.tags-list').find('.disabled').removeClass('disabled')
                     toastFn('认领成功!', 1000)
                     _this.$emit('updatelist', true)
                     callback && callback()

+ 4 - 3
src/web/staticres/public-pc/js/article-content.js

@@ -1150,7 +1150,7 @@ $(function(){
         $(".pdf-div").html(pdfshow);
         var pdfhtml = "";
         pdfhtml = '<div class="preb-encont"><div style="float:left;"><img src="'+goTemplateData.cdn+'/images/wx/pdf.png"/></div><div style="float:left;line-height: 22px;">'+arr["filename"]+'<br><a style="color:blue;" href="'+arr["url"]+'">下载</a></div><div style="clear:both;"></div></div>';
-        PDFObject.embed(arr["url"], "#preb-pdf"+j);
+        //PDFObject.embed(arr["url"], "#preb-pdf"+j);
       }
       //}
       $(".preb-enclosure").append(pdfhtml)
@@ -2388,9 +2388,10 @@ function getClaimStatus() {
                 })
                 var params = {
                   name: goTemplateData.params.obj.buyer,
-                mold: 1,
+                  mold: 1,
                   D: false,
-                  label: lidArr.toString()
+                  label: lidArr.toString(),
+                  industry: goTemplateData.params.obj.buyerclass
               }
                 console.log(params)
                 // 执行保存绑定标签操作

+ 118 - 0
src/web/templates/frontRouter/pc/entpc/sess/index.html

@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>商机管理_剑鱼标讯,全行业招标信息智能推送领导者</title>
+    <meta content="IE=edge,Chrome=1" http-equiv="X-UA-Compatible"/>
+    <meta content="招标订阅,招标项目,中标项目,招标信息,剑鱼标讯" name="Keywords"/>
+    <meta content="使用剑鱼标讯,可以精准匹配招标信息,只需要微信关注剑鱼标讯公众号,然后自行设定所关注的招标关键词和地区,满足订阅需求的招标信息就会在两个小时内自动推送。" name="Description"/>
+    <meta content="webkit" name="renderer">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta content="商机管理" theme="light" name="enable-header">
+    {{include "/common/pnc.html"}}
+    <link href='{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/reset_pc.css' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}' rel="stylesheet"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <!-- S-注入  -->
+
+    <meta name="importmap-type" content="systemjs-importmap">
+    <script>
+      if (String.prototype.startsWith === 'undefined') {
+        String.prototype.startsWith = function (str) {
+          if(str==null||str==""||this.length==0||str.length>this.length)
+            return false;
+          if(this.substr(0,str.length)==str)
+            return true;
+          else
+            return false;
+        }
+      }
+      if (typeof Promise === 'undefined')
+        document.write('<script src="https://cdn-common.jianyu360.com/cdn/lib/bluebird/3.7.2/js/browser/bluebird.core.min.js"><\/script>');
+      if (typeof fetch === 'undefined')
+        document.write('<script src="//cdn-common.jianyu360.com/cdn/lib/whatwg-fetch/3.4.1/dist/fetch.umd.min.js"><\/script>');
+    </script>
+    <script type="systemjs-importmap" crossorigin="anonymous">
+      {
+        "imports": {
+          "entpc": "/page_entpc/js/app.js?v={{Msg "seo" "entniche_v"}}",
+          "single-spa": "https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js",
+          "vue": "https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js",
+          "vue-router": "https://cdn-common.jianyu360.com/cdn/lib/vue-router/3.0.7/dist/vue-router.min.js"
+        }
+      }
+    </script>
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js" as="script" crossorigin="anonymous" />
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js" as="script" crossorigin="anonymous" />
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/import-map-overrides/2.2.0/dist/import-map-overrides.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/system.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/amd.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-exports.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-register.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/use-default.min.js"></script>
+    <!-- E-注入  -->
+
+    <style>
+        #public-nav {
+            border-bottom: 1px solid #e0e0e0;
+            background: #fff;
+        }
+        .page--entpc--index .page-container {
+            min-height: calc(100vh - 364px);
+            padding-top: 64px;
+            box-sizing: border-box;
+        }
+        .page--entpc--index .w-box .w1200 {
+            width: 1200px;
+            margin: 0 auto;
+            min-width: 1200px;
+        }
+    </style>
+</head>
+<body class="page--entpc--index">
+{{include "/common/pchead.html"}}
+<!-- S-注入  -->
+<div class="w-box page-container">
+    <div>
+        <div id="single-spa-app"></div>
+    </div>
+</div>
+<!-- See https://github.com/joeldenning/import-map-overrides#user-interface  -->
+<import-map-overrides-full show-when-local-storage="overrides-ui"></import-map-overrides-full>
+<!-- E-注入  -->
+<script>
+  (function() {
+    Promise.all([System.import('single-spa'), System.import('vue'), System.import('vue-router')]).then(function (modules) {
+      var singleSpa = modules[0];
+      var Vue = modules[1];
+      var VueRouter = modules[2];
+
+      Vue.use(VueRouter)
+
+      singleSpa.registerApplication(
+        'entpc',
+        function() {
+          return System.import('entpc')
+        },
+        function (location) {
+          return true
+        }
+      )
+
+      singleSpa.start();
+    })
+  })()
+</script>
+<script src='{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script src='{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script>
+    $(function () {
+      haslogin({{.T.logid}});
+    })
+</script>
+<!--S-百度统计-->
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<!--E-百度统计-->
+</body>
+</html>

+ 118 - 0
src/web/templates/frontRouter/pc/page_entbase_pc/sess/index.html

@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>商机管理_剑鱼标讯,全行业招标信息智能推送领导者</title>
+    <meta content="IE=edge,Chrome=1" http-equiv="X-UA-Compatible"/>
+    <meta content="招标订阅,招标项目,中标项目,招标信息,剑鱼标讯" name="Keywords"/>
+    <meta content="使用剑鱼标讯,可以精准匹配招标信息,只需要微信关注剑鱼标讯公众号,然后自行设定所关注的招标关键词和地区,满足订阅需求的招标信息就会在两个小时内自动推送。" name="Description"/>
+    <meta content="webkit" name="renderer">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta content="企业基础架构" theme="light" name="enable-header">
+    {{include "/common/pnc.html"}}
+    <link href='{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/reset_pc.css' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}' rel="stylesheet"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <!-- S-注入  -->
+
+    <meta name="importmap-type" content="systemjs-importmap">
+    <script>
+      if (String.prototype.startsWith === 'undefined') {
+        String.prototype.startsWith = function (str) {
+          if(str==null||str==""||this.length==0||str.length>this.length)
+            return false;
+          if(this.substr(0,str.length)==str)
+            return true;
+          else
+            return false;
+        }
+      }
+      if (typeof Promise === 'undefined')
+        document.write('<script src="https://cdn-common.jianyu360.com/cdn/lib/bluebird/3.7.2/js/browser/bluebird.core.min.js"><\/script>');
+      if (typeof fetch === 'undefined')
+        document.write('<script src="//cdn-common.jianyu360.com/cdn/lib/whatwg-fetch/3.4.1/dist/fetch.umd.min.js"><\/script>');
+    </script>
+    <script type="systemjs-importmap" crossorigin="anonymous">
+      {
+        "imports": {
+          "app": "/page_entbase_pc/js/app.js?v={{Msg "seo" "entbase_v"}}",
+          "single-spa": "https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js",
+          "vue": "https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js",
+          "vue-router": "https://cdn-common.jianyu360.com/cdn/lib/vue-router/3.0.7/dist/vue-router.min.js"
+        }
+      }
+    </script>
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/single-spa/4.3.7/lib/system/single-spa.min.js" as="script" crossorigin="anonymous" />
+    <link rel="preload" href="https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js" as="script" crossorigin="anonymous" />
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/import-map-overrides/2.2.0/dist/import-map-overrides.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/system.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/amd.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-exports.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/named-register.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/systemjs/6.8.3/dist/extras/use-default.min.js"></script>
+    <!-- E-注入  -->
+
+    <style>
+        #public-nav {
+            border-bottom: 1px solid #e0e0e0;
+            background: #fff;
+        }
+        .page--entpc--index .page-container {
+            min-height: calc(100vh - 364px);
+            padding-top: 64px;
+            box-sizing: border-box;
+        }
+        .page--entpc--index .w-box .w1200 {
+            width: 1200px;
+            margin: 0 auto;
+            min-width: 1200px;
+        }
+    </style>
+</head>
+<body class="page--entpc--index">
+{{include "/common/pchead.html"}}
+<!-- S-注入  -->
+<div class="w-box page-container">
+    <div>
+        <div id="single-spa-app"></div>
+    </div>
+</div>
+<!-- See https://github.com/joeldenning/import-map-overrides#user-interface  -->
+<import-map-overrides-full show-when-local-storage="overrides-ui"></import-map-overrides-full>
+<!-- E-注入  -->
+<script>
+  (function() {
+    Promise.all([System.import('single-spa'), System.import('vue'), System.import('vue-router')]).then(function (modules) {
+      var singleSpa = modules[0];
+      var Vue = modules[1];
+      var VueRouter = modules[2];
+
+      Vue.use(VueRouter)
+
+      singleSpa.registerApplication(
+        'app',
+        function() {
+          return System.import('app')
+        },
+        function (location) {
+          return true
+        }
+      )
+
+      singleSpa.start();
+    })
+  })()
+</script>
+<script src='{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script src='{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script>
+    $(function () {
+      haslogin({{.T.logid}});
+    })
+</script>
+<!--S-百度统计-->
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<!--E-百度统计-->
+</body>
+</html>

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

@@ -359,10 +359,12 @@
               type:'POST',
               url:'/entnicheNew/buy/whetherbuy',
               success:function (res) {
-                if (res.data.isNew) {
-                  $('#buyUnits').css('display', 'inline-block')
-                } else {
-                  $('#buyUnits').css('display', 'none')
+                if (res.data){
+                  if (res.data.isNew) {
+                    $('#buyUnits').css('display', 'inline-block')
+                  } else {
+                    $('#buyUnits').css('display', 'none')
+                  }
                 }
               }
           })

+ 1 - 0
src/web/templates/weixin/orgStructure/invitationPage.html

@@ -0,0 +1 @@
+<!--#组织结构优化-邀请用户加入部门页面-->