浏览代码

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

# Conflicts:
#	src/go.mod
#	src/go.sum
#	src/jfw/active/live.go
#	src/jfw/filter/pcUserSalesFilter.go
#	src/jfw/filter/wxUserSalesFilter.go
#	src/jfw/front/dataExport.go
#	src/jfw/front/front.go
#	src/jfw/front/login.go
#	src/jfw/front/swordfish.go
#	src/jfw/modules/app/src/app/filter/phonefilter.go
#	src/jfw/modules/app/src/app/front/login.go
#	src/jfw/modules/app/src/app/front/swordfish.go
#	src/jfw/modules/app/src/app/front/ws_dataExport.go
#	src/jfw/modules/app/src/go.mod
#	src/jfw/modules/app/src/go.sum
#	src/jfw/modules/bigmember/src/go.mod
#	src/jfw/modules/bigmember/src/go.sum
#	src/jfw/modules/bigmember/src/service/use/use.go
#	src/jfw/modules/publicapply/src/config/config.go
#	src/jfw/modules/publicapply/src/go.mod
#	src/jfw/modules/publicapply/src/go.sum
WH01243 2 年之前
父节点
当前提交
863b8fd8a3
共有 86 个文件被更改,包括 10356 次插入2914 次删除
  1. 334 0
      src/config.json
  2. 2 1
      src/config.yaml
  3. 3 1
      src/go.mod
  4. 9 0
      src/go.sum
  5. 1 1
      src/jfw/active/active_future.go
  6. 1 1
      src/jfw/active/active_seal.go
  7. 76 0
      src/jfw/active/live.go
  8. 5 1
      src/jfw/config/config.go
  9. 2 10
      src/jfw/filter/filter.go
  10. 2 2
      src/jfw/filter/mergefilter.go
  11. 35 31
      src/jfw/filter/pcUserSalesFilter.go
  12. 4 3
      src/jfw/filter/pcfilter.go
  13. 1 1
      src/jfw/filter/phonefilter.go
  14. 3 0
      src/jfw/filter/wxUserSalesFilter.go
  15. 1 1
      src/jfw/front/applysub.go
  16. 1 1
      src/jfw/front/commonPayWx.go
  17. 4 4
      src/jfw/front/distribution.go
  18. 1 1
      src/jfw/front/follow.go
  19. 1 1
      src/jfw/front/frontRouter.go
  20. 304 303
      src/jfw/front/login.go
  21. 2 2
      src/jfw/front/org_structure.go
  22. 1 1
      src/jfw/front/pchelper.go
  23. 857 0
      src/jfw/front/searchOptimize.go
  24. 15 3
      src/jfw/front/shorturl.go
  25. 153 141
      src/jfw/front/supsearch.go
  26. 1226 1097
      src/jfw/front/swordfish.go
  27. 6 6
      src/jfw/front/vipsubscribe.go
  28. 1 1
      src/jfw/front/websocket.go
  29. 26 20
      src/jfw/front/ws_dataExport.go
  30. 4 3
      src/jfw/front/wxMyOrder.go
  31. 2 10
      src/jfw/modules/app/src/app/filter/filter.go
  32. 1 1
      src/jfw/modules/app/src/app/filter/mergefilter.go
  33. 1 1
      src/jfw/modules/app/src/app/filter/phonefilter.go
  34. 40 44
      src/jfw/modules/app/src/app/front/login.go
  35. 508 482
      src/jfw/modules/app/src/app/front/swordfish.go
  36. 2 1
      src/jfw/modules/app/src/config.yaml
  37. 1 1
      src/jfw/modules/app/src/go.mod
  38. 2 2
      src/jfw/modules/app/src/go.sum
  39. 4 1
      src/jfw/modules/app/src/jfw/config/config.go
  40. 2 1
      src/jfw/modules/bigmember/src/config.json
  41. 1 0
      src/jfw/modules/bigmember/src/config/config.go
  42. 1 1
      src/jfw/modules/bigmember/src/go.mod
  43. 2 2
      src/jfw/modules/bigmember/src/go.sum
  44. 10 5
      src/jfw/modules/bigmember/src/service/push/push.go
  45. 1 1
      src/jfw/modules/bigmember/src/service/subscribe/subscribe.go
  46. 152 30
      src/jfw/modules/bigmember/src/service/use/use.go
  47. 601 0
      src/jfw/modules/common/src/qfw/util/bidsearch/search.go
  48. 1218 0
      src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go
  49. 343 0
      src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go
  50. 478 0
      src/jfw/modules/common/src/qfw/util/jy/jy.go
  51. 188 0
      src/jfw/modules/common/src/qfw/util/jy/payUser.go
  52. 0 1
      src/jfw/modules/publicapply/src/attachmentdow/service/service.go
  53. 2 1
      src/jfw/modules/publicapply/src/config.yaml
  54. 11 8
      src/jfw/modules/publicapply/src/config/config.go
  55. 2 10
      src/jfw/modules/publicapply/src/filter/sessionfilter.go
  56. 1 1
      src/jfw/modules/publicapply/src/go.mod
  57. 2 2
      src/jfw/modules/publicapply/src/go.sum
  58. 13 12
      src/jfw/modules/publicapply/src/userbase/entity/entity.go
  59. 4 3
      src/jfw/modules/subscribepay/src/filter/mergefilter.go
  60. 231 0
      src/jfw/public/dataexport.go
  61. 465 35
      src/web/staticres/css/dev2/biddingSearch.css
  62. 21 1
      src/web/staticres/css/dev2/newBidSearch.css
  63. 5 1
      src/web/staticres/css/dev2/superSearch-inside.css
  64. 26 8
      src/web/staticres/css/dev2/superSearch.css
  65. 29 20
      src/web/staticres/css/pc/index.css
  66. 二进制
      src/web/staticres/images/biddingSearch/bidding-search.png
  67. 二进制
      src/web/staticres/images/biddingSearch/tab-icon5.png
  68. 二进制
      src/web/staticres/images/biddingSearch/tab-icon6.png
  69. 二进制
      src/web/staticres/images/pc/icon_voice.png
  70. 181 4
      src/web/staticres/js/common.js
  71. 25 4
      src/web/staticres/js/ent-search-index-pc.js
  72. 8 3
      src/web/staticres/js/login.js
  73. 1 1
      src/web/staticres/js/pc-message-index.js
  74. 18 0
      src/web/staticres/js/pur-search-index-pc.js
  75. 85 0
      src/web/staticres/js/selector/keyword-tags.js
  76. 1660 0
      src/web/staticres/js/superSearch copy.js
  77. 287 306
      src/web/staticres/js/superSearch.js
  78. 42 9
      src/web/staticres/pccss/ent-search-index-pc.css
  79. 40 7
      src/web/staticres/pccss/pur-search-index-pc.css
  80. 1 0
      src/web/staticres/public-pc/css/sub-page.css
  81. 7 6
      src/web/staticres/serviceSystem/css/serviceSystem.css
  82. 61 61
      src/web/templates/frontRouter/pc/serviceSystem/free/index.html
  83. 9 3
      src/web/templates/pc/entsearchindex.html
  84. 12 8
      src/web/templates/pc/index.html
  85. 11 5
      src/web/templates/pc/pursearchindex.html
  86. 457 174
      src/web/templates/pc/supsearch.html

+ 334 - 0
src/config.json

@@ -1,4 +1,5 @@
 {
+<<<<<<< HEAD
   "nodeName": "node1",
   "qrModelID": "2",
   "numTimeNumber": 15,
@@ -67,6 +68,68 @@
     "jy_extend": {
       "activitystartcode": "3202100000",
       "activityendcode": "3202199999"
+=======
+    "nodeName":"node1",
+    "qrModelID": "2",
+    "numTimeNumber": 15,
+    "strTimeNumber": 30,
+    "webport": "83",
+    "webrpcport": "8084",
+    "weixinrpc": "127.0.0.1:8083",
+    "cacheflag": false,
+    "agreement": "http",
+    "webdomain": "https://web-ws.jydev.jianyu360.com",
+    "redirect": {
+        "searchinfo": "/jylab/mainSearch?msg=0",
+        "rssset": "/swordfish/newhistorypush?msg=1",
+        "viewdemo": "/front/viewdemo",
+        "wxpushlist": "/wxpush/bidinfo/%s",
+        "share": "/swordfish/guide/share",
+        "myfollow": "/follow/list",
+        "newInfoFollow": "/jylab/followent/newInfo/%s",
+        "entListFollow": "/jylab/followent/entList",
+        "pcmyfollow": "/follow/set/list/%s",
+        "feedback": "/swordfish/feedback",
+        "wxpushfollowlist": "/follow/notice/%s/%s?advertcode=%s",
+        "community": "http://www.myfans.cc/30a78e9b78",
+        "quickly": "http://mp.weixin.qq.com/s?__biz=MzIyNTM1NDUyNw==&mid=100000001&idx=1&sn=58e6008f0577d529a56c9ed78724decf&scene=0#wechat_redirect",
+        "useskill": "http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=1&sn=f9e98da1975f85011ee138a4ee5cfbe8#wechat_redirect",
+        "about": "/swordfish/about?flag=1",
+        "followset": "/follow/set/%s/%s?advertcode=%s",
+        "myfeedbacks": "/swordfish/myFeedbacks",
+        "zqluckdraw": "/active/zqLuckdraw",
+        "followent": "/jylab/followent/entList",
+        "labindex": "/jylab/index",
+        "qrToLab": "/jylab/qrToLab/%s",
+        "searchKeyword": "/jylab/searchKeyword/%s",
+        "sealRep": "/active/sealfriends/%s",
+        "sealIndex": "/active/seal/index",
+        "sealSend": "/active/seal/sealMsg",
+        "futureIndex": "/active/future/index",
+        "keysetIndex": "/wxkeyset/keyset/index?tiptext=%s",
+        "followEntDetail": "/jylab/followent/detail/%s?advertcode=%s",
+        "mymenu": "/front/wxMyOrder/myMenu?msg=4",
+		"historypush": "/swordfish/newhistorypush?times=%s&advertcode=%s&msg=1",
+		"msgremind": "/front/vipsubscribe/msgremind?%s",
+		"treasurebox":"/jyTreasureBox/treasureBox?msg=3",
+		"vipreport":"/subscribepay/report/wxtplmsg?start=%s&end=%s&pushcount=%s&advertcode=%s",
+		"viphomepage":"/front/vipsubscribe/introducePage?advertcode=%s",
+		"viphomepage_new":"/jy_mobile/common/order/create/svip?type=buy",
+		"liveAcitve":"/active/livePage/index",
+		"bigMember":"/big/wx/page/landingPage",
+		"structed":"/front/structed/index?p=wx",
+		"digitalExpo":"/active/digital/index",
+		"docsMobile":"/page_docs_mobile/home",
+		"pointsMobile":"/page_points_mobile/home",
+		"bidedoc":"/weixin/frontPage/bidedoc/sess/index",
+		"memberreport_experience":"/bigmember/report/openpushmsg?t=wx_experience&start=%s&end=%s&pushcount=%s&advertcode=%s",
+		"chanpartner":"/weixin/frontPage/partner/sess/partner?p=wxmeun",
+		"datareport":"/datareport/page/order/detail/%s?advertcode=%s",
+		"vipFree7":"/weixin/frontPage/share/sess/index?p=wxmeun",
+		"toSubVipSetPage":"/front/vipsubscribe/toSubVipSetPage?advertcode=%s",
+		"followProjectList":"/big/wx/page/pro_follow_list?advertcode=%s",
+		"followProjectSet": "/big/wx/page/pro_follow_detail?fid=%s&sid=%s&advertcode=%s"
+>>>>>>> master
     },
     "jy_leaflets": {
       "activitystartcode": "3202200000",
@@ -157,6 +220,7 @@
         "field": "buyertel"
       }
     ],
+<<<<<<< HEAD
     "其他": [
       {
         "proportion": 8,
@@ -380,4 +444,274 @@
     "winnerMap": true
   },
   "keywordsLimitNologin": 25
+=======
+    "recoveryField": {
+        "招标": [
+            {
+                "proportion": 15,
+                "field": "projectname"
+            },
+            {
+                "proportion": 5,
+                "field": "budget"
+            },
+            {
+                "proportion": 15,
+                "field": "buyer"
+            },
+            {
+                "proportion": 5,
+                "field": "agency"
+            },
+            {
+                "proportion": 15,
+                "field": "winner"
+            },
+            {
+                "proportion": 15,
+                "field": "bidopentime"
+            },
+            {
+                "proportion": 15,
+                "field": "buyerperson"
+            },
+            {
+                "proportion": 15,
+                "field": "buyertel"
+            }
+        ],
+        "其他": [
+            {
+                "proportion": 8,
+                "field": "projectname"
+            },
+            {
+                "proportion": 12,
+                "field": "budget"
+            },
+            {
+                "proportion": 8,
+                "field": "buyer"
+            },
+            {
+                "proportion": 12,
+                "field": "agency"
+            },
+            {
+                "proportion": 12,
+                "field": "winner"
+            },
+            {
+                "proportion": 12,
+                "field": "bidamount"
+            },
+            {
+                "proportion": 12,
+                "field": "bidopentime"
+            },
+            {
+                "proportion": 12,
+                "field": "buyerperson"
+            },
+            {
+                "proportion": 12,
+                "field": "buyertel"
+            }
+        ]
+    },
+    "advertImg": "/images/advert.png",
+    "advertName": "广告",
+    "advertUrl": "/swordfish/about",
+    "wxJianyu": {
+        "appid": "wxdedd73f450993685",
+        "appsecret": "d55898fde0b7887e5fe4660bd2494700"
+    },
+    "industry": "行业分类",
+    "recommendEntLimit": "50",
+    "jyapp": {
+        "domain": "https://web-jydev-wcj.jianyu360.cn",
+        "apkurl": "/jyinstallpkg/mobile/%s/jianyu360.apk",
+        "appstoreurl": "https://itunes.apple.com/cn/app/id1354897149",
+        "channelDir": {
+            "s001": "baiduSem",
+            "s003": "shenmaSem",
+            "huawei": "huawei",
+            "xiaomi": "xiaomi",
+            "yingyongbao": "yingyongbao",
+            "douyin": "douyin",
+            "wx01": "jywx",
+            "topnet": "topnet",
+            "duanxin": "duanxin",
+			"active_pullnew": "active_pullnew",
+            "default": "topnet"
+        }
+    },
+    "limitSearchText": {
+        "flag": true,
+        "count": 40,
+        "timeout": 60,
+        "totalPage": 10,
+        "percentage":80,
+        "userIds": [
+        ],
+        "msg": "f 开关状态:%s //-2 从配置文件重置,-1 关闭,1 打开<br><br>c 并发数:%d //-2 不限制并发数,-1 无条件直接限制,>0 限制并发数<br><br>t 个人查询限制时间:%ds //-1 不限制<br><br>p 限制页数:%d",
+        "limitKey":"pc_limit_%s",
+        "noLogin":40
+    },
+    "share": {
+        "forceShareEnabled": false,
+        "onlineDate": "2018-08-20 00:00:00",
+        "regDaysForNewUser": 5,
+        "shareIntervalDays": 7,
+        "startHour": 8,
+        "endHour": 17,
+        "shareTimesUpperLimitR": 4000,
+        "shareTimesUpperLimitIrr": 1000
+    },
+    "cookiedomain": ".jydev.jianyu360.com",
+    "pcHelper": {
+        "subscribeTokenTimeout": 15,
+        "version": "V2.5.1"
+    },
+    "mail": [
+        {
+            "addr": "smtp.exmail.qq.com",
+            "port": 465,
+            "pwd": "ue9Rg9Sf4CVtdm5a",
+            "user": "public03@topnet.net.cn"
+        },
+        {
+            "addr": "smtp.exmail.qq.com",
+            "port": 465,
+            "pwd": "ue9Rg9Sf4CVtdm5a",
+            "user": "public03@topnet.net.cn"
+        }
+    ],
+    "sealAmount": {
+        "销冠王": "30000",
+        "全才": "30000",
+        "社交红人": "30000",
+        "灵魂人物": "30000",
+        "有态度": "20000",
+        "钢铁意志": "20000",
+        "机敏过人": "20000",
+        "行动派": "20000",
+        "细节控": "20000",
+        "神队友": "20000",
+        "业务666": "20000",
+        "靠谱": "20000",
+        "情商贼高": "10000",
+        "嘴皮子溜": "10000",
+        "脑洞倍儿大": "10000",
+        "靠实力说话": "10000"
+    },
+    "makepicurl": "http://39.105.183.186:11120",
+    "intranetip": {
+        "jy": "http://webxzh.qmx.top"
+    },
+    "getpicurl": "https://res.jianyu360.com/",
+    "sealSendTime": 14400,
+    "appPushServiceRpc": "192.168.20.139:5566",
+    "openPlatformUrl": "https://open-jytest.jianyu360.cn/",
+    "sessionEnctryFlushCorn": "0 0 0 1 * ?",
+    "PCS_time":24,
+    "detail_element":["table","div"],
+	  "termValidity":3600,
+    "uploadPath": "./web/staticres/upload/res/",
+    "redisSessionLockSize":20,
+    "accountMergeOnline":"2015-03-30 00:00:00",
+    "bidSearchOldUserLimit": 1626105600,
+    "contextOldVipLimit": 1664553600,
+    "firstBindPop":3,
+    "maxBindPop":111111111111115,
+    "nsq":"192.168.3.240:4260",
+    "nsq_topic": "jy_event",
+    "bindPopRedis":"merge",
+    "phoneFilterFlag":true,
+    "pcindexCacheTime":7200,
+    "pcIndexHotCacheTime":129600,
+    "pcindexCacheKey":"jypcindex3",
+    "dedupUrl":  "http://127.0.0.1:8888/data/deduplication",
+    "bmwxrcoll":"drainage_wxreply_log",
+    "optimalTime":"2021-08-03 12:00:00",
+    "pcFilterFlag":true,
+    "pcSessionFlag":true,
+    "sessionTimeout":168,
+    "pcSessionTimeout":168,
+    "shareRedisName":"other",
+    "wxWebdomain": "https://web-wky.jydev.jianyu360.com",
+    "wxOrgUrl": "/page_entbase_mobile/page/invite/inviting.html",
+    "pcOrgUrl":"/orgpc/inviting",
+    "criticality":2,
+    "indexcontentTimeOut":86400,
+    "seoBeforeTimeHour":12160,
+    "canReadNotice": 3,
+    "smsServiceRpc":"127.0.0.1:932",
+    "searchTypeSwitch": true,
+    "fileSignBool":true,
+    "baseUserFilterFlag":false,
+    "userCenterApi":"https://web-zxl.jydev.jianyu360.com",
+    "resourceCenter": "https://web-zxl.jydev.jianyu360.com",
+    "resourceCenterUrl": {
+	    "haspowers": "/resourceCenter/haspowers"
+	},
+	"keywordsLimit":35,
+	"detailMosaicTxt":"略",
+  "needMosaic":{
+  "projectname":true,
+      "projectcode":true,
+      "budget":true,
+      "bidamount":true,
+      "buyer":true,
+      "buyerperson":true,
+      "buyertel":true,
+      "buyeraddr":true,
+      "agency":true,
+      "agencyperson":true,
+      "agencytel":true,
+      "agencyaddr":true,
+      "winner":true,
+      "s_winner":true,
+      "winnerperson":true,
+      "winnertel":true,
+      "winneraddr":true,
+      "docstarttime":true,
+      "docendtime":true,
+      "bidendtime":true,
+      "bidstarttime":true,
+      "bidopentime":true,
+      "bidopenaddress":true,
+      "contractcode":true,
+      "signaturedate":true,
+      "purchasinglist":true,
+      "item":true,
+      "purchasing":true,
+      "itemname":true,
+      "brandname":true,
+      "specs":true,
+      "model":true,
+      "unitname":true,
+      "dimensions":true,
+      "number":true,
+      "unitprice":true,
+      "totalprice":true,
+      "guaranteetime":true,
+      "orderno":true,
+      "procurementlist":true,
+      "projectscope":true,
+      "reserved_amount":true,
+      "expurasingtime":true,
+      "winnerMap":true
+  },
+  "keywordsLimitNologin":25,
+  "messageCenter": {
+    "appid": "10000",
+    "dbName": "messagetest",
+    "interval": 300,
+    "createtime": "2023-01-04 00:00:00",
+    "limitDay": 7,
+    "limitCount": 3
+  },
+  "workDesktopUrl":"/page_workDesktop/work-bench/page?aside=0&link="
+>>>>>>> master
 }

+ 2 - 1
src/config.yaml

@@ -3,4 +3,5 @@ etcd:
   - 127.0.0.1:2379
 userCenterKey: "usercenter.rpc" #用户中台rpc
 powerCheckCenterKey: "powercheck.rpc" #权益校验中台
-resourceCenterKey: "resource.rpc" #资源中台
+resourceCenterKey: "resource.rpc" #资源中台
+entManageApplication: "entmanageapplication.rpc" #企业管理中台

+ 3 - 1
src/go.mod

@@ -4,11 +4,12 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230129060002-f69424aa14ba
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0
 	github.com/fsnotify/fsnotify v1.6.0
+	github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6
 	github.com/gogf/gf/v2 v2.2.6
 	github.com/robfig/cron v1.2.0
 	go.mongodb.org/mongo-driver v1.11.1
@@ -54,6 +55,7 @@ require (
 	github.com/jinzhu/now v1.1.1 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
+	github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd // indirect
 	github.com/magiconair/properties v1.8.6 // indirect
 	github.com/mattn/go-colorable v0.1.9 // indirect
 	github.com/mattn/go-isatty v0.0.14 // indirect

+ 9 - 0
src/go.sum

@@ -13,8 +13,13 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
+<<<<<<< HEAD
 app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
 app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+=======
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+>>>>>>> origin/feature/v4.7.55
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -612,6 +617,8 @@ github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V
 github.com/go-xorm/builder v0.3.4/go.mod h1:KxkQkNN1DpPKTedxXyTQcmH+rXfvk4LZ9SOOBoZBAxw=
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
 github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ=
+github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6 h1:DUiWdm3rS8cC96Y0XeVkDeizzEK6X+qiNgXytLVtbkM=
+github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6/go.mod h1:lwPk13GS+i/NK4FkMm68IcJrAwiu+HtjYa1Y4kW59aY=
 github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0=
 github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY=
 github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg=
@@ -872,6 +879,8 @@ github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
 github.com/longbridgeapp/sqlparser v0.3.1/go.mod h1:GIHaUq8zvYyHLCLMJJykx1CdM6LHtkUih/QaJXySSx4=
+github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd h1:DXxmBCahjva4Ox4AWOv6pR1Csv33zSj97SaLOElfIsw=
+github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd/go.mod h1:3w9PScemEkJoLw3OYvLWMoD8XRCmXgGwsSpT6pFpJ0g=
 github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
 github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=

+ 1 - 1
src/jfw/active/active_future.go

@@ -39,7 +39,7 @@ func (a *Active) FutureIndex(share_openid string) error {
 				if code != "" {
 					openid = jyutil.Getopenid(code)
 					if openid != "" {
-						FindUserAndCreateSess(openid, a.Session(), "wx", false)
+						FindUserAndCreateSess(openid, a.Session(), "wx", false, true)
 					}
 				}
 			} else {

+ 1 - 1
src/jfw/active/active_seal.go

@@ -255,7 +255,7 @@ func (a *Active) Index() error {
 				if code != "" {
 					openid := jyutil.Getopenid(code)
 					if openid != "" {
-						FindUserAndCreateSess(openid, a.Session(), "wx", false)
+						FindUserAndCreateSess(openid, a.Session(), "wx", false, true)
 					}
 				}
 			} else {

+ 76 - 0
src/jfw/active/live.go

@@ -112,6 +112,7 @@ func (this *Active) SubStatus() error {
 
 //直播和预约活动 跳转分拨逻辑
 func (this *Active) LivePage() error {
+<<<<<<< HEAD
     defer util.Catch()
     checkIsSubscribeFlag := true
     openid, _ := this.Session().Get("s_m_openid").(string)
@@ -185,4 +186,79 @@ func (this *Active) LivePage() error {
         return this.Render("/active/livePage/live_preheat_wx.html", &this.T)
     }
     return nil
+=======
+	defer util.Catch()
+	checkIsSubscribeFlag := true
+	openid, _ := this.Session().Get("s_m_openid").(string)
+	if openid == "" {
+		if this.Session().Get("s_m_openid") == nil {
+			if this.GetString("state") == "wx" {
+				//微信跳回来的
+				code := this.GetString("code")
+				if code != "" {
+					openid = jyutil.Getopenid(code)
+					if openid != "" {
+						//是否为关注用户
+						checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
+						if checkIsSubscribeFlag {
+							//关注用户 建session
+							go FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
+						}
+					}
+				}
+			} else {
+				if public.CheckWxBrowser(this.Request) {
+					//所有参数都不再使用,跳到微信验证用户
+					return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
+				}
+			}
+		}
+		if this.Session().Get("s_m_openid") == nil {
+			checkIsSubscribeFlag = false
+		}
+	} else {
+		//是否为关注用户
+		checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
+	}
+	this.T["checkIsSubscribeFlag"] = checkIsSubscribeFlag
+	this.T["Live_Active_Start"] = config.ActiveConfig.Live_Active_Start   //直播活动开始时间
+	this.T["Live_Active_End"] = config.ActiveConfig.Live_Active_End       //直播活动结束时间
+	this.T["Live_Preheat_Start"] = config.ActiveConfig.Live_Preheat_Start //预热活动开始时间
+	this.T["Live_Preheat_End"] = config.ActiveConfig.Live_Preheat_End     //预热活动结束时间
+	this.T["LIVEING"] = false                                             //是否直播中
+	now := time.Now()
+	if now.Unix() > config.ActiveConfig.Live_After_Date { //直播活动结束超过提示时间  跳转到vip介绍页
+		return this.Redirect("/front/vipsubscribe/introducePage")
+	} else if now.Unix() > config.ActiveConfig.Live_Active_End { //直播活动结束 活动结束页
+		this.T["LIVEEND"] = true
+		return this.Render("/active/livePage/live_online_wx.html", &this.T)
+	} else if now.Unix() > config.ActiveConfig.Live_Active_Start { //直播活动进行中
+		if checkIsSubscribeFlag {
+			//是否是vip用户
+			userId, _ := this.Session().Get("userId").(string)
+			data, ok := public.MQFW.FindById("user", userId, nil)
+			if ok && data != nil && *data != nil {
+				this.T["isVip"] = util.IntAll((*data)["i_vip_status"]) > 0
+				this.T["isOnTail"] = util.IntAll((*data)["i_vip_status"]) == 1
+			}
+		}
+		//是否直播进行中
+		if config.ActiveConfig.Live_Ing_End > time.Now().Unix() && time.Now().Unix() > config.ActiveConfig.Live_Ing_Start {
+			this.T["LIVEING"] = true
+		}
+		return this.Render("/active/livePage/live_online_wx.html", &this.T)
+	} else if now.Unix() > config.ActiveConfig.Live_Preheat_Start { //预热活动进行中
+		userId, _ := this.Session().Get("userId").(string)
+		this.T["order_status"] = 0
+		if checkIsSubscribeFlag && userId != "" {
+			var query = map[string]interface{}{
+				"s_userid":   this.Session().Get("userId").(string),
+				"order_type": "wx", //微信预约
+			}
+			this.T["order_status"] = public.MQFW.Count(LiveOrder, query)
+		}
+		return this.Render("/active/livePage/live_preheat_wx.html", &this.T)
+	}
+	return nil
+>>>>>>> origin/feature/v4.7.55
 }

+ 5 - 1
src/jfw/config/config.go

@@ -52,5 +52,9 @@ func init() {
 	//PC端商机管理配置
 	util.ReadConfig("./entnichePc.json", &EntnichePcConf)
 	var ctx = gctx.New()
-	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).RegResourceCenter(g.Cfg().MustGet(ctx, "resourceCenterKey").String())
+	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
+		RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
+		RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
+		RegResourceCenter(g.Cfg().MustGet(ctx, "resourceCenterKey").String()).
+		RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String())
 }

+ 2 - 10
src/jfw/filter/filter.go

@@ -10,6 +10,7 @@ import (
 	util "app.yhyue.com/moapp/jybase/common"
 	fs "app.yhyue.com/moapp/jybase/fsnotify"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/identity"
 )
 
 var RouteConf struct {
@@ -42,16 +43,7 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 		session.Set("mgoUserId", getSession["userId"])
 	}
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
-		identity := Middleground.UserCenter.IdentityByUserId(util.Int64All(getSession["base_user_id"]))
-		if identity != nil {
-			session.SetMultiple(map[string]interface{}{
-				"personId":     identity.PersonId,
-				"userName":     identity.UserName,
-				"accountId":    identity.AccountId,
-				"positionId":   identity.PositionId,
-				"positionType": identity.PositionType,
-			})
-		}
+		identity.SwitchToBest(util.Int64All(getSession["base_user_id"]), session, Middleground)
 	}
 	if !(&logFilter{w, r, session, getSession, make(map[string]interface{})}).Do() {
 		return false

+ 2 - 2
src/jfw/filter/mergefilter.go

@@ -24,7 +24,7 @@ type mergeFilter struct {
 
 func (l *mergeFilter) Do() bool {
 
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
 			if sUid, ok := val.(string); sUid != "" && ok { //自动更新当前session为合并后账户
 				if _, sessionVal := jyutil.GetSessionVal(map[string]interface{}{"_id": mongodb.StringTOBsonId(sUid)}); len(sessionVal) > 0 {
@@ -47,7 +47,7 @@ func (l *mergeFilter) Do() bool {
 	}
 
 	//微信解绑-刷新session
-	if sod, uid := l.GetSession["s_m_openid"], l.GetSession["userId"]; sod != nil && sod != "" && uid != nil && uid != "" {
+	if sod, uid := l.GetSession["s_m_openid"], l.GetSession["mgoUserId"]; sod != nil && sod != "" && uid != nil && uid != "" {
 		if mergerTimeStamp := redis.GetStr("session", fmt.Sprintf("accountInfo_unbindWx_%s_%s", uid, sod)); mergerTimeStamp != "" {
 			//每个sessionid仅清除一次
 			if doOncekey := fmt.Sprintf("accountInfo_unbindWx_%s_%s_%s_%s", uid, sod, l.Session.Id(), mergerTimeStamp); redis.Get("session", doOncekey) == nil {

+ 35 - 31
src/jfw/filter/pcUserSalesFilter.go

@@ -1,45 +1,49 @@
 package filter
 
 import (
-    "app.yhyue.com/moapp/jypkg/public"
-    "jy/src/jfw/config"
-    "jy/src/jfw/jyutil"
-    "net/http"
-    "strings"
-    "time"
+	"app.yhyue.com/moapp/jypkg/public"
+	"jy/src/jfw/config"
+	"net/http"
+	"strings"
+	"time"
 
-    qu "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jypkg/public"
+
+	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 )
 
 type pcSalesFilter struct {
-    W          http.ResponseWriter
-    R          *http.Request
-    Session    *httpsession.Session
-    GetSession map[string]interface{}
+	W          http.ResponseWriter
+	R          *http.Request
+	Session    *httpsession.Session
+	GetSession map[string]interface{}
 }
 
 // pc新用户判断是否需要留资
 func (l *pcSalesFilter) Do() bool {
-    if !initflag {
-        return true
-    }
-    if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); !flag {
-        return true
-    }
-    if l.R.Method == "POST" {
-        return true
-    }
-    for _, v := range bindurl {
-        if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
-            return true
-        }
-    }
-    if userAgent := l.R.UserAgent(); mobileReg.MatchString(userAgent) || public.CheckWxBrowser(l.R) {
-        return true // 移动端 返回
-    }
-    //pc判断是否需要留资
-    href := "/swordfish/frontPage/user/sess/set_favorite" // pc端留资页面地址
+	if !initflag {
+		return true
+	}
+	if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); !flag {
+		return true
+	}
+	if l.R.Method == "POST" {
+		return true
+	}
+	for _, v := range bindurl {
+		if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
+			return true
+		}
+	}
+	if userAgent := l.R.UserAgent(); mobileReg.MatchString(userAgent) || public.CheckWxBrowser(l.R) {
+		return true // 移动端 返回
+	}
+	//pc判断是否需要留资
+	href := "/swordfish/frontPage/user/sess/set_favorite" // pc端留资页面地址
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
+		data, ok := public.MQFW.FindById("user", qu.InterfaceToStr(uid), `{"l_registedate":1,"app_first_login":1}`)
+		if ok && data != nil && len(*data) > 0 {
     if uid := l.GetSession["userId"]; uid != nil && uid != "" {
         data := jyutil.Compatible.Select(qu.InterfaceToStr(uid), `{"l_registedate":1,"app_first_login":1}`)
         if  data != nil && len(*data) > 0 {

+ 4 - 3
src/jfw/filter/pcfilter.go

@@ -4,12 +4,13 @@ import (
 	"fmt"
 	"jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
-	"app.yhyue.com/moapp/jypkg/public"
 	"net/http"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"strings"
 	"time"
 
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"app.yhyue.com/moapp/jypkg/public"
+
 	util "app.yhyue.com/moapp/jybase/common"
 
 	"app.yhyue.com/moapp/jybase/redis"
@@ -43,7 +44,7 @@ func (this *pcFilter) Do() bool {
 
 	href := "/?nol=1"
 	//对比session是否一致,不一致则清除掉sessionid
-	if uid := this.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := this.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		userid, _ := uid.(string)
 		sessid := fmt.Sprint(this.Session.Id())
 		//i_unlimited :登录限制

+ 1 - 1
src/jfw/filter/phonefilter.go

@@ -48,7 +48,7 @@ func (l *phoneFilter) Do() bool {
 	if qu.Int64All(l.GetSession["positionType"]) == 1 {
 		return true
 	}
-	userId, _ := l.GetSession["userId"].(string)
+	userId, _ := l.GetSession["mgoUserId"].(string)
 	// 请求过滤
 	pass := func() bool {
 		if !initflag || l.R.Method == "POST" || userId == "" {

+ 3 - 0
src/jfw/filter/wxUserSalesFilter.go

@@ -4,10 +4,13 @@ import (
     "app.yhyue.com/moapp/jypkg/public"
     "jy/src/jfw/config"
     "jy/src/jfw/jyutil"
+	"jy/src/jfw/config"
     "net/http"
     "strings"
     "time"
 
+	"app.yhyue.com/moapp/jypkg/public"
+
     qu "app.yhyue.com/moapp/jybase/common"
 
     "app.yhyue.com/moapp/jybase/go-xweb/httpsession"

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

@@ -204,7 +204,7 @@ func (a *Applysub) Index() error {
 			if code != "" {
 				openid = jyutil.Getopenid(code)
 				if openid != "" {
-					FindUserAndCreateSess(openid, a.Session(), "wx", false)
+					FindUserAndCreateSess(openid, a.Session(), "wx", false, true)
 				}
 			}
 		} else {

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

@@ -103,7 +103,7 @@ func (w *WxPayCommon) ToMyWxOrder() error {
 				openid := jyutil.Getopenid(code)
 				if openid != "" {
 					if CheckUserIsSubscribe(openid) {
-						FindUserAndCreateSess(openid, w.Session(), "wx", false)
+						FindUserAndCreateSess(openid, w.Session(), "wx", false, true)
 					}
 				}
 			}

+ 4 - 4
src/jfw/front/distribution.go

@@ -46,7 +46,7 @@ func (this *Distrib) LinkShare(discored string) error {
 					checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
 					if checkIsSubscribeFlag {
 						//关注用户 建session
-						FindUserAndCreateSess(openid, this.Session(), "wx", false)
+						FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
 					}
 				}
 			}
@@ -94,7 +94,7 @@ func (this *Distrib) LinkShareX(discored string) error {
 					checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
 					if checkIsSubscribeFlag {
 						//关注用户 建session
-						FindUserAndCreateSess(openid, this.Session(), "wx", false)
+						FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
 					}
 				}
 			}
@@ -141,7 +141,7 @@ func (this *Distrib) LinkShareG(discored string) error {
 					checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
 					if checkIsSubscribeFlag {
 						//关注用户 建session
-						FindUserAndCreateSess(openid, this.Session(), "wx", false)
+						FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
 					}
 				}
 			}
@@ -189,7 +189,7 @@ func (this *Distrib) LinkShareE(discored string) error {
 					checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
 					if checkIsSubscribeFlag {
 						//关注用户 建session
-						FindUserAndCreateSess(openid, this.Session(), "wx", false)
+						FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
 					}
 				}
 			}

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

@@ -1578,7 +1578,7 @@ func (this *Follow) FollowGift(shareid string) error {
 						openid = jyutil.Getopenid(code)
 						if openid != "" {
 							if CheckUserIsSubscribe(openid) {
-								FindUserAndCreateSess(openid, this.Session(), "wx", false)
+								FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
 							}
 						}
 					}

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

@@ -82,7 +82,7 @@ func (this *CommonRouter) WxCommonPage(folder, loginSign, htmlPage string) error
 				return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
 			}
 			openid = jyutil.Getopenid(this.GetString("code"))
-			if ok, _, _ := FindUserAndCreateSess(openid, this.Session(), "wx", false); !ok {
+			if ok, _, _ := FindUserAndCreateSess(openid, this.Session(), "wx", false, true); !ok {
 				return this.Redirect("/swordfish/about")
 			}
 		}

+ 304 - 303
src/jfw/front/login.go

@@ -1,360 +1,361 @@
 package front
 
 import (
-    "jy/src/jfw/config"
-    "jy/src/jfw/jyutil"
-    "log"
-    "regexp"
-    "strings"
-    "time"
+	"jy/src/jfw/config"
+	"log"
+	"regexp"
+	"strings"
+	"time"
 
-    "app.yhyue.com/moapp/jybase/usercenter"
+	"app.yhyue.com/moapp/jybase/usercenter"
 
-    "app.yhyue.com/moapp/jypkg/public"
+	"app.yhyue.com/moapp/jypkg/public"
 
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 
-    qutil "app.yhyue.com/moapp/jybase/common"
+	qutil "app.yhyue.com/moapp/jybase/common"
 
-    . "app.yhyue.com/moapp/jybase/mongodb"
+	. "app.yhyue.com/moapp/jybase/mongodb"
 
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-    "app.yhyue.com/moapp/jybase/go-xweb/xweb"
-    "github.com/dchest/captcha"
-    "go.mongodb.org/mongo-driver/bson/primitive"
+	"github.com/dchest/captcha"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
 type Login struct {
-    *xweb.Action
-    login     xweb.Mapper `xweb:"/phone/login"`     //登录
-    forgetPwd xweb.Mapper `xweb:"/phone/forgetPwd"` //忘记密码
-    register  xweb.Mapper `xweb:"/phone/register"`  //注册
-    phoneBind xweb.Mapper `xweb:"/phone/bind"`      //绑定手机号
+	*xweb.Action
+	login     xweb.Mapper `xweb:"/phone/login"`     //登录
+	forgetPwd xweb.Mapper `xweb:"/phone/forgetPwd"` //忘记密码
+	register  xweb.Mapper `xweb:"/phone/register"`  //注册
+	phoneBind xweb.Mapper `xweb:"/phone/bind"`      //绑定手机号
 }
 
 var (
-    passwordReg = regexp.MustCompile(".{6,}")
+	passwordReg = regexp.MustCompile(".{6,}")
 )
 
 func init() {
-    xweb.AddAction(&Login{})
+	xweb.AddAction(&Login{})
 }
 
 func (l *Login) PhoneBind() error {
-    userId := qutil.ObjToString(l.GetSession("userId"))
-    if userId == "" {
-        return l.Redirect("/notin/page")
-    }
-    return l.Render("/login/phoneBind.html", &l.T)
+	userId := qutil.ObjToString(l.GetSession("userId"))
+	if userId == "" {
+		return l.Redirect("/notin/page")
+	}
+	return l.Render("/login/phoneBind.html", &l.T)
 }
 
 func (l *Login) Login() error {
-    defer qutil.Catch()
-    result := map[string]interface{}{}
-    reqType := l.GetString("reqType")
-    status := func() int {
-        if reqType == "phoneLogin" {
-            phone := l.GetString("phone")
-            password := l.GetString("password")
-            if strings.TrimSpace(phone) == "" {
-                return -1
-            } else if strings.TrimSpace(password) == "" {
-                return -2
-            }
-            user, ok := mongodb.FindOneByField("user", map[string]interface{}{
-                "i_appid": 2,
-                "s_phone": phone,
-            }, `{"s_password":1}`)
-            if user != nil && len(*user) > 0  && ok{
-                if qutil.ObjToString((*user)["s_password"]) == qutil.GetMd5String(password) {
-                    ok, _, userInfo := afterLogin(phone, l.Session())
-                    if ok {
-                        result["userInfo"] = userInfo
-                        return 1
-                    }
-                } else {
-                    return -2
-                }
-            } else {
-                return -1
-            }
-        } else if reqType == "sendIdentCode" {
-            register := l.GetString("register")
-            phone := l.GetString("phone")
-            //注册页面添加校验
-            if register != "" && mongodb.Count("user", map[string]interface{}{
-                "i_appid": 2,
-                "s_phone": phone,
-            }) > 0 {
-                return -3
-            }
-            if !phoneReg.MatchString(phone) {
-                return -1
-            } else if tmp := l.GetSession("CheckCodeId"); tmp == nil || !captcha.VerifyString(tmp.(string), l.GetString("code")) {
-                return -2
-            } else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
-                return 1
-            }
-            return 0
-        } else if reqType == "identCodeLogin" {
-            phone, _ := l.GetSession("identCodeKey").(string)
-            if phone == "" || l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
-                return -1
-            } else {
-                //用户不存在
-                datas, _ := mongodb.Find("user", map[string]interface{}{
-                    "i_appid": 2,
-                    "$or": []map[string]interface{}{
-                        {"s_phone": phone},
-                        {"s_m_phone": phone},
-                    },
-                }, `{"s_phone":-1}`, `{"s_phone":1,"s_m_phone":1}`, false, 0, 1)
-                s_company := l.GetString("s_entname")
-                if datas == nil || len(*datas) == 0 { //不存在
-                    data := map[string]interface{}{
-                        "i_appid":       2,
-                        "s_phone":       phone,
-                        "s_password":    "",
-                        "l_registedate": time.Now().Unix(),
-                        "i_ts_guide":    2,
-                        "s_company":     s_company,
-                        "o_jy": map[string]interface{}{
-                            "i_apppush": 1,
-                            // "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
-                            "i_ratemode":   2,
-                            "l_modifydate": time.Now().Unix(),
-                        },
-                        "s_regsource": "pc",
-                        "s_platform":  "pc",
-                    }
-                    //注册邮箱
-                    email := l.GetString("email")
-                    if jy.IsEmail(email) {
-                        data["s_email"] = email
-                    }
-                    source := l.GetString("source") //用户手机号用户记录百度统计
-                    if ck, err := l.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
-                    }
-                    _id := mongodb.Save("user", data)
-                    if _id != "" {
-                        func(phone, userid string) {
-                            //用户中台存储  开始
-                            formdata := map[string]interface{}{
-                                "appid": "10000",
-                                "phone": phone,
-                            }
-                            if s_company != "" {
-                                formdata["company"] = s_company
-                            }
-                            ck, _ := l.GetCookie("SESSIONID")
-                            usercenter.AddBaseUser(mongodb, qutil.ObjToString(config.Sysconfig["userCenterApi"]), userid, formdata, ck)
-                            //用户中台存储  结束
-                        }(phone, _id)
-                        jy.ClearPhoneIdentSession(l.Session())
-                        ok, _, userInfo := afterLogin(phone, l.Session())
-                        nsqPath, _ := config.Sysconfig["nsq"].(string)
-                        nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
-                        er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2)
-                        if er != nil {
-                            log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
-                        }
-                        if ok {
-                            result["userInfo"] = userInfo
-                            return 1
-                        }
-                    }
-                } else {
-                    //存在
-                    //以s_m_phone登录的 需要把s_m_phone转化为s_phone
-                    updataMap := map[string]interface{}{}
-                    if s_company != "" {
-                        updataMap["s_company"] = s_company
-                    }
-                    if (*datas)[0]["s_m_phone"] != nil {
-                        updataMap["s_phone"] = phone
-                    }
-                    //注册邮箱
-                    email := l.GetString("email")
-                    if jy.IsEmail(email) {
-                        updataMap["s_email"] = email
-                    }
-                    if len(updataMap) > 0 {
-                        jyutil.Compatible.Update(BsonIdToSId((*datas)[0]["_id"]), map[string]interface{}{
-                            "$set":   updataMap,
-                            "$unset": map[string]interface{}{"s_m_phone": ""},
-                        })
-                    }
+	defer qutil.Catch()
+	result := map[string]interface{}{}
+	reqType := l.GetString("reqType")
+	status := func() int {
+		if reqType == "phoneLogin" {
+			phone := l.GetString("phone")
+			password := l.GetString("password")
+			if strings.TrimSpace(phone) == "" {
+				return -1
+			} else if strings.TrimSpace(password) == "" {
+				return -2
+			}
+			user, ok := mongodb.FindOneByField("user", map[string]interface{}{
+				"i_appid": 2,
+				"s_phone": phone,
+			}, `{"s_password":1}`)
+			if ok && user != nil && len(*user) > 0 {
+				if qutil.ObjToString((*user)["s_password"]) == qutil.GetMd5String(password) {
+					ok, _, userInfo := afterLogin(phone, l.Session())
+					if ok {
+						result["userInfo"] = userInfo
+						return 1
+					}
+				} else {
+					return -2
+				}
+			} else {
+				return -1
+			}
+		} else if reqType == "sendIdentCode" {
+			register := l.GetString("register")
+			phone := l.GetString("phone")
+			//注册页面添加校验
+			if register != "" && mongodb.Count("user", map[string]interface{}{
+				"i_appid": 2,
+				"s_phone": phone,
+			}) > 0 {
+				return -3
+			}
+			if !phoneReg.MatchString(phone) {
+				return -1
+			} else if tmp := l.GetSession("CheckCodeId"); tmp == nil || !captcha.VerifyString(tmp.(string), l.GetString("code")) {
+				return -2
+			} else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
+				return 1
+			}
+			return 0
+		} else if reqType == "identCodeLogin" {
+			phone, _ := l.GetSession("identCodeKey").(string)
+			if phone == "" || l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
+				return -1
+			} else {
+				//用户不存在
+				datas, _ := mongodb.Find("user", map[string]interface{}{
+					"i_appid": 2,
+					"$or": []map[string]interface{}{
+						{"s_phone": phone},
+						{"s_m_phone": phone},
+					},
+				}, `{"s_phone":-1}`, `{"s_phone":1,"s_m_phone":1}`, false, 0, 1)
+				s_company := l.GetString("s_entname")
+				if datas == nil || len(*datas) == 0 { //不存在
+					data := map[string]interface{}{
+						"i_appid":       2,
+						"s_phone":       phone,
+						"s_password":    "",
+						"l_registedate": time.Now().Unix(),
+						"i_ts_guide":    2,
+						"s_company":     s_company,
+						"o_jy": map[string]interface{}{
+							"i_apppush": 1,
+							// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+							"i_ratemode":   2,
+							"l_modifydate": time.Now().Unix(),
+						},
+						"s_regsource": "pc",
+						"s_platform":  "pc",
+					}
+					//注册邮箱
+					email := l.GetString("email")
+					if jy.IsEmail(email) {
+						data["s_email"] = email
+					}
+					source := l.GetString("source") //用户手机号用户记录百度统计
+					if ck, err := l.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
+					}
+					_id := mongodb.Save("user", data)
+					if _id != "" {
+						func(phone, userid string) {
+							//用户中台存储  开始
+							formdata := map[string]interface{}{
+								"appid": "10000",
+								"phone": phone,
+							}
+							if s_company != "" {
+								formdata["company"] = s_company
+							}
+							ck, _ := l.GetCookie("SESSIONID")
+							usercenter.AddBaseUser(mongodb, qutil.ObjToString(config.Sysconfig["userCenterApi"]), userid, formdata, ck)
+							//用户中台存储  结束
+						}(phone, _id)
+						jy.ClearPhoneIdentSession(l.Session())
+						ok, _, userInfo := afterLogin(phone, l.Session())
+						nsqPath, _ := config.Sysconfig["nsq"].(string)
+						nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
+						er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2)
+						if er != nil {
+							log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
+						}
+						if ok {
+							result["userInfo"] = userInfo
+							return 1
+						}
+					}
+				} else {
+					//存在
+					//以s_m_phone登录的 需要把s_m_phone转化为s_phone
+					updataMap := map[string]interface{}{}
+					if s_company != "" {
+						updataMap["s_company"] = s_company
+					}
+					if (*datas)[0]["s_m_phone"] != nil {
+						updataMap["s_phone"] = phone
+					}
+					//注册邮箱
+					email := l.GetString("email")
+					if jy.IsEmail(email) {
+						updataMap["s_email"] = email
+					}
+					if len(updataMap) > 0 {
+						mongodb.UpdateById("user", BsonIdToSId((*datas)[0]["_id"]), map[string]interface{}{
+							"$set":   updataMap,
+							"$unset": map[string]interface{}{"s_m_phone": ""},
+						})
+					}
 
-                    jy.ClearPhoneIdentSession(l.Session())
-                    ok, _, userInfo := afterLogin(phone, l.Session())
-                    if ok {
-                        result["userInfo"] = userInfo
-                        return 1
-                    }
-                }
-            }
-        }
-        return 0
-    }()
-    result["status"] = status
-    l.ServeJson(result)
-    return nil
+					jy.ClearPhoneIdentSession(l.Session())
+					ok, _, userInfo := afterLogin(phone, l.Session())
+					if ok {
+						result["userInfo"] = userInfo
+						return 1
+					}
+				}
+			}
+		}
+		return 0
+	}()
+	result["status"] = status
+	l.ServeJson(result)
+	return nil
 }
 
 func (l *Login) Register() error {
-    return l.Render("/login/register.html", &l.T)
+	return l.Render("/login/register.html", &l.T)
 }
 
 // ForgetPwd 忘记密码
 func (l *Login) ForgetPwd() error {
-    defer qutil.Catch()
-    if l.Method() == "GET" {
-        var shareid = l.GetString("id")
-        if len(shareid) == 0 {
-            shareid = "10"
-        }
-        l.T["logid"] = config.Seoconfig["wjmm"].(string)
-        l.T["shareid"] = se.EncodeString(shareid)
-        return l.Render("/login/forgetPwd.html", &l.T)
-    }
-    status := func() string {
-        reqType := l.GetString("reqType")
-        if reqType == "sendIdentCode" { //发短信
-            phone := l.GetString("phone") //手机号
-            //手机号验证不通过
-            if !phoneReg.MatchString(phone) {
-                return "phoneError"
-            }
-            if tmp := l.GetSession("CheckCodeId"); tmp == nil || !captcha.VerifyString(tmp.(string), l.GetString("code")) {
-                return "codeError"
-            }
-            //手机号是否已被注册
-            if !phoneIsExists(phone) {
-                return "phoneNotExists"
-            } else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
-                return "y"
-            }
-        } else if reqType == "nextStep" {
-            if l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
-                return "identCodeError"
-            }
-            l.SetSession("forgetPwdStep", "2")
-            return "y"
-        } else if reqType == "save" {
-            if l.GetSession("forgetPwdStep") == nil {
-                return "error"
-            }
-            phone, _ := l.GetSession("identCodeKey").(string)
-            if phone == "" {
-                return "timeout"
-            }
-            password := strings.TrimSpace(l.GetString("password"))
-            if !passwordReg.MatchString(password) {
-                return "passwordError"
-            }
-            ok, user := getPhoneUser(phone)
-            if !ok || user == nil || len(user) == 0 {
-                return "userNotExists"
-            }
-            oldpwd, _ := user["s_password"].(string)
-            if oldpwd == qutil.GetMd5String(password) {
-                return "passwordRepeat"
-            }
-            if jyutil.Compatible.Update(qutil.ObjToString(user["_id"]), map[string]interface{}{
-                "$set": map[string]interface{}{
-                    "s_phone":         phone,
-                    "s_password":      qutil.GetMd5String(password),
-                    "l_updatepwdtime": time.Now().Unix(),
-                },
-                "$unset": map[string]interface{}{
-                    "s_m_phone": "",
-                }}) {
-                userid := BsonIdToSId(user["_id"])
-                //用户中台存储  开始
-                ck, _ := l.GetCookie("SESSIONID")
-                usercenter.UpdateBaseUser(mongodb, qutil.ObjToString(config.Sysconfig["userCenterApi"]), userid, ck)
+	defer qutil.Catch()
+	if l.Method() == "GET" {
+		var shareid = l.GetString("id")
+		if len(shareid) == 0 {
+			shareid = "10"
+		}
+		l.T["logid"] = config.Seoconfig["wjmm"].(string)
+		l.T["shareid"] = se.EncodeString(shareid)
+		return l.Render("/login/forgetPwd.html", &l.T)
+	}
+	status := func() string {
+		reqType := l.GetString("reqType")
+		if reqType == "sendIdentCode" { //发短信
+			phone := l.GetString("phone") //手机号
+			//手机号验证不通过
+			if !phoneReg.MatchString(phone) {
+				return "phoneError"
+			}
+			if tmp := l.GetSession("CheckCodeId"); tmp == nil || !captcha.VerifyString(tmp.(string), l.GetString("code")) {
+				return "codeError"
+			}
+			//手机号是否已被注册
+			if !phoneIsExists(phone) {
+				return "phoneNotExists"
+			} else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
+				return "y"
+			}
+		} else if reqType == "nextStep" {
+			if l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
+				return "identCodeError"
+			}
+			l.SetSession("forgetPwdStep", "2")
+			return "y"
+		} else if reqType == "save" {
+			if l.GetSession("forgetPwdStep") == nil {
+				return "error"
+			}
+			phone, _ := l.GetSession("identCodeKey").(string)
+			if phone == "" {
+				return "timeout"
+			}
+			password := strings.TrimSpace(l.GetString("password"))
+			if !passwordReg.MatchString(password) {
+				return "passwordError"
+			}
+			ok, user := getPhoneUser(phone)
+			if !ok || user == nil || len(user) == 0 {
+				return "userNotExists"
+			}
+			oldpwd, _ := user["s_password"].(string)
+			if oldpwd == qutil.GetMd5String(password) {
+				return "passwordRepeat"
+			}
+			if mongodb.Update("user", map[string]interface{}{
+				"_id": user["_id"],
+			}, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"s_phone":         phone,
+					"s_password":      qutil.GetMd5String(password),
+					"l_updatepwdtime": time.Now().Unix(),
+				},
+				"$unset": map[string]interface{}{
+					"s_m_phone": "",
+				}}, false, false) {
+				userid := BsonIdToSId(user["_id"])
+				//用户中台存储  开始
+				ck, _ := l.GetCookie("SESSIONID")
+				usercenter.UpdateBaseUser(mongodb, qutil.ObjToString(config.Sysconfig["userCenterApi"]), userid, ck)
 
-                //用户中台存储  结束
-                l.DelSession("forgetPwdStep")
-                jy.ClearPhoneIdentSession(l.Session())
-                return "y"
-            }
-            return "saveError"
-        }
-        return "n"
-    }()
-    //返回
-    l.ServeJson(map[string]string{
-        "status": status,
-    })
-    return nil
+				//用户中台存储  结束
+				l.DelSession("forgetPwdStep")
+				jy.ClearPhoneIdentSession(l.Session())
+				return "y"
+			}
+			return "saveError"
+		}
+		return "n"
+	}()
+	//返回
+	l.ServeJson(map[string]string{
+		"status": status,
+	})
+	return nil
 }
 
 /**********************************************************************
 ***********************************************************************
 ***********************************************************************/
 func phoneIsExists(phone string) bool {
-    return mongodb.Count("user", map[string]interface{}{
-        "i_appid": 2,
-        "$or": []map[string]interface{}{
-            {"s_phone": phone},
-            {"s_m_phone": phone}},
-    }) > 0
+	return mongodb.Count("user", map[string]interface{}{
+		"i_appid": 2,
+		"$or": []map[string]interface{}{
+			{"s_phone": phone},
+			{"s_m_phone": phone}},
+	}) > 0
 }
 
 func getPhoneUser(phone string) (bool, map[string]interface{}) {
-    datas, ok := mongodb.Find("user", map[string]interface{}{
-        "i_appid": 2,
-        "$or": []map[string]interface{}{
-            {"s_phone": phone},
-            {"s_m_phone": phone},
-        },
-    }, `{"s_phone":-1}`, `{"_id":1,"s_password":1}`, false, 0, 1)
-    if datas != nil && len(*datas) > 0 {
-        return ok, (*datas)[0]
-    }
-    return ok, nil
+	datas, ok := mongodb.Find("user", map[string]interface{}{
+		"i_appid": 2,
+		"$or": []map[string]interface{}{
+			{"s_phone": phone},
+			{"s_m_phone": phone},
+		},
+	}, `{"s_phone":-1}`, `{"_id":1,"s_password":1}`, false, 0, 1)
+	if datas != nil && len(*datas) > 0 {
+		return ok, (*datas)[0]
+	}
+	return ok, nil
 }
 
 // 手机号用户是否存在
 func userIsExists(phoneNum string) bool {
-    query := map[string]interface{}{
-        "s_phone": phoneNum,
-        "i_appid": 2,
-    }
-    return mongodb.Count("user", query) > 0
+	query := map[string]interface{}{
+		"s_phone": phoneNum,
+		"i_appid": 2,
+	}
+	return mongodb.Count("user", query) > 0
 }
 
 func afterLogin(phone string, session *httpsession.Session) (bool, *map[string]interface{}, map[string]interface{}) {
-    ok, user := getPhoneUser(phone)
-    if !ok {
-        return false, nil, nil
-    }
-    if user == nil || len(user) == 0 {
-        return false, nil, nil
-    }
-    return FindUserAndCreateSessById(user["_id"].(primitive.ObjectID), session, true)
+	ok, user := getPhoneUser(phone)
+	if !ok {
+		return false, nil, nil
+	}
+	if user == nil || len(user) == 0 {
+		return false, nil, nil
+	}
+	return FindUserAndCreateSessById(user["_id"].(primitive.ObjectID), session, true)
 }
 
 func GetModule(source string) string {
-    sourceModuleMap, _ := config.Seoconfig["cookieSource"].(map[string]interface{})
-    return qutil.ObjToString(sourceModuleMap[source])
+	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
+	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
 }

+ 2 - 2
src/jfw/front/org_structure.go

@@ -94,7 +94,7 @@ func (this *OrgStructure) InvitationPage() error {
 			isSubscribe = CheckUserIsSubscribe(openId)
 			if isSubscribe {
 				registered = "1"
-				FindUserAndCreateSess(openId, this.Session(), "wx", false)
+				FindUserAndCreateSess(openId, this.Session(), "wx", false, true)
 				phone = util.If(this.GetSession("phone") != nil, this.GetSession("phone"), "").(string)
 			}
 		}
@@ -122,7 +122,7 @@ func (this *OrgStructure) Authorize() error {
 	if openId != "" {
 		isSubscribe = CheckUserIsSubscribe(openId)
 		if isSubscribe {
-			FindUserAndCreateSess(openId, this.Session(), "wx", false)
+			FindUserAndCreateSess(openId, this.Session(), "wx", false, true)
 		} else { //获取未关注用户uninoid
 			unionId = GetUnionid(openId)
 		}

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

@@ -310,7 +310,7 @@ func (l *PcHelper) ToAct(token string) error {
 						CreateSession(map[string]interface{}{
 							"i_appid": 2,
 							"s_phone": phone,
-						}, l.Session(), "pchelper", true)
+						}, l.Session(), "pchelper", true, true)
 					} else {
 						LoginInfo("", phone, l.Session())
 					}

+ 857 - 0
src/jfw/front/searchOptimize.go

@@ -0,0 +1,857 @@
+package front
+
+import (
+	"encoding/json"
+	"fmt"
+	"jy/src/jfw/config"
+	"log"
+	"strconv"
+	"strings"
+	"time"
+
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	elastic "app.yhyue.com/moapp/jybase/esv1"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	pc "app.yhyue.com/moapp/jypkg/public"
+)
+
+const (
+	multiMatch              = `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
+	query                   = `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
+	queryBoolShould         = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	queryBoolMustBoolShould = `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	queryBoolMust           = `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
+	queryBoolMustTerm       = `{"bool": {"must": [{ "term": {"isValidFile": %d }}]}}`
+	queryMissing            = `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	gte                     = `"gte": %s`
+	lte                     = `"lte": %s`
+	HighlightStr            = `"%s": {"fragment_size": %d,"number_of_fragments": 1}`
+	HL                      = `"highlight": {"pre_tags": [""],"post_tags": [""],"fields": {%s}}`
+	BidSearchSort           = `{"dataweight":-1,"publishtime":-1}`
+	queryBoolMustTermDomain = `{"bool": {"must": [{ "term": {"bid_field": "%s" }}]}}` // 领域化数据类型
+)
+
+var (
+	SR              = strings.Replace
+	DefaultTopTypes = []string{
+		"招标预告,招标公告,招标结果,招标信用信息",
+		"拟建,采购意向",
+	}
+	SearchCacheKey   = "searchDataCache_%d_%s_%s"
+	SearchCacheCount = "searchCountCache_%d_%s_%s"
+	RedisNameNew     = "newother"
+)
+
+type SearchOptimize struct {
+	AppId               string `json:"appId,omitempty"`               //剑鱼默认10000
+	UserId              string `json:"userId,omitempty"`              //用户id
+	Phone               string `json:"phone,omitempty"`               //手机号
+	NewUserId           int64  `json:"newUserId,omitempty"`           //base_user_id 新用户id
+	EntId               int64  `json:"entId,omitempty"`               //企业id 没有企业 企业id=0
+	EntUserId           int64  `json:"entUserId,omitempty"`           //企业用户id  当前企业下的员工id 没有企业默认0
+	PageNum             int    `json:"pageNum,omitempty"`             //当前页码
+	PageSize            int    `json:"pageSize,omitempty"`            //每页数量
+	Province            string `json:"province,omitempty"`            //省份
+	City                string `json:"city,omitempty"`                //城市
+	Subtype             string `json:"subtype,omitempty"`             //信息类型-二级
+	TopType             string `json:"topTypeMap,omitempty"`          //信息类型-一级分类
+	PublishTime         string `json:"publishTime,omitempty"`         //发布时间
+	SelectType          string `json:"selectType,omitempty"`          //搜索范围:标题;正文等
+	Price               string `json:"price,omitempty"`               //价格
+	Industry            string `json:"industry,omitempty"`            //行业
+	BuyerClass          string `json:"buyerClass,omitempty"`          //采购单位类型
+	BuyerTel            string `json:"buyerTel,omitempty"`            //采购单位联系方式
+	WinnerTel           string `json:"winnerTel,omitempty"`           //中标单位联系方式
+	FileExists          string `json:"fileExists,omitempty"`          //是否有附件
+	SearchGroup         int    `json:"searchGroup,omitempty"`         //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode          int    `json:"searchMode,omitempty"`          //搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode           int    `json:"wordsMode,omitempty"`           //搜索关键词模式;默认0:包含所有,1:包含任意
+	KeyWords            string `json:"keyWords,omitempty"`            //关键词:多个空格隔开(主)
+	AdditionalWords     string `json:"additionalWords,omitempty"`     //关键词:附加关键词(副:五组,每组最多15个字符)
+	ExclusionWords      string `json:"exclusionWords,omitempty"`      //关键词:排除词(副:五组,每组最多15个字符)
+	UserType            string `json:"userType,omitempty"`            //用户状态 fType:免费用户;pType:付费用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户
+	Platform            string `json:"platform,omitempty"`            //请求平台
+	IsPay               bool   `json:"isPay,omitempty"`               //是否是付费用户
+	InterceptKeyWords   string `json:"interceptKeyWords,omitempty"`   //关键词截取后的关键词;
+	InterceptOtherWords string `json:"interceptOtherWords,omitempty"` //关键词截取后 后面三个字
+	BidField            string `json:"bidField,omitempty"`            //领域化数据
+	SearchTypeSwitch    bool   `json:"searchTypeSwitch,omitempty"`    //标题+全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+	IsOldVip            bool   `json:"isOldVip"`                      //超级订阅老用户 超前项目权限
+	VipStatus           int    `json:"vipStatus"`
+	BigMemberStatus     int    `json:"bigMemberStatus"`
+	EntStatus           int    `json:"entStatus"`
+	HeightKeys          string `json:"heightKeys"` //需要高亮的关键词
+}
+
+// NewSearchOptimize  初始化
+func NewSearchOptimize(userId, phone, province, city, subtype, topType, publishTime, selectType, price, industry, buyerClass, buyerTel, winnerTel, fileExists, keyWords, additionalWords, exclusionWords, platform, territorialization string, pageNum, pageSize, searchGroup, searchMode, wordsMode int, userInfo jy.VipState, searchTypeSwitch bool) *SearchOptimize {
+	var so = &SearchOptimize{
+		AppId:            "10000",
+		UserId:           userId,
+		Phone:            phone,
+		PageNum:          pageNum,
+		PageSize:         pageSize,
+		Province:         province,
+		City:             city,
+		Subtype:          subtype,
+		TopType:          topType,
+		PublishTime:      publishTime,
+		SelectType:       selectType,
+		Price:            price,
+		Industry:         industry,
+		BuyerClass:       buyerClass,
+		BuyerTel:         buyerTel,
+		WinnerTel:        winnerTel,
+		FileExists:       fileExists,
+		SearchGroup:      searchGroup,
+		SearchMode:       searchMode,
+		WordsMode:        wordsMode,
+		KeyWords:         keyWords,
+		AdditionalWords:  additionalWords,
+		ExclusionWords:   exclusionWords,
+		Platform:         platform,
+		IsPay:            userInfo.IsPayedUser(),
+		BidField:         territorialization,
+		SearchTypeSwitch: searchTypeSwitch,
+		IsOldVip:         userInfo.VipState > 0 && userInfo.RegisterData < util.Int64All(config.Sysconfig["contextOldVipLimit"]),
+		VipStatus:        userInfo.VipState,
+		BigMemberStatus:  userInfo.BigMember,
+		EntStatus:        userInfo.EntMember,
+	}
+	so.SearchParamsHandle()
+	return so
+}
+
+// DefaultSearchParamsAuto 缓存查询条件初始化
+func (so *SearchOptimize) DefaultSearchParamsAuto() {
+	so.TopType = ""
+	so.City = ""
+	so.Industry = ""
+	so.FileExists = ""
+	so.WinnerTel = ""
+	so.BuyerTel = ""
+	so.BuyerClass = ""
+	so.Price = ""
+	so.SelectType = "title"
+	so.Province = ""
+	so.KeyWords = ""
+	so.AdditionalWords = ""
+	so.ExclusionWords = ""
+}
+
+// SearchParamsHandle 搜索条件 处理
+func (so *SearchOptimize) SearchParamsHandle() {
+	// so.SearchGroup 搜索分组 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	if so.SearchGroup < 0 || so.SearchGroup > 2 {
+		so.SearchGroup = 1
+	}
+	//信息类型
+	if so.Subtype == "" && so.TopType == "" {
+		// 所有用户都可以搜索,判断是否能使用超前项目  老版超级订阅、大会员、商机管理有权限
+		if so.SearchGroup > 0 && len(DefaultTopTypes) >= so.SearchGroup {
+			so.Subtype = DefaultTopTypes[so.SearchGroup-1]
+		}
+	}
+	// so.SearchMode 搜索模式 搜索模式:0:精准搜索;1:模糊搜索
+	// 精准搜索:不分词,完全匹配;(中间带空格的关键词组自动分词)
+	// 模糊搜索:对用户输入的单个关键词进行分词处理,但必须都存在;
+	if so.SearchMode < 0 {
+		so.SearchMode = 0
+	}
+	// so.WordsMode 搜索关键词模式;默认0:包含所有,1:包含任意
+	if so.WordsMode < 0 {
+		so.WordsMode = 0
+	}
+	//查询时间publishTime
+	if so.PublishTime == "" {
+		//so.UserId == ""||免费用户最新1年 未登录用户默认最近一年的数据
+		so.PublishTime = fmt.Sprintf("%d_%d", time.Now().AddDate(-1, 0, 0).Unix(), time.Now().Unix())
+		//付费用户最新5年
+		if so.IsPay {
+			so.PublishTime = fmt.Sprintf("%d_%d", time.Now().AddDate(-5, 0, 0).Unix(), time.Now().Unix())
+		}
+	}
+	//默认每页数据量
+	if so.PageSize <= 0 {
+		so.PageSize = 50
+	}
+	//第一页
+	if so.PageNum <= 0 {
+		so.PageNum = 1
+	}
+	//行业格式化
+	if so.Industry != "" {
+		so.Industry = strings.TrimSpace(so.Industry)
+	}
+	//默认搜索范围
+	if so.SelectType == "" {
+		so.SelectType = "title,detail"
+	}
+	//免费用户:高级筛选 采购单位类型、采购单位联系方式、中标企业联系方式、排除词、城市
+	if !so.IsPay {
+		so.BuyerClass = ""
+		so.BuyerTel = ""
+		so.WinnerTel = ""
+		so.ExclusionWords = ""
+		so.City = ""
+		so.SearchGroup = util.If(so.SearchGroup > 1, 1, so.SearchGroup).(int) //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		so.ExclusionWords = ""                                                //排除词
+	}
+	//判断是否有关键词
+	if so.KeyWords != "" {
+		//关键词处理
+		so.KeyWords = strings.TrimSpace(so.KeyWords)
+	}
+	//附加词 每组附加词不能超过15个字符
+	if so.AdditionalWords != "" {
+		var additionalWords []string
+		for _, ak := range strings.Split(so.AdditionalWords, ",") {
+			if len([]rune(ak)) > 15 {
+				additionalWords = append(additionalWords, string([]rune(ak)[:15]))
+			} else {
+				additionalWords = append(additionalWords, ak)
+			}
+		}
+		so.AdditionalWords = strings.Join(additionalWords, ",")
+	}
+	//合并 关键词 & 附加词
+	so.HeightKeys = so.GetSearchKeyWordsQueryStr()
+	//排除词  每组排除词不能超过15个字符
+	if so.ExclusionWords != "" {
+		var exclusionWords []string
+		for _, ak := range strings.Split(so.ExclusionWords, ",") {
+			if len([]rune(ak)) > 15 {
+				exclusionWords = append(exclusionWords, string([]rune(ak)[:15]))
+			} else {
+				exclusionWords = append(exclusionWords, ak)
+			}
+		}
+		so.ExclusionWords = strings.Join(exclusionWords, " ")
+	}
+}
+
+// GetSearchKeyWordsQueryStr 关键词处理 获取关键词查询条件
+func (so *SearchOptimize) GetSearchKeyWordsQueryStr() string {
+	// in.SearchMode 搜索模式:0:精准搜索;1:模糊搜索
+	// 精准搜索:不分词,完全匹配;(中间带空格的关键词组自动分词)
+	// 模糊搜索:对用户输入的单个关键词进行分词处理,但必须都存在;
+	var (
+		searchWords []string
+	)
+	//主关键词词组
+	if so.KeyWords != "" {
+		if so.SearchMode == 1 {
+			if ikWords := jy.HttpEs(so.KeyWords, "ik_smart", pc.DbConf.Elasticsearch.Main.Address); ikWords != "" {
+				so.KeyWords = strings.ReplaceAll(ikWords, "+", " ")
+			}
+		}
+		searchWords = append(searchWords, so.KeyWords)
+	}
+	//多组附加词,每组间,号隔开。每组内如果关键词中间有空格,自动分词
+	if so.AdditionalWords != "" {
+		if so.SearchMode == 1 {
+			var (
+				addWords []string
+			)
+			for _, awv := range strings.Split(so.AdditionalWords, ",") {
+				if ikWords := jy.HttpEs(awv, "ik_smart", pc.DbConf.Elasticsearch.Main.Address); ikWords != "" {
+					addWords = append(addWords, strings.ReplaceAll(ikWords, "+", " "))
+				}
+			}
+			if len(addWords) > 0 {
+				so.AdditionalWords = strings.Join(addWords, ",")
+			}
+		}
+		searchWords = append(searchWords, strings.Split(so.AdditionalWords, ",")...)
+	}
+	return strings.Join(searchWords, " ")
+}
+
+// GetBidSearchList 搜索 查询
+func (so *SearchOptimize) GetBidSearchList(isCache bool) (count, total int64, list []*map[string]interface{}) {
+	var start = (so.PageNum - 1) * so.PageSize
+	if start >= 0 {
+		t := time.Now()
+		fields := util.If(so.IsPay, BidSearchFieldOfVip, BidSearchFieldBase).(string)
+		biddingSearch := SearchByES{
+			Index:      INDEX,
+			IType:      TYPE,
+			Query:      so.GetSearchQuery(so.GetBidSearchQuery()),
+			FindFields: util.If(isCache, "title", "detail").(string),
+			Order:      BidSearchSort,
+			Fields:     util.If(so.BidField != "", BidSearchDomainField, fields).(string), //BidField ===医疗领域化数据
+			Start:      util.If(isCache, 0, start).(int),
+			Limit:      util.If(isCache, util.If(so.IsPay, bidsearch.SearchMaxPageCount_PAYED, bidsearch.SearchMaxPageCount_PC).(int), so.PageSize).(int), //缓存数据: 付费或未登录用户一次性5000条,100页数据;免费用户一次性500条,10页数据;实时数据:每页50条数据请求
+			Count:      util.If(strings.Contains(so.SelectType, "detail"), 115, 0).(int),                                                                  //高亮正文数量
+			HighLight:  util.If(strings.Contains(so.SelectType, "detail"), true, false).(bool),                                                            //是否高亮正文
+		}
+		var repl *[]map[string]interface{}
+		total, repl = biddingSearch.GetAllByNgramWithCount()
+		if repl != nil && *repl != nil && len(*repl) > 0 {
+			//格式化查询结果
+			list = SearchListFormat(so.Industry, *repl, strings.Contains(so.SelectType, "detail"))
+			count = util.If(so.IsPay, int64(bidsearch.SearchMaxPageCount_PAYED), int64(bidsearch.SearchMaxPageCount_PC)).(int64)
+			//数据如果>最大数据结果量 total==count,否则count = 付费:5000;免费:500;
+			count = util.If(count > total, total, count).(int64)
+		} else {
+			log.Println("查询数据异常")
+		}
+		log.Println("关键词 -1- 查询耗时:", time.Since(t).Seconds())
+	}
+	return
+}
+
+// GetSearchQuery  整理关键词等查询条件
+func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
+	var (
+		musts, mustNot, wordsMusts, wordsShould []string
+		findFields                              string
+		//搜索范围是否只有附件
+		//搜索范围只选择附件,是否有附件条件无效;
+		isFileSearch  = so.SelectType == "filetext"
+		selectTypeArr = strings.Split(so.SelectType, ",")
+	)
+	if mustQuery != "" {
+		musts = append(musts, mustQuery)
+	}
+	if selectTypeArr == nil || len(selectTypeArr) == 0 {
+		findFields = `"title"`
+	} else {
+		findFields = fmt.Sprintf(`"%s"`, strings.Join(selectTypeArr, "\",\""))
+	}
+	switchBool := strings.Contains(findFields, "detail") && strings.Contains(findFields, "title") && so.SearchTypeSwitch
+
+	//此时关键词中间有+进行隔离
+	if so.KeyWords != "" {
+		var (
+			keyWordsMusts []string
+		)
+		for _, v := range strings.Split(so.KeyWords, " ") {
+			if elastic.ReplaceYH(v) == "" {
+				continue
+			}
+			//单个字  搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+			if len([]rune(elastic.ReplaceYH(v))) == 1 && bidsearch.DetailFileORTitle(findFields) {
+				findFields += `,"title"`
+			} else if switchBool && len([]rune(elastic.ReplaceYH(v))) > 1 {
+				//标题 全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+				if strings.Contains(findFields, `"title",`) {
+					findFields = strings.Replace(findFields, `"title",`, ``, -1)
+				} else if strings.Contains(findFields, `,"title"`) {
+					findFields = strings.Replace(findFields, `,"title"`, ``, -1)
+				}
+			}
+			keyWordsMusts = append(keyWordsMusts, fmt.Sprintf(fmt.Sprintf(multiMatch, "%s", findFields), elastic.ReplaceYH(v)))
+		}
+		//搜索关键词模式;默认0:包含所有,1:包含任意
+		if so.WordsMode == 1 {
+			wordsShould = append(wordsShould, fmt.Sprintf(elastic.NgramMust, strings.Join(keyWordsMusts, ",")))
+		} else {
+			wordsMusts = append(wordsMusts, keyWordsMusts...)
+		}
+	}
+	//附加词
+	if so.AdditionalWords != "" {
+		//多组附加词,每组间,号隔开。每组内如果关键词中间有空格,自动分词
+		var (
+			addWordsMusts []string
+		)
+		for _, aws := range strings.Split(so.AdditionalWords, ",") {
+			var (
+				addWordsMust []string
+			)
+			for _, v := range strings.Split(aws, " ") {
+				if elastic.ReplaceYH(v) == "" {
+					continue
+				}
+				//单个字  搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+				//detail 正文不支持单字查询
+				if len([]rune(elastic.ReplaceYH(v))) == 1 && bidsearch.DetailFileORTitle(findFields) {
+					findFields += `,"title"`
+				} else if switchBool && len([]rune(elastic.ReplaceYH(v))) > 1 {
+					//标题 全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+					if strings.Contains(findFields, `"title",`) {
+						findFields = strings.Replace(findFields, `"title",`, ``, -1)
+					} else if strings.Contains(findFields, `,"title"`) {
+						findFields = strings.Replace(findFields, `,"title"`, ``, -1)
+					}
+				}
+				addWordsMust = append(addWordsMust, fmt.Sprintf(fmt.Sprintf(multiMatch, "%s", findFields), elastic.ReplaceYH(v)))
+				addWordsMusts = append(addWordsMusts, addWordsMust...)
+				if so.WordsMode == 0 {
+					wordsMusts = append(wordsMusts, addWordsMust...)
+				}
+				addWordsMust = []string{}
+			}
+			//搜索关键词模式;默认0:包含所有,1:包含任意
+			if so.WordsMode == 1 {
+				wordsShould = append(wordsShould, fmt.Sprintf(elastic.NgramMust, strings.Join(addWordsMusts, ",")))
+				addWordsMusts = []string{}
+			}
+		}
+	}
+	//搜索关键词模式;默认0:包含所有,1:包含任意
+	//包含任意一组
+	if len(wordsShould) > 0 {
+		musts = append(musts, fmt.Sprintf(queryBoolShould, strings.Join(wordsShould, ",")))
+	} else if len(wordsMusts) > 0 {
+		musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(wordsMusts, ",")))
+	}
+	//排除词
+	if notKey := strings.TrimSpace(so.ExclusionWords); notKey != "" {
+		notKeyMultiMatch := fmt.Sprintf(multiMatch, "%s", findFields)
+		var notKeyMustNot []string
+		//多组排除词
+		for _, nks := range strings.Split(notKey, ",") {
+			//单组排除词 空格分割
+			for _, v := range strings.Split(nks, " ") {
+				v = strings.TrimSpace(v)
+				if v == "" {
+					continue
+				}
+				if len([]rune(elastic.ReplaceYH(v))) == 1 {
+					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+					if bidsearch.DetailFileORTitle(findFields) {
+						notKeyMultiMatch = fmt.Sprintf(multiMatch, "%s", findFields+`,"title"`)
+					}
+				}
+				notKeyMustNot = append(notKeyMustNot, fmt.Sprintf(notKeyMultiMatch, elastic.ReplaceYH(v)))
+			}
+		}
+		mustNot = append(mustNot, fmt.Sprintf(queryBoolShould, strings.Join(notKeyMustNot, ",")))
+	}
+	//行业
+	if so.Industry != "" {
+		musts = append(musts, fmt.Sprintf(queryBoolMust, `"`+strings.ReplaceAll(so.Industry, ",", `","`)+`"`))
+	}
+	//价格
+	if so.Price != "" && len(strings.Split(so.Price, "-")) > 1 {
+		minPrice, maxPrice := strings.Split(so.Price, "-")[0], strings.Split(so.Price, "-")[1]
+		if minPrice != "" || maxPrice != "" {
+			sq := ``
+			if minPrice != "" {
+				min, _ := strconv.ParseFloat(minPrice, 64)
+				minPrice = fmt.Sprintf("%.0f", min*10000)
+				if minPrice == "0" {
+					minPrice = ""
+				}
+			}
+			if maxPrice != "" {
+				max, _ := strconv.ParseFloat(maxPrice, 64)
+				maxPrice = fmt.Sprintf("%.0f", max*10000)
+				if maxPrice == "0" {
+					maxPrice = ""
+				}
+			}
+			if minPrice != "" {
+				sq += fmt.Sprintf(gte, minPrice)
+			}
+			if minPrice != "" && maxPrice != "" {
+				sq += `,`
+			}
+			if maxPrice != "" {
+				sq += fmt.Sprintf(lte, maxPrice)
+			}
+			if minPrice != "" || maxPrice != "" {
+				musts = append(musts, fmt.Sprintf(queryBoolShould, fmt.Sprintf(queryBoolMustBoolShould, sq, sq)))
+			}
+		}
+	}
+	//采购单位联系方式
+	hasBuyerTel := so.BuyerTel
+	if hasBuyerTel != "" {
+		if hasBuyerTel == "y" {
+			mustNot = append(mustNot, fmt.Sprintf(queryMissing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(queryMissing, "buyertel"))
+		}
+	}
+	//中标企业联系方式
+	hasWinnerTel := so.WinnerTel
+	if hasWinnerTel != "" {
+		if hasWinnerTel == "y" {
+			mustNot = append(mustNot, fmt.Sprintf(queryMissing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(queryMissing, "winnertel"))
+		}
+	}
+	//附件
+	fileExists := so.FileExists
+	if !isFileSearch && fileExists != "" {
+		if fileExists == "1" { //有附件
+			mustNot = append(mustNot, fmt.Sprintf(queryMissing, "isValidFile"))
+			musts = append(musts, fmt.Sprintf(queryBoolMustTerm, 1))
+		} else if fileExists == "-1" { //无附件
+			musts = append(musts, fmt.Sprintf(queryMissing, "isValidFile"))
+		}
+	}
+	// 如果是领域化数据则需要加标签
+	if so.BidField != "" {
+		musts = append(musts, fmt.Sprintf(queryBoolMustTermDomain, so.BidField))
+	}
+	qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(mustNot, ","))
+	log.Println("qstr:", qstr)
+	return
+}
+
+// GetBidSearchQuery  整理地区、城市、发布时间、信息类型、采购单位类型 查询条件
+func (so *SearchOptimize) GetBidSearchQuery() string {
+	query := ``
+	//省份
+	area := so.Province
+	if area != "" {
+		query += `{"terms":{"area":[`
+		for k, v := range strings.Split(area, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	//
+	city := so.City
+	if city != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"city":[`
+		for k, v := range strings.Split(city, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	if query != "" {
+		query = fmt.Sprintf(queryBoolShould, query)
+	}
+	//发布时间
+	publishTime := so.PublishTime
+	if publishTime != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		startTime, endTime := "", ""
+		now := time.Now()
+		if publishTime == "lately-7" { //最近7天
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishTime == "lately-30" { //最近30天
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishTime == "thisyear" { //最近一年
+			startTime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		} else if publishTime == "threeyear" { //最近三年
+			startTime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		} else if publishTime == "fiveyear" { //最近五年
+			startTime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		} else if len(strings.Split(publishTime, "_")) > 1 {
+			startTime = strings.Split(publishTime, "_")[0]
+			endTime = strings.Split(publishTime, "_")[1]
+			etTime := time.Now()
+			if endTime != "" {
+				et, _ := strconv.ParseInt(endTime, 0, 64)
+				etTime = time.Unix(et, 0)
+			}
+			endTime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
+		}
+		query += `{"range":{"publishtime":{`
+		if startTime != "" {
+			query += `"gte":` + startTime
+		}
+		if startTime != "" && endTime != "" {
+			query += `,`
+		}
+		if endTime != "" {
+			query += `"lt":` + endTime
+		}
+		query += `}}}`
+	}
+	//信息类型-二级
+	subtype := so.Subtype
+	topType := util.If(so.TopType != "", strings.Split(so.TopType, ","), []string{}).([]string)
+	allType := ``
+	//二级分类
+	if subtype != "" {
+		var typeInt = 0
+		allType += `{"terms":{"subtype":[`
+		for k, v := range strings.Split(subtype, ",") {
+			if tType := util.If(topTypeMap[v] != "" && so.TopType == "", topTypeMap[v], "").(string); tType != "" {
+				topType = append(topType, tType)
+				typeInt += 1
+				continue
+			}
+			if k > typeInt {
+				allType += `,`
+			}
+			allType += `"` + v + `"`
+		}
+		allType += `]}}`
+	}
+	//信息类型  一级分类
+	log.Println("topType:", topType)
+	if len(topType) > 0 {
+		if allType != "" {
+			allType += ","
+		}
+		allType += `{"terms":{"toptype":[`
+		for k, v := range topType {
+			if k > 0 {
+				allType += `,`
+			}
+			allType += `"` + v + `"`
+		}
+		allType += `]}}`
+	}
+
+	if allType != "" {
+		if query != "" {
+			query += ","
+		}
+		query += fmt.Sprintf(queryBoolShould, allType)
+	}
+	//采购单位类型
+	if so.BuyerClass != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"buyerclass":[`
+		for k, v := range strings.Split(so.BuyerClass, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	return query
+}
+
+// GetBidSearchListByCache   查询缓存数据
+//未登录用户默认搜索和关键词搜索改成500条和免费用户保持一致--需求调整P260来自产品经理杨蘭20220116
+func (so *SearchOptimize) GetBidSearchListByCache() (list []*map[string]interface{}, count, total int64) {
+	//缓存数据 最大量是5000条  100页数据
+	l, c, t := func(so *SearchOptimize) (list []*map[string]interface{}, count, total int64) {
+		//缓存数据总量 - 当前平台
+		redisCountKey := fmt.Sprintf(SearchCacheCount, so.SearchGroup, util.If(so.IsPay, "v", "f").(string), util.If(so.BidField != "", so.BidField, "n").(string))
+		total = int64(redis.GetInt(RedisNameNew, redisCountKey))
+		//缓存数据: kws.SearchGroup-全部,招标信息,超前信息;kws.PageNum-当前页 免费用户 or 付费用户,BidField:领域化产品
+		redisDataKey := fmt.Sprintf(SearchCacheKey, so.SearchGroup, util.If(so.IsPay, "v", "f").(string), util.If(so.BidField != "", so.BidField, "n").(string))
+		log.Println("-------redisDataKey:------", redisDataKey)
+		sCache, err := redis.GetNewBytes(RedisNameNew, redisDataKey)
+		if err == nil {
+			if sCache != nil && len(*sCache) > 0 {
+				err = json.Unmarshal(*sCache, &list)
+				if err == nil {
+					//数据如果>最大数据结果量 total==count,否则count = 付费:5000;免费:500;
+					count = util.If(so.IsPay, int64(bidsearch.SearchMaxPageCount_PAYED), int64(bidsearch.SearchMaxPageCount_PC)).(int64)
+					count = util.If(count > total, total, count).(int64)
+					return
+				}
+			}
+		}
+		//无缓存数据 或 缓存数据查询异常
+		//查库>存redis缓存
+		//查询缓存数据 参数初始化
+		so.DefaultSearchParamsAuto()
+		//缓存数据
+		count, total, list = so.GetBidSearchList(true)
+		if len(list) > 0 {
+			redis.Put(RedisNameNew, redisCountKey, total, 16*60*60)
+			b, err := json.Marshal(list)
+			if err == nil {
+				if err = redis.PutBytes(RedisNameNew, redisDataKey, &b, 16*60*60); err != nil {
+					log.Println("默认搜索查询结果保存redis缓存异常")
+				}
+			} else {
+				log.Println("默认搜索查询数量保存redis缓存异常")
+			}
+		} else {
+			log.Println("默认搜索 暂无数据")
+		}
+		return
+	}(so)
+	if len(l) > 0 {
+		total = t
+		count = c
+		list = l[(so.PageNum-1)*so.PageSize : so.PageNum*so.PageSize]
+	}
+	return
+}
+
+// SearchByES  es搜索
+type SearchByES struct {
+	Index      string
+	IType      string
+	Query      string
+	FindFields string
+	Order      string
+	Fields     string
+	Start      int
+	Limit      int
+	Count      int
+	HighLight  bool
+}
+
+// GetAllByNgramWithCount  获取es查询结果及总数量
+func (e *SearchByES) GetAllByNgramWithCount() (int64, *[]map[string]interface{}) {
+	if e.Query != "" {
+		queryStr := e.Query
+		if e.HighLight {
+			var ws []string
+			for _, w := range strings.Split(e.FindFields, ",") {
+				ws = append(ws, fmt.Sprintf(HighlightStr, w, e.Count))
+			}
+			queryStr = queryStr[:len(queryStr)-1] + `,` + fmt.Sprintf(HL, strings.Join(ws, ",")) + `}`
+		}
+		if len(e.Fields) > 0 {
+			queryStr = queryStr[:len(queryStr)-1] + `,"_source":[` + e.Fields + "]}"
+		}
+		if len(e.Order) > 0 {
+			queryStr = queryStr[:len(queryStr)-1] + `,"sort":[` + SR(SR(SR(SR(e.Order, ",", "},{", -1), " ", "", -1), ":-1", `:"desc"`, -1), ":1", `:"asc"`, -1) + `]}`
+		}
+		if e.Start > -1 {
+			queryStr = queryStr[:len(queryStr)-1] + `,"from":` + strconv.Itoa(e.Start) + `,"size":` + strconv.Itoa(e.Limit) + "}"
+		}
+		log.Println("queryStr:", queryStr)
+		return elastic.GetWithCount(e.Index, e.IType, queryStr)
+	} else {
+		return 0, nil
+	}
+}
+
+//
+// SearchListFormat  格式化数据
+func SearchListFormat(industry string, repl []map[string]interface{}, b bool) (list []*map[string]interface{}) {
+	for _, v := range repl {
+		//正文
+		if b {
+			//正文匹配检索关键词
+			highlight, _ := v["highlight"].(map[string][]string)
+			detail := ""
+			for _, val := range highlight["detail"] {
+				detail += jy.ClearHtml.ReplaceAllString(val, "")
+			}
+			v["detail"] = detail
+		}
+		v["_id"] = encrypt.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))                                     //加密信息id
+		v["s_subscopeclass"] = IndustryFormat(industry, strings.Trim(util.ObjToString(v["s_subscopeclass"]), ",")) //行业
+		v["industry"] = IndustryFormat(industry, strings.Trim(util.ObjToString(v["s_subscopeclass"]), ","))        //行业
+		if budget, ok := v["budget"].(float64); ok && budget > 0 {                                                 //预算
+			v["budget"] = int64(budget)
+		}
+		if bidAmount, ok := v["bidamount"].(float64); ok && bidAmount > 0 { //中标金额
+			v["bidamount"] = int64(bidAmount)
+		}
+		//附件
+		if isValidFile, _ := v["isValidFile"].(bool); isValidFile {
+			delete(v, "isValidFile")
+			v["fileExists"] = true
+		}
+		//地区链接、
+		area := v["area"].(string)
+		//信息类型链接
+		finalType, _ := v["subtype"].(string)
+		if finalType == "" {
+			finalType = util.ObjToString(v["toptype"])
+		}
+		if finalType == "" {
+			finalType = util.ObjToString(v["type"])
+			if finalType == "bid" {
+				finalType = "中标"
+			} else if finalType == "tender" {
+				finalType = "招标"
+			} else {
+				finalType = ""
+			}
+		}
+		//行业链接、
+		if industry == "" {
+			industry = util.ObjToString(v["s_subscopeclass"])
+			if industry != "" {
+				if strings.Contains(industry, "它") {
+					industry = strings.Replace(industry, "它", "他", -1)
+				}
+				industry = strings.Split(industry, ",")[0]
+			}
+		}
+		//stypeadd :信息类型链接
+		//areaadd:地址链接;
+		//indadd:行业链接
+		v["stypeadd"], v["areaadd"], v["indadd"] = classify(finalType, area, industry)
+		winnerList := util.ObjToString(v["s_winner"]) //中标企业名称集合
+		if winnerList != "" && len(strings.Split(winnerList, ",")) > 0 {
+			var winnerInfo []*WinnerInfo
+			for wk, wv := range strings.Split(winnerList, ",") {
+				var (
+					winnerId = ""
+				)
+				if v["entidlist"] != nil {
+					if entIdList := util.ObjArrToStringArr(v["entidlist"].([]interface{})); len(entIdList) > wk { //中标企业id集合
+						winnerId = entIdList[wk]
+					}
+				}
+				winnerInfo = append(winnerInfo, &WinnerInfo{
+					Winner:       wv,                                                                                                            //中标企业 需要单独处理
+					WinnerTel:    util.ObjToString(v["winnertel"]),                                                                              //中标企业联系电话
+					WinnerPerson: util.ObjToString(v["winnerperson"]),                                                                           //中标企业联系人
+					WinnerId:     util.If(winnerId != "" && len([]rune(winnerId)) > 12, encrypt.EncodeArticleId2ByCheck(winnerId), "").(string), //中标企业加密id  存在winnerId 异常的情况
+				})
+			}
+			v["winnerInfo"] = winnerInfo
+		}
+		tmp := v
+		list = append(list, &tmp)
+	}
+	return
+}
+
+// WinnerInfo 中标企业信息
+type WinnerInfo struct {
+	Winner       string `json:"winner,omitempty"`
+	WinnerTel    string `json:"winnerTel,omitempty"`
+	WinnerPerson string `json:"winnerPerson,omitempty"`
+	WinnerId     string `json:"winnerId,omitempty"`
+}
+
+// IndustryFormat 行业处理
+func IndustryFormat(industry, subScopeClass string) (newIndustry string) {
+	commonSubstring := func(v string) (value string) {
+		bcs := strings.Split(v, "_")
+		if len(bcs) == 1 {
+			value = bcs[0]
+		} else if len(bcs) == 2 {
+			value = bcs[0]
+			if strings.TrimSpace(value) == "" {
+				value = bcs[0]
+			}
+		}
+		return
+	}
+	bct := strings.Split(subScopeClass, ",")
+	if bct == nil || len(bct) == 0 {
+		return
+	}
+	//搜索条件中没有行业的话,取查询结果中第一个行业
+	if industry == "" {
+		newIndustry = commonSubstring(bct[0])
+	} else { //搜索条件中有行业的话,取行业中和搜索条件相对应的第一个
+		industryArr := strings.Split(industry, ",")
+	L:
+		for _, bc := range bct {
+			for _, is := range industryArr {
+				if bc == is {
+					newIndustry = strings.TrimSpace(commonSubstring(bc))
+					break L
+				}
+			}
+		}
+	}
+	return
+}

+ 15 - 3
src/jfw/front/shorturl.go

@@ -92,7 +92,7 @@ func (s *Short) Article(stype, id string) error {
 				if code := s.GetString("code"); code != "" {
 					if openid := jyutil.Getopenid(code); openid != "" {
 						if CheckUserIsSubscribe(openid) {
-							FindUserAndCreateSess(openid, s.Session(), "wx", false)
+							FindUserAndCreateSess(openid, s.Session(), "wx", false, true)
 						}
 					}
 				}
@@ -227,7 +227,7 @@ func (s *Short) Article(stype, id string) error {
 		res = jyutil.Compatible.Select( userId, `{"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone":1,"l_vip_starttime":1}`)
 	}
 	entid := util.Int64All(s.GetSession("entId"))
-	userPower := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
+	userPower := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
 	var (
 		isEntnicheNew bool = userPower.EntIsNew           //新版超级订阅
 		isOldVip      bool = false                        //新购超级订阅不能查看拟建项目详情页
@@ -268,7 +268,7 @@ func (s *Short) Article(stype, id string) error {
 			}
 			//之前sessionkeep.go中没有放userId,造成关注有问题
 			if s.GetSession("userId") == nil {
-				FindUserAndCreateSess(ssOpenid.(string), s.Session(), "wx", false)
+				FindUserAndCreateSess(ssOpenid.(string), s.Session(), "wx", false, true)
 			}
 		}
 		surl := s.GetString("url")
@@ -398,6 +398,18 @@ func (s *Short) Article(stype, id string) error {
 			return s.Redirect(surl)
 		}
 	} else {
+		if stype == "content" {
+			//工作桌面内嵌 快照页
+			if !strings.Contains(s.Request.URL.String(), "aside") {
+				paramSuffix := "aside=0"
+				if strings.Contains(s.Request.URL.String(), "?") {
+					paramSuffix = fmt.Sprintf("&%s", paramSuffix)
+				} else {
+					paramSuffix = fmt.Sprintf("?%s", paramSuffix)
+				}
+				return s.Redirect(fmt.Sprintf("%s%s%s", config.Sysconfig["workDesktopUrl"].(string), config.Sysconfig["webdomain"].(string), url.QueryEscape(fmt.Sprintf("%s%s", s.Request.URL.String(), paramSuffix))))
+			}
+		}
 		sids := encrypt.CommonDecodeArticle(stype, id)
 		if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
 			s.Redirect("/notin/page", 302)

+ 153 - 141
src/jfw/front/supsearch.go

@@ -77,6 +77,9 @@ func init() {
 	if FileSignBool, _ = config.Sysconfig["fileSignBool"].(bool); FileSignBool {
 		bidSearch_field_1 = bidSearch_field_1 + bidSearch_field_file
 		bidSearch_field = bidSearch_field + bidSearch_field_file
+		//搜索优化
+		BidSearchFieldBase += BidSearchFieldFile
+		BidSearchFieldOfVip += BidSearchFieldFile
 	}
 }
 
@@ -246,80 +249,75 @@ func (p *Pcsearch) GetNewBids() error {
 	bidField := p.GetString("bid_field")
 	userId, _ := p.GetSession("userId").(string)
 	baseUserId := p.GetSession("base_user_id")
-	// 如果是领域化数据
+	searchGroup, _ := p.GetInteger("searchGroup") //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+	vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
+	// 如果是领域化数据j
 	if bidField != "" {
 		if domainPageType, ok := DomainPageType[bidField]; ok {
 			pageType = domainPageType
+			//bidField = domainPageType
 		}
-		vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
+		//领域化数据 如果没有权限直接返回空数据
 		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
 			p.ServeJson(map[string]interface{}{
 				"list":      []map[string]interface{}{},
 				"count":     0,
 				"totalPage": 0,
+				"total":     0,
 			})
 			return nil
 		}
 	}
-	rs := Newbids(pageType, userId)
-	var list []map[string]interface{}
-	if len(rs) >= 0 {
-		//标讯数据提取
-		list = rs[(pagenum-1)*pageSize : pagenum*pageSize]
-	}
-
+	so := &SearchOptimize{
+		UserId:      userId,
+		PageNum:     pagenum,
+		PageSize:    pageSize,
+		BidField:    bidField,
+		NewUserId:   util.Int64All(baseUserId),
+		SearchGroup: searchGroup,
+		IsPay:       vipStatus.IsPayedUser(),
+	}
+	//搜索条件处理
+	so.SearchParamsHandle()
+	var (
+		list         []*map[string]interface{}
+		count, total int64
+	)
+	list, count, total = so.GetBidSearchListByCache()
 	if pageType == "" { //最新招标信息仅第一页条展示表格多字段
 		for k, v := range list {
 			if pagenum == 1 && k < 20 {
 				continue
 			}
-			// delete(v, "areaadd")
-			delete(v, "bidopentime")
-			delete(v, "buyer")
-			// delete(v, "indadd")
-			delete(v, "k")
-			delete(v, "projectcode")
-			delete(v, "projectname")
-			// delete(v, "stypeadd")
-			delete(v, "winner")
-			delete(v, "timetemp")
-			delete(v, "budget")
-			delete(v, "s_subscopeclass")
-			delete(v, "toptype")
+			delete((*v), "bidopentime")
+			delete((*v), "buyer")
+			delete((*v), "k")
+			delete((*v), "projectcode")
+			delete((*v), "projectname")
+			delete((*v), "winner")
+			delete((*v), "timetemp")
+			delete((*v), "budget")
+			delete((*v), "s_subscopeclass")
+			delete((*v), "toptype")
 		}
 	}
-	count, totalPage := 500, 10
-	if userId == "" {
-		count = bidsearch.SearchMaxPageCount_NOLOGIN
-		totalPage = 100
-	}
 	p.ServeJson(map[string]interface{}{
 		"list":      list,
 		"count":     count,
-		"totalPage": totalPage,
+		"total":     total,
+		"totalPage": (count + 1) / int64(pageSize),
 	})
 	return nil
 }
 
+// PcSearchIndex 路由搜索
 func (p *Pcsearch) PcSearchIndex(module string) error {
 	defer util.Catch()
 	p.T["logid"] = config.Seoconfig["jysslby"].(string)
-	// 领域化标识
-	bidField := p.GetString("bid_field")
 	pageSize, _ := p.GetInteger("pageSize")
 	if pageSize == 0 {
 		pageSize = 50
 	}
-
-	switch module {
-	case "medical": // 领域类型  医疗-0101
-		if bidField == "" {
-			bidField = "0101"
-		}
-	default:
-		bidField = ""
-	}
-
 	keywords := p.GetString("keywords")
 	industry := strings.TrimSpace(p.GetString("industry")) //选中的行业
 	area := p.GetString("area")                            //地区
@@ -330,8 +328,14 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	minprice := p.GetString("minprice")                    //最低价格
 	maxprice := p.GetString("maxprice")                    //最高价格
 	fileExists := p.GetString("fileExists")                //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
-
+	//搜索优化P260--start--
+	searchGroup, _ := p.GetInteger("searchGroup")     //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+	searchMode, _ := p.GetInteger("searchMode")       //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
+	wordsMode, _ := p.GetInteger("wordsMode")         //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
+	additionalWords := p.GetString("additionalWords") //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
+	//--end--
 	userId, _ := p.GetSession("userId").(string)
+	phone, _ := p.GetSession("phone").(string)
 	baseUserId := p.GetSession("base_user_id")
 	noLoginBl := false
 	if userId == "" {
@@ -342,16 +346,29 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 		}
 	}
 	//高级筛选 仅vip用户可查询
-	var hasBuyerTel, hasWinnerTel string = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
-	var buyerclass string = ""                    //采购单位类别
-	var notkey string = ""                        //排除词
-	var city string = ""                          //城市 付费用户可用
-
+	var (
+		hasBuyerTel, hasWinnerTel = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
+		buyerclass                = ""     //采购单位类别
+		notkey                    = ""     //排除词
+		city                      = ""     //城市 付费用户可用
+	)
+	// 领域化标识
+	territorialization := p.GetString("bid_field")
+	switch module {
+	case "medical": // 领域类型  医疗-0101
+		if territorialization == "" {
+			territorialization = "0101"
+		}
+	default:
+		territorialization = ""
+	}
 	selectType := p.GetString("selectType")
 	if selectType == "" {
 		selectType = "title,content"
 	}
-	isPayedUser, publishtime, queryItems, _, _ := bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), 0, pageSize, p.Session(), *config.Middleground)
+	userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
+	queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
+	isPayedUser := userInfo.IsPayedUser()
 	if isPayedUser {
 		buyerclass = p.GetString("buyerclass")
 		hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
@@ -375,12 +392,17 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 		notkey = util.ObjToString(p.GetSession("Echo_notkey"))
 		fileExists = util.ObjToString(p.GetSession("Echo_fileExists"))
 		city = util.ObjToString(p.GetSession("Echo_city"))
-		bidField = util.ObjToString(p.GetSession("Echo_bid_field")) // 领域化数据 0101-医疗行业
-		_, _, queryItems, _, _ = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), 0, pageSize, p.Session(), *config.Middleground)
+		bidField = util.ObjToString(p.GetSession("Echo_bid_field"))              // 领域化数据 0101-医疗行业
+		territorialization = util.ObjToString(p.GetSession("Echo_bid_field"))    // 领域化数据 0101-医疗行业
+		searchGroup = util.IntAll(p.GetSession("Echo_searchGroup"))              //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+		searchMode = util.IntAll(p.GetSession("Echo_searchMode"))                //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
+		wordsMode = util.IntAll(p.GetSession("Echo_wordsMode"))                  //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
+		additionalWords = util.ObjToString(p.GetSession("Echo_additionalWords")) //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
+		queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
 	}
 	keywordsLimit := util.IntAllDef(config.Sysconfig["keywordsLimit"], 35)
 	searchLimit := public.IsSearchLimit(queryItems)
-
+	//-----------------------------未登录用户支持非单字符查询--------------------------
 	if userId == "" {
 		keywordsLimit = util.IntAllDef(config.Sysconfig["keywordsLimitNologin"], 25)
 		//未登录用户标题、正文都限制,已登录用户只限制正文
@@ -390,20 +412,21 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 			keywords = ""
 		}
 	}
-	b_word, a_word, s_word := "", "", ""
+	var (
+		list                               []*map[string]interface{}
+		count, total                       int64
+		secondFlag                         = ""
+		isSearch                           = true
+		b_word, a_word, s_word, heightKeys = "", "", "", ""
+	)
 	if keywords != "" {
 		b_word, a_word, s_word = jy.InterceptSearchKW(keywords, keywordsLimit, len(industry) == 0)
 	}
-	var list *[]map[string]interface{}
-	var status = 1
-	var count, totalPage int64
-	secondFlag := ""
-	secondKWS := ""
-	isSearch := true
-	if bidField != "" {
+	//医疗领域化信息 用户前提是大会员 超级订阅,才有领域化功能的权限
+	if territorialization != "" {
 		isSearch = false
-		vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
-		if vipStatus.BigMember > 0 || vipStatus.VipState > 0 {
+		userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
+		if userInfo.BigMember > 0 || userInfo.VipState > 0 {
 			if jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode) {
 				isSearch = true
 			}
@@ -411,14 +434,11 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	}
 	isLimit := 1
 	if isSearch {
-		if len(s_word) > 0 || len(industry) > 0 {
-			searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
-			status = 2
-			field := bidSearch_field_1
-			if bidField != "" { // 如果是领域化数据
-				field = bidSearch_domain_field_1
-			}
-
+		searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
+		so := NewSearchOptimize(userId, phone, area, city, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, 0, pageSize, searchGroup, searchMode, wordsMode, *userInfo, searchTypeSwitch)
+		heightKeys = so.HeightKeys //主关键词和附加词合并,多组空格隔开,作为前端渲染高亮关键词使用
+		//关键词  行业 附加词
+		if len(s_word) > 0 || len(industry) > 0 || strings.TrimSpace(so.AdditionalWords) != "" {
 			if searchLimit {
 				isLimit = public.Lst.IsLimited(p.Request, p.ResponseWriter, p.Session(), isPayedUser)
 				if isLimit == 1 { //没有被限制
@@ -426,93 +446,84 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 				}
 			}
 			if isLimit == 1 {
-				secondKWS, _, _, _, secondFlag, count, totalPage, list = bidsearch.SearchData("pc", p.Request, 1, util.ObjToString(p.GetSession("userId")), secondKWS, s_word, area, city, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, fileExists, 0, true, queryItems, field, notkey, isPayedUser, searchTypeSwitch, bidField, pageSize, config.Sysconfig)
+				count, total, list = so.GetBidSearchList(false)
 			}
 		} else {
 			p.DisableHttpCache()
-			pageType := ""
-			// 如果是领域化数据
-			if bidField != "" {
-				if domainPageType, ok := DomainPageType[bidField]; ok {
-					pageType = domainPageType
-				}
-			}
-			p.T["list"] = PCS_list(pageType, pageSize, userId) //Newbids("")[0]
-			count, totalPage = 500, 10
-			if userId == "" {
-				//未登录用户可查看5000条
-				count, totalPage = bidsearch.SearchMaxPageCount_NOLOGIN, 100
-			}
+			list, count, total = so.GetBidSearchListByCache()
 		}
 	}
-
-	if status == 2 {
-		secondList, tp, _ := bidsearch.LisetData(1, 0, list, secondFlag, config.Seoconfig, isPayedUser, pageSize, userId)
-		if tp == 1 {
-			p.T["secondList"] = ""
-			totalPage = 1
-		} else if len(secondList) > 0 {
-			p.T["secondList"] = secondList
-		}
-		if secondKWS != "" {
-			s_word = s_word + "+" + secondKWS
-		}
-		if noLoginBl {
-			subtype = ""
-		}
-		p.T["list"] = list
-		p.T["secondFlag"] = secondFlag
-		p.T["area"] = area
-		p.T["publishtime"] = publishtime
-		p.T["timeslot"] = timeslot
-		p.T["toptype"] = toptype
-		p.T["subtype"] = subtype
-		p.T["searchvalue"] = s_word
-		p.T["minprice"] = minprice
-		p.T["maxprice"] = maxprice
-		p.T["buyerclass"] = buyerclass
-		p.T["buyertel"] = hasBuyerTel
-		p.T["winnertel"] = hasWinnerTel
-		p.T["notkey"] = notkey
-		p.T["fileExists"] = fileExists
-		p.T["city"] = city
-		p.T["bid_field"] = bidField
-		p.SetSession("paramkey", b_word)
-		switch publishtime {
-		case "lately-7":
-			p.SetSession("parampublishtime", "最近7天")
-		case "lately-30":
-			p.SetSession("parampublishtime", "最近30天")
-		case "thisyear":
-			p.SetSession("parampublishtime", "近一年")
-		case "threeyear":
-			p.SetSession("parampublishtime", "近三年")
-		case "fiveyear":
-			p.SetSession("parampublishtime", "近五年")
-		default:
-			p.SetSession("parampublishtime", publishtime)
-		}
-		p.SetSession("paramarea", area)
-		if subtype != "" {
-			p.SetSession("paraminfotype", subtype)
-		} else {
-			p.SetSession("paraminfotype", toptype)
-		}
+	if noLoginBl {
+		subtype = ""
+	}
+	p.T["list"] = list
+	p.T["secondFlag"] = secondFlag
+	p.T["area"] = area
+	p.T["publishtime"] = publishtime
+	p.T["timeslot"] = timeslot
+	p.T["toptype"] = toptype
+	p.T["subtype"] = subtype
+	p.T["searchvalue"] = keywords //搜索关键词
+	p.T["minprice"] = minprice
+	p.T["maxprice"] = maxprice
+	p.T["buyerclass"] = buyerclass
+	p.T["buyertel"] = hasBuyerTel
+	p.T["winnertel"] = hasWinnerTel
+	p.T["notkey"] = notkey
+	p.T["fileExists"] = fileExists
+	p.T["city"] = city
+	p.T["bid_field"] = territorialization
+	p.SetSession("paramkey", b_word)
+	switch publishtime {
+	case "lately-7":
+		p.SetSession("parampublishtime", "最近7天")
+	case "lately-30":
+		p.SetSession("parampublishtime", "最近30天")
+	case "thisyear":
+		p.SetSession("parampublishtime", "近一年")
+	case "threeyear":
+		p.SetSession("parampublishtime", "近三年")
+	case "fiveyear":
+		p.SetSession("parampublishtime", "近五年")
+	default:
+		p.SetSession("parampublishtime", publishtime)
+	}
+	p.SetSession("paramarea", area)
+	if subtype != "" {
+		p.SetSession("paraminfotype", subtype)
+	} else {
+		p.SetSession("paraminfotype", toptype)
 	}
+	//}
 	p.T["selectType"] = selectType
 	p.T["login"] = p.Session().Get("user")
 	p.T["count"] = count
-	p.T["totalPage"] = totalPage
-	p.T["keywords"] = b_word
+	p.T["totalPage"] = (count + 1) / int64(pageSize)
+	p.T["keywords"] = keywords      //搜索关键词
+	p.T["heightWords"] = heightKeys //主关键词和附加词合并后
 	p.T["industry"] = industry
 	p.T["industrylist"] = industrylist
 	p.T["sortArray"] = sortArray
 	p.T["showVipScreen"] = isPayedUser
-	p.T["bidField"] = bidField
+	p.T["bidField"] = territorialization
 	p.T["module"] = module
-	p.T["interceptWord"] = a_word
+	p.T["interceptKeyWords"] = b_word   //超出限制关键词限制长度 截取后
+	p.T["interceptOtherWords"] = a_word //超出限制关键词限制长度 截取后 提示关键词
 	p.T["interceptLimit"] = keywordsLimit
 	//
+	p.T["searchGroup"] = searchGroup
+	p.T["searchMode"] = searchMode
+	p.T["wordsMode"] = wordsMode
+	p.T["additionalWords"] = additionalWords
+	p.T["total"] = total
+
+	p.T["isVip"] = userInfo.VipState > 0
+	p.T["isMember"] = userInfo.BigMember > 0
+	p.T["isEntniche"] = userInfo.EntMember > 0
+	p.T["isEntnicheNew"] = userInfo.IsNewEnt
+	p.T["isEntService"] = userInfo.EntService
+	p.T["vipBefore202209"] = userInfo.VipState > 0 && userInfo.VipStartData < util.Int64All(config.Sysconfig["contextOldVipLimit"]) //超级订阅 超强项目
+	//
 	if userId != "" {
 		//企业画像 权限
 		p.T["portraitpower"] = jylabutil.IsAuthorized(userId, "i_portraitpower")
@@ -521,6 +532,7 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	return p.Render("/pc/supsearch.html", &p.T)
 }
 
+// Newbids  最新招标信息
 func Newbids(p, userId string) []map[string]interface{} {
 	//fmt.Println("11111", redis.Get("newother", "index_list"))
 	nologin := ""
@@ -630,7 +642,7 @@ func duplicateRemoval(ss []map[string]interface{}) []map[string]interface{} {
 	return data
 }
 
-var topType = map[string]string{
+var topTypeMap = map[string]string{
 	"招标预告":   "预告",
 	"招标公告":   "招标",
 	"招标结果":   "结果",
@@ -653,7 +665,7 @@ func top500(subtype string, bidField string, userId string) (list *[]map[string]
 			var subTypes []string
 
 			for _, v := range strings.Split(subtype, ",") {
-				if v1, ok := topType[v]; ok {
+				if v1, ok := topTypeMap[v]; ok {
 					topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
 				} else {
 					subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))

+ 1226 - 1097
src/jfw/front/swordfish.go

@@ -43,9 +43,14 @@ var (
     bidSearch_sort           = `{"dataweight":-1,"publishtime":-1}`
     bidSearch_field_file     = `,"filetext","isValidFile"`
     bidSearch_domain_field_1 = bidSearch_field_1 + `,"purchasing","s_winner","buyer"` + bidSearch_field_file //领域数据字段基本字段
+
+	BidSearchFieldBase   = `"_id","title","publishtime","dataweight","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","spidercode","site","projectname","projectcode"`                        //搜索列表基础字段
+	BidSearchFieldOfVip  = BidSearchFieldBase + `,"buyer","buyertel","buyerperson","agency","agencytel","agencyperson","s_winner","winnertel","winnerperson","signendtime","bidendtime","bidopentime","budget","projectinfo","entidlist"` //付费列表字段
+	BidSearchFieldFile   = `,"isValidFile"`
+	BidSearchDomainField = BidSearchFieldOfVip + `,"purchasing"` //领域数据字段基本字段
 )
 
-// 剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
+// Praise 剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
 func (m *Front) Praise() error {
     defer util.Catch()
     var flag = "F"
@@ -79,8 +84,117 @@ func (m *Front) Searchinfolist(p string) error {
     return m.Redirect("/jylab/supsearch/index.html")
 }
 
-// ajax分页请求
+// PcAjaxReq ajax分页请求
 func (m *Front) PcAjaxReq() {
+	territorialization := m.GetString("bid_field") // 领域类型 0101- 医疗
+	tabularflag := m.GetString("tabularflag")
+	userId := util.ObjToString(m.GetSession("userId"))
+	phone := util.ObjToString(m.GetSession("phone"))
+	baseUserId := m.GetSession("base_user_id")
+	currentPage, _ := m.GetInteger("pageNumber")
+	pageSize, _ := m.GetInteger("pageSize")
+	if pageSize == 0 {
+		pageSize = 50
+	}
+	//userId = "63c11681800b227df5874680"//免费
+	//userId = "63d5cc0098f6fae01592ea7f" //付费
+	if tabularflag == "Y" && userId == "" {
+		//判断用户是否登录进行表格查询,否则返回基本数据
+		tabularflag = ""
+	}
+	userInfo := jy.GetVipState(m.Session(), *config.Middleground, userId)
+	if territorialization != "" { // 如果是领域化数据 判断是否是付费用户 是否有权限
+		if (userInfo.BigMember <= 0 && userInfo.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
+			m.ServeJson(map[string]interface{}{
+				"list": []map[string]interface{}{},
+			})
+			return
+		}
+	}
+
+	area := m.GetString("area")
+	subtype := m.GetString("subtype")
+	toptype := m.GetString("toptype") //信息类型
+	publishtime := m.GetString("publishtime")
+	selectType := m.GetString("selectType")
+	if selectType == "" {
+		selectType = "title,content"
+	}
+	industry := strings.TrimSpace(m.GetString("industry"))
+	minprice := m.GetString("minprice")               //最低价格
+	maxprice := m.GetString("maxprice")               //最高价格
+	fileExists := m.GetString("fileExists")           //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
+	searchGroup, _ := m.GetInteger("searchGroup")     //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+	searchMode, _ := m.GetInteger("searchMode")       //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
+	wordsMode, _ := m.GetInteger("wordsMode")         //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
+	additionalWords := m.GetString("additionalWords") //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
+	var (
+		//高级筛选 仅付费用户可查询
+		hasBuyerTel, hasWinnerTel string //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
+		buyerclass                string //采购单位类别
+		notkey                    string //排除词
+		isPayedUser               bool
+		queryItems                []string
+		city                      string //城市
+		count, total              int64
+		isLimit                   = 1
+		list                      []*map[string]interface{}
+		heightKeys                string //需要高亮的关键词
+	)
+	queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
+	isPayedUser = userInfo.IsPayedUser()
+	if isPayedUser {
+		buyerclass = m.GetString("buyerclass")
+		hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
+		notkey = util.If(strings.Contains(m.GetString("notkey"), ","), strings.ReplaceAll(m.GetString("notkey"), ",", " "), m.GetString("notkey")).(string)
+		city = m.GetString("city")
+	}
+	if userId == "" {
+		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
+		if subtype == "" {
+			subtype = "招标预告,招标公告,招标结果,招标信用信息"
+		}
+	}
+	b_word, a_word, s_word := jy.InterceptSearchKW(m.GetString("searchvalue"), util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), len(industry) == 0)
+	if len(s_word) > 0 || len(industry) > 0 || strings.TrimSpace(additionalWords) != "" {
+		searchLimit := public.IsSearchLimit(queryItems)
+		//未登录用户标题、正文都限制,已登录用户只限制正文
+		if userId == "" {
+			searchLimit = true
+		}
+		//全文检索限制
+		if searchLimit {
+			//limitFlag = public.Lst.Flag
+			isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
+			if isLimit == 1 { //没有被限制
+				defer public.Lst.Limit()
+			}
+		}
+		if isLimit == 1 {
+			searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
+			so := NewSearchOptimize(userId, phone, area, city, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, currentPage, pageSize, searchGroup, searchMode, wordsMode, *userInfo, searchTypeSwitch)
+			m.SetSession("selectType", so.SelectType)
+			heightKeys = so.HeightKeys
+			count, total, list = so.GetBidSearchList(false)
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"limitFlag":          false,
+		"status":             isLimit,
+		"list":               list,
+		"count":              count,
+		"total":              total,
+		"totalPage":          (count + 1) / int64(pageSize),
+		"interceptOtherWord": a_word,                                                //截取后 用于提示的关键词
+		"interceptKeyWords":  b_word,                                                //超出限制长度 截取后的关键词
+		"interceptLimit":     util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), //限制额度
+		"keywords":           m.GetString("searchvalue"),                            //关键词
+		"heightWords":        heightKeys,                                            //需要高亮的关键词词组  主关键词和附加词合并
+	})
+}
+
+// PcAjaxReq_bak  ajax分页请求 备份
+func (m *Front) PcAjaxReq_Bak() {
     bidField := m.GetString("bid_field") // 领域类型 0101- 医疗
     tabularflag := m.GetString("tabularflag")
     userId := util.ObjToString(m.GetSession("userId"))
@@ -207,6 +321,7 @@ func (m *Front) PcAjaxReq() {
         "status":         isLimit,
         "list":           list,
         "count":          count,
+		"total":          config.Sysconfig["defaultTotal"],
         "totalPage":      totalPage,
         "interceptWord":  a_word,
         "interceptLimit": util.IntAllDef(config.Sysconfig["keywordsLimit"], 35),
@@ -803,152 +918,152 @@ func (m *Front) PcVisitRedirect(sid string) {
 
 // 数据转换
 func bidDataConvert(id string, datas *[]map[string]interface{}) (array []map[string]interface{}) {
-    if datas == nil || len(*datas) == 0 {
-        return array
-    }
-    index := 0
-    public.BidListConvert("", datas)
-    for _, v := range *datas {
-        if len(array) >= 10 {
-            break
-        }
-        _id, _ := v["_id"].(string)
-        if _id == id {
-            continue
-        }
-        v["_id"] = encrypt.EncodeArticleId2ByCheck(_id)
-        area, _ := v["area"].(string)
-        if area == "A" {
-            v["area"] = ""
-        }
-        tp, _ := v["subtype"].(string)
-        if tp == "" {
-            tp, _ = v["toptype"].(string)
-        }
-        if tp == "" {
-            tp, _ = v["type"].(string)
-            if tp == "bid" {
-                tp = "中标"
-            } else if tp == "tender" {
-                tp = "招标"
-            } else {
-                tp = ""
-            }
-        }
-        indtry := util.ObjToString(v["industry"])
-        v["stypeadd"], v["areaadd"], v["indadd"] = classify(tp, area, indtry)
-        v["type"] = tp
-        diff := ""
-        publishtime, _ := v["publishtime"].(float64)
-        if publishtime != 0 {
-            diff = util.TimeDiff(time.Unix(util.Int64All(publishtime), 0))
-            v["pbtime"] = util.Int64All(publishtime)
-        }
-        v["publishtime"] = diff
-        index++
-        v["index"] = index
-        array = append(array, v)
-    }
-    return array
+	if datas == nil || len(*datas) == 0 {
+		return array
+	}
+	index := 0
+	public.BidListConvert("", datas)
+	for _, v := range *datas {
+		if len(array) >= 10 {
+			break
+		}
+		_id, _ := v["_id"].(string)
+		if _id == id {
+			continue
+		}
+		v["_id"] = encrypt.EncodeArticleId2ByCheck(_id)
+		area, _ := v["area"].(string)
+		if area == "A" {
+			v["area"] = ""
+		}
+		tp, _ := v["subtype"].(string)
+		if tp == "" {
+			tp, _ = v["toptype"].(string)
+		}
+		if tp == "" {
+			tp, _ = v["type"].(string)
+			if tp == "bid" {
+				tp = "中标"
+			} else if tp == "tender" {
+				tp = "招标"
+			} else {
+				tp = ""
+			}
+		}
+		indtry := util.ObjToString(v["industry"])
+		v["stypeadd"], v["areaadd"], v["indadd"] = classify(tp, area, indtry)
+		v["type"] = tp
+		diff := ""
+		publishtime, _ := v["publishtime"].(float64)
+		if publishtime != 0 {
+			diff = util.TimeDiff(time.Unix(util.Int64All(publishtime), 0))
+			v["pbtime"] = util.Int64All(publishtime)
+		}
+		v["publishtime"] = diff
+		index++
+		v["index"] = index
+		array = append(array, v)
+	}
+	return array
 }
 
 // 剑鱼标讯保存
 func (m *Front) AjaxReq() error {
-    defer util.Catch()
-    reqType := m.GetString("reqType")
-    var flag = "n"
-    switch reqType {
-    case "feedback": //意见反馈
-        data := make(map[string]interface{})
-        userId, ok := m.GetSession("userId").(string)
-        if !ok || userId == "" {
-            break
-        }
+	defer util.Catch()
+	reqType := m.GetString("reqType")
+	var flag = "n"
+	switch reqType {
+	case "feedback": //意见反馈
+		data := make(map[string]interface{})
+		userId, ok := m.GetSession("userId").(string)
+		if !ok || userId == "" {
+			break
+		}
         userInfo := jyutil.Compatible.Select(userId, `{"s_nickname":1,"s_name":1,"s_phone":1}`)
         if userInfo == nil {
-            break
-        }
-        data["i_type"] = 8
-        data["s_fromName"] = m.GetString("fromName")
-        value := m.GetString("value")
-        if len([]rune(value)) > 200 {
-            value = util.SubString(value, 0, 200)
-        }
-        data["s_remark"] = value
-        s_nickname := ""
-        if (*userInfo)["s_nickname"] != nil {
-            s_nickname, _ = (*userInfo)["s_nickname"].(string)
-        }
-        s_name := ""
-        if (*userInfo)["s_name"] != nil {
-            s_name, _ = (*userInfo)["s_name"].(string)
-        }
-        s_phone, _ := (*userInfo)["s_phone"].(string)
-        if s_name != "" {
-            data["s_submitname"] = s_name
-        } else if s_nickname != "" {
-            data["s_submitname"] = s_nickname
-        } else if s_phone != "" {
-            data["s_submitname"] = s_phone
-        } else {
-            data["s_submitname"] = userId
-        }
-        data["s_submitid"] = userId
-        data["s_title"] = m.GetString("title")
-        data["i_status"] = 0
-        if s_nickname != "" { //昵称
-            data["s_username"] = s_nickname
-        } else if s_name != "" { //s_name
-            data["s_username"] = s_name
-        } else if s_phone != "" { //s_name
-            data["s_username"] = s_phone
-        } else { //s_name
-            data["s_username"] = userId
-        }
-        data["l_submitdate"] = time.Now().Unix()
-        data["s_source"] = m.GetString("source")
-        data["s_fkid"] = m.GetString("fkid")
-        data["s_from"] = "wx"
-        id := mongodb.Save("interaction", data)
-        if len(id) > 0 {
-            flag = "y"
-        }
-        break
-    case "subscribe": //直接订阅
-        if userid := m.GetSession("userId"); userid != nil {
-            o_jy := jy.GetSubScribeInfo(m.Session(), mongodb, "f", "10000")
-            a_key, _ := (*o_jy)["a_key"].([]interface{})
-            keysArray := processKeyword(m.GetString("keys"))
-            if keysArray == nil {
-                break
-            }
-            var isExists bool
-            for _, v := range a_key {
-                //count := 0
-                //for _, kay := range keysArray {
-                keyMap, _ := v.(map[string]interface{})
-                key, _ := keyMap["key"].([]interface{})
-                kystr := ""
-                for _, ky := range key {
-                    kystr = kystr + " " + ky.(string)
-                }
-                if strings.TrimSpace(m.GetString("keys")) == strings.TrimSpace(kystr) {
-                    isExists = true
-                    flag = "y"
-                    break
-                }
-                //}
-                //if count == len(keysArray) {
-                //	isExists = true
-                //	flag = "y"
-                //	break
-                //}
-            }
-            //如果不存在
-            if !isExists {
-                if len(a_key) >= 10 {
-                    flag = "o"
-                } else {
+			break
+		}
+		data["i_type"] = 8
+		data["s_fromName"] = m.GetString("fromName")
+		value := m.GetString("value")
+		if len([]rune(value)) > 200 {
+			value = util.SubString(value, 0, 200)
+		}
+		data["s_remark"] = value
+		s_nickname := ""
+		if (*userInfo)["s_nickname"] != nil {
+			s_nickname, _ = (*userInfo)["s_nickname"].(string)
+		}
+		s_name := ""
+		if (*userInfo)["s_name"] != nil {
+			s_name, _ = (*userInfo)["s_name"].(string)
+		}
+		s_phone, _ := (*userInfo)["s_phone"].(string)
+		if s_name != "" {
+			data["s_submitname"] = s_name
+		} else if s_nickname != "" {
+			data["s_submitname"] = s_nickname
+		} else if s_phone != "" {
+			data["s_submitname"] = s_phone
+		} else {
+			data["s_submitname"] = userId
+		}
+		data["s_submitid"] = userId
+		data["s_title"] = m.GetString("title")
+		data["i_status"] = 0
+		if s_nickname != "" { //昵称
+			data["s_username"] = s_nickname
+		} else if s_name != "" { //s_name
+			data["s_username"] = s_name
+		} else if s_phone != "" { //s_name
+			data["s_username"] = s_phone
+		} else { //s_name
+			data["s_username"] = userId
+		}
+		data["l_submitdate"] = time.Now().Unix()
+		data["s_source"] = m.GetString("source")
+		data["s_fkid"] = m.GetString("fkid")
+		data["s_from"] = "wx"
+		id := mongodb.Save("interaction", data)
+		if len(id) > 0 {
+			flag = "y"
+		}
+		break
+	case "subscribe": //直接订阅
+		if userid := m.GetSession("userId"); userid != nil {
+			o_jy := jy.GetSubScribeInfo(m.Session(), mongodb, "f", "10000")
+			a_key, _ := (*o_jy)["a_key"].([]interface{})
+			keysArray := processKeyword(m.GetString("keys"))
+			if keysArray == nil {
+				break
+			}
+			var isExists bool
+			for _, v := range a_key {
+				//count := 0
+				//for _, kay := range keysArray {
+				keyMap, _ := v.(map[string]interface{})
+				key, _ := keyMap["key"].([]interface{})
+				kystr := ""
+				for _, ky := range key {
+					kystr = kystr + " " + ky.(string)
+				}
+				if strings.TrimSpace(m.GetString("keys")) == strings.TrimSpace(kystr) {
+					isExists = true
+					flag = "y"
+					break
+				}
+				//}
+				//if count == len(keysArray) {
+				//	isExists = true
+				//	flag = "y"
+				//	break
+				//}
+			}
+			//如果不存在
+			if !isExists {
+				if len(a_key) >= 10 {
+					flag = "o"
+				} else {
                     if jyutil.Compatible.Update(util.ObjToString(userid),
                         bson.M{
                             "$push": bson.M{"o_jy.a_key": bson.M{"key": keysArray, "notkey": []string{}, "from": 1}},
@@ -956,6 +1071,20 @@ func (m *Front) AjaxReq() error {
                         }) {
                         flag = "y"
                     }
+					} else {
+						query := map[string]interface{}{
+							"i_userid": util.Int64All(m.GetSession("entUserId")),
+							"i_entid":  util.Int64All(m.GetSession("entId")),
+							"i_type":   1,
+						}
+						if mongodb.Update("entniche_rule", query,
+							bson.M{
+								"$push": bson.M{"o_entniche.a_key": bson.M{"key": keysArray, "notkey": []string{}, "from": 1}},
+								"$set":  bson.M{"i_ts_guide": 1, "o_entniche.l_modifydate": time.Now().Unix()},
+							}, true, false) {
+							flag = "y"
+						}
+					}
 
                 }
             }
@@ -969,96 +1098,96 @@ func (m *Front) AjaxReq() error {
 }
 
 const (
-    INDEX = "bidding"
-    TYPE  = "bidding"
-    FINDF = `"title"`
+	INDEX = "bidding"
+	TYPE  = "bidding"
+	FINDF = `"title"`
 )
 
 // 预览结果
 func (m *Front) WxpushView() error {
-    defer util.Catch()
-    userid := util.ObjToString(m.GetSession("userId"))
-    openid := util.ObjToString(m.GetSession("s_m_openid"))
-    pageSize, _ := m.GetInteger("pageSize")
-    if openid == "" || userid == "" {
-        return m.Redirect("/swordfish/share/-1")
-    }
-    a_key, list := public.PushViewDatas(userid, "", bidSearch_field_1, 1, pageSize)
-    public.BidListConvert("", list)
-    m.T["firstPage"] = list
-    m.T["hasNextPage"] = list != nil && len(*list) == pageSize
-    m.T["pageSize"] = pageSize
-    m.T["a_key"] = a_key
-    mynickname, _ := m.Session().Get("s_nickname").(string)
-    myavatar, _ := m.Session().Get("s_avatar").(string)
-    m.T["nickname"] = mynickname
-    m.T["avatar"] = myavatar
-    m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-    m.T["openid"] = se.EncodeString(openid)
-    return m.Render("/weixin/resultpreview.html", &m.T)
+	defer util.Catch()
+	userid := util.ObjToString(m.GetSession("userId"))
+	openid := util.ObjToString(m.GetSession("s_m_openid"))
+	pageSize, _ := m.GetInteger("pageSize")
+	if openid == "" || userid == "" {
+		return m.Redirect("/swordfish/share/-1")
+	}
+	a_key, list := public.PushViewDatas(userid, "", bidSearch_field_1, 1, pageSize)
+	public.BidListConvert("", list)
+	m.T["firstPage"] = list
+	m.T["hasNextPage"] = list != nil && len(*list) == pageSize
+	m.T["pageSize"] = pageSize
+	m.T["a_key"] = a_key
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	m.T["openid"] = se.EncodeString(openid)
+	return m.Render("/weixin/resultpreview.html", &m.T)
 }
 func (m *Front) WxpushViewPaging() {
-    defer util.Catch()
-    var list *[]map[string]interface{}
-    pageNum, _ := m.GetInteger("pageNum")
-    pageSize, _ := m.GetInteger("pageSize")
-    if userid := m.Session().Get("userId"); userid != nil {
-        _, list = public.PushViewDatas(userid.(string), "", bidSearch_field_1, pageNum, pageSize)
-    }
-    public.BidListConvert("", list)
-    m.ServeJson(map[string]interface{}{
-        "list":        list,
-        "hasNextPage": list != nil && len(*list) == bidsearch.SearchMaxPageCount_WX,
-    })
+	defer util.Catch()
+	var list *[]map[string]interface{}
+	pageNum, _ := m.GetInteger("pageNum")
+	pageSize, _ := m.GetInteger("pageSize")
+	if userid := m.Session().Get("userId"); userid != nil {
+		_, list = public.PushViewDatas(userid.(string), "", bidSearch_field_1, pageNum, pageSize)
+	}
+	public.BidListConvert("", list)
+	m.ServeJson(map[string]interface{}{
+		"list":        list,
+		"hasNextPage": list != nil && len(*list) == bidsearch.SearchMaxPageCount_WX,
+	})
 }
 
 func (m *Front) Guide(sign string) error {
-    defer util.Catch()
-    if m.Session().Get("userId") == nil || m.Session().Get("s_m_openid") == nil {
-        return m.Redirect("/swordfish/share/-1")
-    }
-    m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-    mynickname, _ := m.Session().Get("s_nickname").(string)
-    myavatar, _ := m.Session().Get("s_avatar").(string)
-    m.T["nickname"] = mynickname
-    m.T["avatar"] = myavatar
-    myopenid, _ := m.Session().Get("s_m_openid").(string)
-    m.T["openid"] = se.EncodeString(myopenid)
-    m.T["sign"] = sign
-    if sign == "other" {
+	defer util.Catch()
+	if m.Session().Get("userId") == nil || m.Session().Get("s_m_openid") == nil {
+		return m.Redirect("/swordfish/share/-1")
+	}
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	m.T["openid"] = se.EncodeString(myopenid)
+	m.T["sign"] = sign
+	if sign == "other" {
         userInfo := jyutil.Compatible.Select(m.GetSession("userId").(string), `{"o_jy_msgset":1}`)
         if userInfo == nil {
-            m.T["msgset"] = (*userInfo)["o_jy_msgset"]
-        }
-    }
-    if sign == "share" {
-        return m.Render("/weixin/wxshareguide.html", &m.T)
-    } else {
-        return m.Render("/weixin/wxindex.html", &m.T)
-    }
+			m.T["msgset"] = (*userInfo)["o_jy_msgset"]
+		}
+	}
+	if sign == "share" {
+		return m.Render("/weixin/wxshareguide.html", &m.T)
+	} else {
+		return m.Render("/weixin/wxindex.html", &m.T)
+	}
 }
 
 func (m *Front) Share(openids string) error {
-    return m.Redirect("/swordfish/about")
-    //
-    defer util.Catch()
-    var openid = ""
-    var jy_code = ""
-    if openids != "-1" {
-        wxid_code := strings.Split(openids, "__")
-        if len(wxid_code) > 0 {
-            openid = wxid_code[0]
-            jy_code = wxid_code[1]
-        }
-    }
-    m.T["openid"] = openid
-    m.T["jy_code"] = jy_code
-    m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-    mynickname, _ := m.Session().Get("s_nickname").(string)
-    myavatar, _ := m.Session().Get("s_avatar").(string)
-    m.T["nickname"] = mynickname
-    m.T["avatar"] = myavatar
-    return m.Render("/weixin/wxshare.html", &m.T)
+	return m.Redirect("/swordfish/about")
+	//
+	defer util.Catch()
+	var openid = ""
+	var jy_code = ""
+	if openids != "-1" {
+		wxid_code := strings.Split(openids, "__")
+		if len(wxid_code) > 0 {
+			openid = wxid_code[0]
+			jy_code = wxid_code[1]
+		}
+	}
+	m.T["openid"] = openid
+	m.T["jy_code"] = jy_code
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	return m.Render("/weixin/wxshare.html", &m.T)
 }
 
 /*func (m *Front) WxpushAjaxReq() error {
@@ -1072,973 +1201,973 @@ func (m *Front) Share(openids string) error {
 }*/
 
 func (m *Front) About() error {
-    defer util.Catch()
-    code := m.GetString("code") //渠道
-    // 点浏览器打开时保持在原页面
-    come := m.GetString("come")
-    flag := m.GetString("flag")
-    if !mobileReg.MatchString(m.UserAgent()) && flag == "" {
-        return m.Redirect("/front/aboutus.html" + util.If(code != "", "?code="+code, "").(string))
-    }
-    from_userid, from_openid := "", ""
-    if from := m.GetString("from"); from != "" {
-        from_userid = se.Decode4Hex(from)
-    }
-    myopenid, _ := m.Session().Get("s_m_openid").(string)
-    mynickname, _ := m.Session().Get("s_nickname").(string)
-    myavatar, _ := m.Session().Get("s_avatar").(string)
-    isSubscribe := false
-    if myopenid == "" {
-        if m.GetString("state") == "wx" {
-            //微信跳回来的
-            code := m.GetString("code")
-            if code != "" {
-                myopenid = jyutil.Getopenid(code)
-            }
-        } else {
-            if public.CheckWxBrowser(m.Request) {
-                //所有参数都不再使用,跳到微信验证用户
-                return m.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(m.Site()+m.Url()), "wx"), 302)
-            }
-        }
-    }
-    if myopenid != "" {
-        isSubscribe = CheckUserIsSubscribe(myopenid)
-        if isSubscribe {
-            FindUserAndCreateSess(myopenid, m.Session(), "wx", false)
-            myopenid, _ = m.Session().Get("s_m_openid").(string)
-            mynickname, _ = m.Session().Get("s_nickname").(string)
-        }
-    }
-    param := m.GetString("param")
-    var openid = ""
-    var activecode = ""
-    //分享后微信新用户打开落地页
-    if param != "-1" {
-        wxid_code := strings.Split(param, "__")
-        if len(wxid_code) > 0 {
-            openid = wxid_code[0]
-            from_openid = se.Decode4Hex(openid)
-        }
-        if len(wxid_code) > 1 {
-            activecode = wxid_code[1]
-        }
-    }
-    if from_openid != "" { //分享关联
-        fromuser, ok := public.MQFW.FindOne("user", map[string]interface{}{"s_m_openid": from_openid})
-        if fromuser != nil && len(*fromuser) > 0 && ok {
-            from_userid = BsonIdToSId((*fromuser)["_id"])
-        }
-    }
-    if from_userid != "" {
-        sharekey := "share_jyb_" + myopenid
-        if typ := m.GetString("source"); typ != "" { //用于区分招标信息和文库
-            from_userid += "__article" //招标信息
-        } else {
-            from_userid += "__jydocs" //文库
-        }
-        ok := redis.Put("other", sharekey, from_userid, 60*5)
-        if !ok {
-            log.Println("分享用户关联redis出错", "分享者:", from_userid, "被分享者:", myopenid)
-        }
-    }
-    qrcodeType := m.GetString("qrcodeType")
-    if qrcodeType != "" {
-        activecode = qrcodeType
-    }
-    m.T["code"] = code
-    m.T["source"] = m.GetString("source") //分享类型 app or 公众号
-    m.T["activecode"] = activecode
-    m.T["nickname"] = mynickname
-    m.T["avatar"] = myavatar
-    m.T["isSubscribe"] = isSubscribe //是否关注
-    if openid == "" && myopenid != "" {
-        m.T["openid"] = se.EncodeString(myopenid)
-    } else {
-        m.T["openid"] = openid
-    }
-    m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	defer util.Catch()
+	code := m.GetString("code") //渠道
+	// 点浏览器打开时保持在原页面
+	come := m.GetString("come")
+	flag := m.GetString("flag")
+	if !mobileReg.MatchString(m.UserAgent()) && flag == "" {
+		return m.Redirect("/front/aboutus.html" + util.If(code != "", "?code="+code, "").(string))
+	}
+	from_userid, from_openid := "", ""
+	if from := m.GetString("from"); from != "" {
+		from_userid = se.Decode4Hex(from)
+	}
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	isSubscribe := false
+	if myopenid == "" {
+		if m.GetString("state") == "wx" {
+			//微信跳回来的
+			code := m.GetString("code")
+			if code != "" {
+				myopenid = jyutil.Getopenid(code)
+			}
+		} else {
+			if public.CheckWxBrowser(m.Request) {
+				//所有参数都不再使用,跳到微信验证用户
+				return m.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(m.Site()+m.Url()), "wx"), 302)
+			}
+		}
+	}
+	if myopenid != "" {
+		isSubscribe = CheckUserIsSubscribe(myopenid)
+		if isSubscribe {
+			FindUserAndCreateSess(myopenid, m.Session(), "wx", false)
+			myopenid, _ = m.Session().Get("s_m_openid").(string)
+			mynickname, _ = m.Session().Get("s_nickname").(string)
+		}
+	}
+	param := m.GetString("param")
+	var openid = ""
+	var activecode = ""
+	//分享后微信新用户打开落地页
+	if param != "-1" {
+		wxid_code := strings.Split(param, "__")
+		if len(wxid_code) > 0 {
+			openid = wxid_code[0]
+			from_openid = se.Decode4Hex(openid)
+		}
+		if len(wxid_code) > 1 {
+			activecode = wxid_code[1]
+		}
+	}
+	if from_openid != "" { //分享关联
+		fromuser, ok := public.MQFW.FindOne("user", map[string]interface{}{"s_m_openid": from_openid})
+		if fromuser != nil && len(*fromuser) > 0 && ok {
+			from_userid = BsonIdToSId((*fromuser)["_id"])
+		}
+	}
+	if from_userid != "" {
+		sharekey := "share_jyb_" + myopenid
+		if typ := m.GetString("source"); typ != "" { //用于区分招标信息和文库
+			from_userid += "__article" //招标信息
+		} else {
+			from_userid += "__jydocs" //文库
+		}
+		ok := redis.Put("other", sharekey, from_userid, 60*5)
+		if !ok {
+			log.Println("分享用户关联redis出错", "分享者:", from_userid, "被分享者:", myopenid)
+		}
+	}
+	qrcodeType := m.GetString("qrcodeType")
+	if qrcodeType != "" {
+		activecode = qrcodeType
+	}
+	m.T["code"] = code
+	m.T["source"] = m.GetString("source") //分享类型 app or 公众号
+	m.T["activecode"] = activecode
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["isSubscribe"] = isSubscribe //是否关注
+	if openid == "" && myopenid != "" {
+		m.T["openid"] = se.EncodeString(myopenid)
+	} else {
+		m.T["openid"] = openid
+	}
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
 
-    m.T["flag"] = flag
+	m.T["flag"] = flag
 
-    m.T["come"] = come
-    if come == "1" && !public.CheckWxBrowser(m.Request) {
-        return m.Redirect("/front/downloadapppage/normal?source=weixinAutoRpl")
-    }
-    m.T["first"], _ = m.GetBool("first")
-    var open_infoid = ""
-    if m.GetString("source") == "open_infocontent" {
-        open_infoid = m.GetString("o")
-        m.T["open_infoid"] = open_infoid
-        m.T["code"] = "open00" + open_infoid
-        return m.Render("/weixin/about.html")
-    } else {
-        if myopenid == "" {
-            if public.CheckWxBrowser(m.Request) {
-                if code == "" {
-                    m.T["code"] = "wx01" //新用户微信访问,统计app下载量
-                }
-                //微信浏览器访问 基本不走此
-                return m.Render("/weixin/sharePage.html")
-            } else {
-                //非微信浏览器访问
-                return m.Redirect("/active/appExt/sh001")
-            }
-        } else {
-            if public.CheckWxBrowser(m.Request) {
-                m.T["isWeixin"] = 1
-            } else {
-                m.T["isWeixin"] = 0
-            }
-            return m.Render("/weixin/about.html")
-        }
-    }
+	m.T["come"] = come
+	if come == "1" && !public.CheckWxBrowser(m.Request) {
+		return m.Redirect("/front/downloadapppage/normal?source=weixinAutoRpl")
+	}
+	m.T["first"], _ = m.GetBool("first")
+	var open_infoid = ""
+	if m.GetString("source") == "open_infocontent" {
+		open_infoid = m.GetString("o")
+		m.T["open_infoid"] = open_infoid
+		m.T["code"] = "open00" + open_infoid
+		return m.Render("/weixin/about.html")
+	} else {
+		if myopenid == "" {
+			if public.CheckWxBrowser(m.Request) {
+				if code == "" {
+					m.T["code"] = "wx01" //新用户微信访问,统计app下载量
+				}
+				//微信浏览器访问 基本不走此
+				return m.Render("/weixin/sharePage.html")
+			} else {
+				//非微信浏览器访问
+				return m.Redirect("/active/appExt/sh001")
+			}
+		} else {
+			if public.CheckWxBrowser(m.Request) {
+				m.T["isWeixin"] = 1
+			} else {
+				m.T["isWeixin"] = 0
+			}
+			return m.Render("/weixin/about.html")
+		}
+	}
 }
 
 func (m *Front) Shareabout(openids string) error {
-    defer util.Catch()
-    var openid = ""
-    if openids != "-1" {
-        wxid_code := strings.Split(openids, "__")
-        if len(wxid_code) > 0 {
-            openid = wxid_code[0]
-        }
-    }
-    myopenid, _ := m.Session().Get("s_m_openid").(string)
-    mynickname, _ := m.Session().Get("s_nickname").(string)
-    myavatar, _ := m.Session().Get("s_avatar").(string)
-    if openid == "" && myopenid != "" {
-        m.T["openid"] = se.EncodeString(myopenid)
-    } else {
-        m.T["openid"] = openid
-    }
-    m.T["nickname"] = mynickname
-    m.T["avatar"] = myavatar
-    m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-    m.T["source"] = ""
-    if public.CheckWxBrowser(m.Request) {
-        m.T["isWeixin"] = 1
-    } else {
-        m.T["isWeixin"] = 0
-    }
-    return m.Render("/weixin/about.html")
+	defer util.Catch()
+	var openid = ""
+	if openids != "-1" {
+		wxid_code := strings.Split(openids, "__")
+		if len(wxid_code) > 0 {
+			openid = wxid_code[0]
+		}
+	}
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	if openid == "" && myopenid != "" {
+		m.T["openid"] = se.EncodeString(myopenid)
+	} else {
+		m.T["openid"] = openid
+	}
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	m.T["source"] = ""
+	if public.CheckWxBrowser(m.Request) {
+		m.T["isWeixin"] = 1
+	} else {
+		m.T["isWeixin"] = 0
+	}
+	return m.Render("/weixin/about.html")
 }
 
 func (m *Front) Aboutsearch() error {
-    myopenid, _ := m.Session().Get("s_m_openid").(string)
-    m.T["openid"] = se.EncodeString(myopenid)
-    mynickname, _ := m.Session().Get("s_nickname").(string)
-    myavatar, _ := m.Session().Get("s_avatar").(string)
-    m.T["nickname"] = mynickname
-    m.T["avatar"] = myavatar
-    m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-    m.Render("/weixin/aboutsearch.html", &m.T)
-    return nil
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	m.T["openid"] = se.EncodeString(myopenid)
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	m.Render("/weixin/aboutsearch.html", &m.T)
+	return nil
 }
 
 // 剑鱼标讯微信查询保存网站
 func (m *Front) AboutSR() error {
-    defer util.Catch()
-    var flag = "N"
-    var sn = m.GetString("searchname")
-    var tp = m.GetString("tp")
-    if len(sn) > 0 {
-        switch tp {
-        case "S": //用户查询网站是否被收录
-            userId, ok := m.GetSession("userId").(string)
-            if !ok || userId == "" {
-                break
-            }
-            res, err := mongodb.FindOne("bidurlinfo", bson.M{"$or": []bson.M{bson.M{"s_name": sn}, bson.M{"s_url": sn}}})
-            if err {
-                if len(*res) > 0 {
-                    flag = "T"
-                }
-            }
-            break
-        case "I": //用户提交数据
-            data := make(map[string]interface{})
-            userId, ok := m.GetSession("userId").(string)
-            if !ok || userId == "" {
-                break
-            }
-            userInfo := jyutil.Compatible.Select(userId, `"s_name":1,"s_nickname":1`)
-            if userInfo == nil {
-                break
-            }
-            data["i_type"] = 8
-            data["s_remark"] = sn
-            if (*userInfo)["s_name"] != nil {
-                data["s_submitname"] = (*userInfo)["s_name"].(string)
-            }
-            data["s_submitid"] = userId
-            data["s_title"] = m.GetString("title")
-            data["i_status"] = 0
-            if (*userInfo)["s_nickname"] != nil { //昵称
-                data["s_username"] = (*userInfo)["s_nickname"].(string)
-            } else if (*userInfo)["s_name"] != nil { //s_name
-                data["s_username"] = (*userInfo)["s_name"].(string)
-            }
-            data["l_submitdate"] = time.Now().Unix()
-            data["s_source"] = m.GetString("source")
-            data["s_from"] = "wx"
-            id := mongodb.Save("interaction", data)
-            if len(id) > 0 && len(sn) > 0 {
-                flag = "T"
-            }
-            break
-        }
-    }
-    m.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return nil
+	defer util.Catch()
+	var flag = "N"
+	var sn = m.GetString("searchname")
+	var tp = m.GetString("tp")
+	if len(sn) > 0 {
+		switch tp {
+		case "S": //用户查询网站是否被收录
+			userId, ok := m.GetSession("userId").(string)
+			if !ok || userId == "" {
+				break
+			}
+			res, err := mongodb.FindOne("bidurlinfo", bson.M{"$or": []bson.M{bson.M{"s_name": sn}, bson.M{"s_url": sn}}})
+			if err {
+				if len(*res) > 0 {
+					flag = "T"
+				}
+			}
+			break
+		case "I": //用户提交数据
+			data := make(map[string]interface{})
+			userId, ok := m.GetSession("userId").(string)
+			if !ok || userId == "" {
+				break
+			}
+			userInfo, ok := mongodb.FindById("user", userId, nil)
+			if !ok {
+				break
+			}
+			data["i_type"] = 8
+			data["s_remark"] = sn
+			if (*userInfo)["s_name"] != nil {
+				data["s_submitname"] = (*userInfo)["s_name"].(string)
+			}
+			data["s_submitid"] = userId
+			data["s_title"] = m.GetString("title")
+			data["i_status"] = 0
+			if (*userInfo)["s_nickname"] != nil { //昵称
+				data["s_username"] = (*userInfo)["s_nickname"].(string)
+			} else if (*userInfo)["s_name"] != nil { //s_name
+				data["s_username"] = (*userInfo)["s_name"].(string)
+			}
+			data["l_submitdate"] = time.Now().Unix()
+			data["s_source"] = m.GetString("source")
+			data["s_from"] = "wx"
+			id := mongodb.Save("interaction", data)
+			if len(id) > 0 && len(sn) > 0 {
+				flag = "T"
+			}
+			break
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }
 
 // 手动删除30天无更新数据
 func (m *Front) DelOL() error {
-    defer util.Catch()
-    var ids []primitive.ObjectID
-    var flag = "F"
-    var arrid = strings.Split(m.GetString("arrid"), ",")
-    if len(arrid) > 0 {
-        for _, chid := range arrid {
-            _id, _ := primitive.ObjectIDFromHex(encrypt.DecodeArticleId2ByCheck(chid)[0])
-            ids = append(ids, _id)
-        }
-    }
-    userId, ok := m.GetSession("userId").(string)
-    if !ok || userId == "" || len(ids) < 1 {
-        m.ServeJson(map[string]interface{}{
-            "flag": flag,
-        })
-        return nil
-    }
-    if datas, ok := mongodb.Find("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_userid": m.GetSession("userId").(string)}, nil, nil, false, -1, -1); ok && datas != nil {
-        for _, v := range *datas {
-            go delRelRedis(v["s_userid"], v["a_relationinfo"])
-            v["s_followid"] = BsonIdToSId(v["_id"])
-            delete(v, "_id")
-            v["i_status"] = 2
-            mongodb.Save("follow_project_back", v)
-        }
-    }
-    if mongodb.Del("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_userid": m.GetSession("userId").(string)}) {
-        flag = "T"
-    }
-    m.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return nil
+	defer util.Catch()
+	var ids []primitive.ObjectID
+	var flag = "F"
+	var arrid = strings.Split(m.GetString("arrid"), ",")
+	if len(arrid) > 0 {
+		for _, chid := range arrid {
+			_id, _ := primitive.ObjectIDFromHex(encrypt.DecodeArticleId2ByCheck(chid)[0])
+			ids = append(ids, _id)
+		}
+	}
+	userId, ok := m.GetSession("userId").(string)
+	if !ok || userId == "" || len(ids) < 1 {
+		m.ServeJson(map[string]interface{}{
+			"flag": flag,
+		})
+		return nil
+	}
+	if datas, ok := mongodb.Find("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_userid": m.GetSession("userId").(string)}, nil, nil, false, -1, -1); ok && datas != nil {
+		for _, v := range *datas {
+			go delRelRedis(v["s_userid"], v["a_relationinfo"])
+			v["s_followid"] = BsonIdToSId(v["_id"])
+			delete(v, "_id")
+			v["i_status"] = 2
+			mongodb.Save("follow_project_back", v)
+		}
+	}
+	if mongodb.Del("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_userid": m.GetSession("userId").(string)}) {
+		flag = "T"
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }
 
 // 获取我的反馈列表
 func (f *Front) MyFeedbacks() error {
-    userId, _ := f.GetSession("userId").(string)
-    if userId == "" {
-        return f.Render("/_error.html")
-    }
-    list, ok := mongodb.Find("interaction", bson.M{"s_submitid": userId}, `{"l_submitdate":-1}`, `{"s_remark":1,"l_submitdate":1,"s_opinion":1,"i_status":1}`, false, 0, 200)
-    if !ok {
-        return nil
-    }
-    if f.Method() == "GET" {
-        f.T["list"] = list
-        f.T["flag"] = true
-        mynickname, _ := f.Session().Get("s_nickname").(string)
-        myavatar, _ := f.Session().Get("s_avatar").(string)
-        myopenid, _ := f.GetSession("s_m_openid").(string)
-        f.T["nickname"] = mynickname
-        f.T["avatar"] = myavatar
-        f.T["signature"] = wx.SignJSSDK(f.Site() + f.Url())
-        f.T["openid"] = se.EncodeString(myopenid)
-        _, f.T["advertText"] = getRewardText()
-        f.T["advertImg"] = config.Sysconfig["advertImg"]
-        f.T["advertName"] = config.Sysconfig["advertName"]
-        f.T["advertUrl"] = config.Sysconfig["advertUrl"]
-        return f.Render("/weixin/feedback.html")
-    }
-    f.ServeJson(map[string]interface{}{
-        "list": list,
-    })
-    return nil
+	userId, _ := f.GetSession("userId").(string)
+	if userId == "" {
+		return f.Render("/_error.html")
+	}
+	list, ok := mongodb.Find("interaction", bson.M{"s_submitid": userId}, `{"l_submitdate":-1}`, `{"s_remark":1,"l_submitdate":1,"s_opinion":1,"i_status":1}`, false, 0, 200)
+	if !ok {
+		return nil
+	}
+	if f.Method() == "GET" {
+		f.T["list"] = list
+		f.T["flag"] = true
+		mynickname, _ := f.Session().Get("s_nickname").(string)
+		myavatar, _ := f.Session().Get("s_avatar").(string)
+		myopenid, _ := f.GetSession("s_m_openid").(string)
+		f.T["nickname"] = mynickname
+		f.T["avatar"] = myavatar
+		f.T["signature"] = wx.SignJSSDK(f.Site() + f.Url())
+		f.T["openid"] = se.EncodeString(myopenid)
+		_, f.T["advertText"] = getRewardText()
+		f.T["advertImg"] = config.Sysconfig["advertImg"]
+		f.T["advertName"] = config.Sysconfig["advertName"]
+		f.T["advertUrl"] = config.Sysconfig["advertUrl"]
+		return f.Render("/weixin/feedback.html")
+	}
+	f.ServeJson(map[string]interface{}{
+		"list": list,
+	})
+	return nil
 }
 func (f *Front) GetRecomKWs() {
-    count, _ := f.GetInteger("count")
-    f.ServeJson(public.RecomKws.GetRecomKws(f.GetString("value"), count, float32(config.Sysconfig["recommendThreshold"].(float64))))
+	count, _ := f.GetInteger("count")
+	f.ServeJson(public.RecomKws.GetRecomKws(f.GetString("value"), count, float32(config.Sysconfig["recommendThreshold"].(float64))))
 }
 
 // 记录用户行为--推荐关键词
 func (f *Front) BehaviorRecord() {
-    flag := saveBehaviorRecord(f.Session(),
-        bson.M{
-            "s_word":   f.GetString("value"),
-            "s_type":   f.GetString("type"),
-            "s_source": f.GetString("source"),
-        })
-    f.ServeJson(bson.M{"flag": flag})
+	flag := saveBehaviorRecord(f.Session(),
+		bson.M{
+			"s_word":   f.GetString("value"),
+			"s_type":   f.GetString("type"),
+			"s_source": f.GetString("source"),
+		})
+	f.ServeJson(bson.M{"flag": flag})
 }
 
 // 记录用户行为
 func saveBehaviorRecord(sess *httpsession.Session, data bson.M) bool {
-    userid, _ := sess.Get("userId").(string)
-    //if openId == "" {
-    //	return false
-    //}
-    nickName, _ := sess.Get("s_nickname").(string)
-    //data["s_openid"] = openId
-    data["s_userid"] = userid
-    data["s_nickname"] = nickName
-    data["l_createtime"] = time.Now().Unix()
-    return len(mongodb.Save("behavior", data)) > 0
+	userid, _ := sess.Get("userId").(string)
+	//if openId == "" {
+	//	return false
+	//}
+	nickName, _ := sess.Get("s_nickname").(string)
+	//data["s_openid"] = openId
+	data["s_userid"] = userid
+	data["s_nickname"] = nickName
+	data["l_createtime"] = time.Now().Unix()
+	return len(mongodb.Save("behavior", data)) > 0
 }
 
 // 取得剑鱼标讯博客的信息列表
 func (f *Front) Jyblog(param /*参数*/ string) error {
-    querymap := map[string]string{}
-    if len(param) == 0 {
-        querymap = map[string]string{
-            "perPage":     f.GetString("perPage"),
-            "currentPage": f.GetString("currentPage"),
-            "contentType": "jybk",
-            "query":       f.GetString("query"),
-        }
-    } else {
-        //反转生成map
-        paramstr := param[1:]
-        bs, _ := base64.StdEncoding.DecodeString(paramstr)
-        json.Unmarshal(bs, &querymap)
-    }
-    var shareid = f.GetString("id")
-    if len(shareid) == 0 {
-        shareid = fmt.Sprintf("%s%d", config.Seoconfig["jybky"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
-    }
-    f.T["logid"] = config.Seoconfig["jybky"].(string)
-    f.DisableHttpCache()
-    shareid = se.EncodeString(shareid)
-    data, pagination := jyutil.JyCmsSearch(querymap)
-    f.Render("/pc/jyblog.html", &xweb.T{"querymap": querymap, "data": data, "pagination": pagination, "shareid": shareid})
-    return nil
+	querymap := map[string]string{}
+	if len(param) == 0 {
+		querymap = map[string]string{
+			"perPage":     f.GetString("perPage"),
+			"currentPage": f.GetString("currentPage"),
+			"contentType": "jybk",
+			"query":       f.GetString("query"),
+		}
+	} else {
+		//反转生成map
+		paramstr := param[1:]
+		bs, _ := base64.StdEncoding.DecodeString(paramstr)
+		json.Unmarshal(bs, &querymap)
+	}
+	var shareid = f.GetString("id")
+	if len(shareid) == 0 {
+		shareid = fmt.Sprintf("%s%d", config.Seoconfig["jybky"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
+	}
+	f.T["logid"] = config.Seoconfig["jybky"].(string)
+	f.DisableHttpCache()
+	shareid = se.EncodeString(shareid)
+	data, pagination := jyutil.JyCmsSearch(querymap)
+	f.Render("/pc/jyblog.html", &xweb.T{"querymap": querymap, "data": data, "pagination": pagination, "shareid": shareid})
+	return nil
 }
 
 func (f *Front) JyCms(cType, param string) error {
-    querymap := map[string]string{}
-    if len(param) == 0 {
-        querymap = map[string]string{
-            "perPage":     f.GetString("perPage"),
-            "currentPage": f.GetString("currentPage"),
-            "contentType": cType,
-            "query":       f.GetString("query"),
-        }
-    } else {
-        //反转生成map
-        paramstr := param[1:]
-        bs, _ := base64.StdEncoding.DecodeString(paramstr)
-        json.Unmarshal(bs, &querymap)
-    }
-    f.DisableHttpCache()
-    data, pagination := jyutil.JyCmsSearch(querymap)
-    return f.Render("/pc/jyblog.html", &xweb.T{"querymap": querymap, "data": data, "pagination": pagination})
+	querymap := map[string]string{}
+	if len(param) == 0 {
+		querymap = map[string]string{
+			"perPage":     f.GetString("perPage"),
+			"currentPage": f.GetString("currentPage"),
+			"contentType": cType,
+			"query":       f.GetString("query"),
+		}
+	} else {
+		//反转生成map
+		paramstr := param[1:]
+		bs, _ := base64.StdEncoding.DecodeString(paramstr)
+		json.Unmarshal(bs, &querymap)
+	}
+	f.DisableHttpCache()
+	data, pagination := jyutil.JyCmsSearch(querymap)
+	return f.Render("/pc/jyblog.html", &xweb.T{"querymap": querymap, "data": data, "pagination": pagination})
 }
 
 // 博客三级页
 func (f *Front) Jybdetail(_id string) error {
-    var shareid = f.GetString("id")
-    if len(shareid) == 0 {
-        shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jybky"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
-    }
-    f.T["logid"] = config.Seoconfig["jybky"].(string)
-    shareid = se.EncodeString(shareid)
-    if ret := redis.Get("other", "jyblog_"+_id); ret != nil {
-        var retlist *map[string]interface{}
-        b, _ := json.Marshal(ret)
-        json.Unmarshal(b, &retlist)
-        (*retlist)["s_content"] = template.HTML((*retlist)["s_content"].(string))
-        (*retlist)["_id"] = (*retlist)["_id"].(string)
-        f.T["data"] = retlist
-    } else {
-        id := se.DecodeString(_id)
-        //r := elastic.GetByIdField("content", "content", id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description","s_contenttype","s_pic1"`)
-        r, _ := public.MQFW.FindById("content", id, `{"s_title":1,"s_contenttype":1,"s_content":1,"releasetime":1,"s_description":1,"praise":1,"s_source":1,"s_pic":1,"s_pic1":1,"l_createdate":1,"_id":1,"s_author":1,"s_editorname":1,"s_url":1,"s_subcontent":1,"s_keywords":1}`)
-        if r != nil {
-            tmpdate1, _ := (*r)["l_createdate"]
-            (*r)["l_createdate"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate1), 0))
-            tmpdate2, _ := (*r)["releasetime"]
-            (*r)["releasetime"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate2), 0))
-            (*r)["s_content"] = template.HTML(util.ObjToString((*r)["s_content"]))
-            (*r)["_id"] = se.EncodeString(BsonIdToSId((*r)["_id"]))
-            s_pic, _ := (*r)["s_pic"].(string)
-            if s_pic != "" {
-                s_pic = config.Seoconfig["jyadd"].(string) + s_pic
-            }
-            (*r)["s_pic"] = s_pic
-            s_pic1, _ := (*r)["s_pic1"].(string)
-            if s_pic1 != "" {
-                s_pic1 = config.Seoconfig["jyadd"].(string) + s_pic1
-            }
-            (*r)["s_pic1"] = s_pic1
-        }
-        f.DisableHttpCache()
-        redis.Put("other", "jyblog_"+_id, r, 2*60*60)
-        f.T["data"] = r
-    }
-    f.T["shareid"] = shareid
-    return f.Render("/pc/jyblogdetail.html", &f.T)
+	var shareid = f.GetString("id")
+	if len(shareid) == 0 {
+		shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jybky"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
+	}
+	f.T["logid"] = config.Seoconfig["jybky"].(string)
+	shareid = se.EncodeString(shareid)
+	if ret := redis.Get("other", "jyblog_"+_id); ret != nil {
+		var retlist *map[string]interface{}
+		b, _ := json.Marshal(ret)
+		json.Unmarshal(b, &retlist)
+		(*retlist)["s_content"] = template.HTML((*retlist)["s_content"].(string))
+		(*retlist)["_id"] = (*retlist)["_id"].(string)
+		f.T["data"] = retlist
+	} else {
+		id := se.DecodeString(_id)
+		//r := elastic.GetByIdField("content", "content", id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description","s_contenttype","s_pic1"`)
+		r, _ := public.MQFW.FindById("content", id, `{"s_title":1,"s_contenttype":1,"s_content":1,"releasetime":1,"s_description":1,"praise":1,"s_source":1,"s_pic":1,"s_pic1":1,"l_createdate":1,"_id":1,"s_author":1,"s_editorname":1,"s_url":1,"s_subcontent":1,"s_keywords":1}`)
+		if r != nil {
+			tmpdate1, _ := (*r)["l_createdate"]
+			(*r)["l_createdate"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate1), 0))
+			tmpdate2, _ := (*r)["releasetime"]
+			(*r)["releasetime"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate2), 0))
+			(*r)["s_content"] = template.HTML(util.ObjToString((*r)["s_content"]))
+			(*r)["_id"] = se.EncodeString(BsonIdToSId((*r)["_id"]))
+			s_pic, _ := (*r)["s_pic"].(string)
+			if s_pic != "" {
+				s_pic = config.Seoconfig["jyadd"].(string) + s_pic
+			}
+			(*r)["s_pic"] = s_pic
+			s_pic1, _ := (*r)["s_pic1"].(string)
+			if s_pic1 != "" {
+				s_pic1 = config.Seoconfig["jyadd"].(string) + s_pic1
+			}
+			(*r)["s_pic1"] = s_pic1
+		}
+		f.DisableHttpCache()
+		redis.Put("other", "jyblog_"+_id, r, 2*60*60)
+		f.T["data"] = r
+	}
+	f.T["shareid"] = shareid
+	return f.Render("/pc/jyblogdetail.html", &f.T)
 }
 
 func (f *Front) Blogpraise() error {
-    defer util.Catch()
-    id := se.DecodeString(f.GetString("id"))
-    stype := f.GetString("type")
-    flag := "F"
-    var blogflag = true
-    util.Try(func() {
-        if id != "" {
-            if stype == "up" {
-                blogflag = mongodb.Update("content", `{"_id":"`+id+`"}`, `{ "$inc" : { "praise" : 1 }}`, false, false)
-            } else if stype == "down" {
-                blogflag = mongodb.Update("content", `{"_id":"`+id+`"}`, `{ "$inc" : { "praise" : -1 }}`, false, false)
-            }
-            if blogflag {
-                flag = "T"
-                r, _ := mongodb.FindById("content", id, "")
-                elastic.UpdateNewDoc("content", "content", r)
-                redis.Del("other", "jyblog_"+f.GetString("id"))
-            }
-        }
-    }, func(e interface{}) {
-        log.Println("文章点赞出错", e)
-    })
-    f.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return nil
+	defer util.Catch()
+	id := se.DecodeString(f.GetString("id"))
+	stype := f.GetString("type")
+	flag := "F"
+	var blogflag = true
+	util.Try(func() {
+		if id != "" {
+			if stype == "up" {
+				blogflag = mongodb.Update("content", `{"_id":"`+id+`"}`, `{ "$inc" : { "praise" : 1 }}`, false, false)
+			} else if stype == "down" {
+				blogflag = mongodb.Update("content", `{"_id":"`+id+`"}`, `{ "$inc" : { "praise" : -1 }}`, false, false)
+			}
+			if blogflag {
+				flag = "T"
+				r, _ := mongodb.FindById("content", id, "")
+				elastic.UpdateNewDoc("content", "content", r)
+				redis.Del("other", "jyblog_"+f.GetString("id"))
+			}
+		}
+	}, func(e interface{}) {
+		log.Println("文章点赞出错", e)
+	})
+	f.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }
 
 func getRewardText() (string, string) {
-    rewardText, _ := config.Sysconfig["rewardText"].([]interface{})
-    advertText, _ := config.Sysconfig["advertText"].([]interface{})
-    randVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(rewardText))
-    if len(advertText) != 0 {
-        advVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(advertText))
-        return util.ObjToString(rewardText[randVal]), util.ObjToString(advertText[advVal])
-    } else {
-        return util.ObjToString(rewardText[randVal]), ""
-    }
+	rewardText, _ := config.Sysconfig["rewardText"].([]interface{})
+	advertText, _ := config.Sysconfig["advertText"].([]interface{})
+	randVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(rewardText))
+	if len(advertText) != 0 {
+		advVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(advertText))
+		return util.ObjToString(rewardText[randVal]), util.ObjToString(advertText[advVal])
+	} else {
+		return util.ObjToString(rewardText[randVal]), ""
+	}
 }
 
 func searchresulthtml(list *[]map[string]interface{}) string {
-    var listhtml = ""
-    var j = 1
-    for i := 0; i < len(*list); i++ {
-        listdata := (*list)[i]
-        j = i + 1
-        listhtml += `<li><div class="liLuceneList"><div class="luce-left"><em>` + strconv.Itoa(j) + `.</em>`
-        if listdata["title"] != "" {
-            listhtml += `<div class="left-title"><a onclick="noIn(this)" dataId="` + util.ObjToString(listdata["_id"]) + `" target="_blank">` + util.ObjToString(listdata["title"]) + `</a></div></div><div class="luce-right">`
-        }
-        area, _ := listdata["area"].(string)
-        area = strings.TrimSpace(area)
-        finalType, _ := listdata["subtype"].(string)
-        if finalType == "" {
-            finalType = util.ObjToString(listdata["toptype"])
-        }
-        if finalType == "" {
-            finalType = util.ObjToString(listdata["type"])
-            if finalType == "bid" {
-                finalType = "中标"
-            } else if finalType == "tender" {
-                finalType = "招标"
-            } else {
-                finalType = ""
-            }
-        }
-        industry := util.ObjToString(listdata["industry"])
-        stpadd, areaadd, indadd := classify(finalType, area, industry)
-        if area != "" && area != "A" {
-            listhtml += `<a href="/list/area/` + areaadd + `.html">` + area + `</a>`
-        } else {
-            listhtml += `<a href="#" style="display:none;"></a>`
-        }
-        if finalType != "" {
-            listhtml += `<a href="/list/stype/` + stpadd + `.html">` + finalType + `</a>`
-        } else {
-            listhtml += `<a href="#" style="display:none;"></a>`
-        }
-        //industry, _ := listdata["industry"].(string)
-        if industry != "" {
-            listhtml += `<a href="/list/industry/` + indadd + `.html">` + industry + `</a>`
-        } else {
-            listhtml += `<a href="#" style="display:none;"></a>`
-        }
-        acount := ""
-        if listdata["bidamount"] != nil {
-            acount = ConversionMoeny(listdata["bidamount"])
-        } else if listdata["budget"] != nil {
-            acount = ConversionMoeny(listdata["budget"])
-        }
-        if acount != "" {
-            listhtml += `<a>` + acount + `</a>`
-        } else {
-            listhtml += `<a href="#" style="display:none;"></a>`
-        }
-        publishtime, _ := listdata["publishtime"].(float64)
-        if publishtime != 0 {
-            diff := util.TimeDiff(time.Unix(util.Int64All(publishtime), 0))
-            if diff != "" {
-                listhtml += `<span class="com-time">` + diff + `</span>`
-            }
-        }
-        listhtml += `</div></div></li>`
-    }
-    return listhtml
+	var listhtml = ""
+	var j = 1
+	for i := 0; i < len(*list); i++ {
+		listdata := (*list)[i]
+		j = i + 1
+		listhtml += `<li><div class="liLuceneList"><div class="luce-left"><em>` + strconv.Itoa(j) + `.</em>`
+		if listdata["title"] != "" {
+			listhtml += `<div class="left-title"><a onclick="noIn(this)" dataId="` + util.ObjToString(listdata["_id"]) + `" target="_blank">` + util.ObjToString(listdata["title"]) + `</a></div></div><div class="luce-right">`
+		}
+		area, _ := listdata["area"].(string)
+		area = strings.TrimSpace(area)
+		finalType, _ := listdata["subtype"].(string)
+		if finalType == "" {
+			finalType = util.ObjToString(listdata["toptype"])
+		}
+		if finalType == "" {
+			finalType = util.ObjToString(listdata["type"])
+			if finalType == "bid" {
+				finalType = "中标"
+			} else if finalType == "tender" {
+				finalType = "招标"
+			} else {
+				finalType = ""
+			}
+		}
+		industry := util.ObjToString(listdata["industry"])
+		stpadd, areaadd, indadd := classify(finalType, area, industry)
+		if area != "" && area != "A" {
+			listhtml += `<a href="/list/area/` + areaadd + `.html">` + area + `</a>`
+		} else {
+			listhtml += `<a href="#" style="display:none;"></a>`
+		}
+		if finalType != "" {
+			listhtml += `<a href="/list/stype/` + stpadd + `.html">` + finalType + `</a>`
+		} else {
+			listhtml += `<a href="#" style="display:none;"></a>`
+		}
+		//industry, _ := listdata["industry"].(string)
+		if industry != "" {
+			listhtml += `<a href="/list/industry/` + indadd + `.html">` + industry + `</a>`
+		} else {
+			listhtml += `<a href="#" style="display:none;"></a>`
+		}
+		acount := ""
+		if listdata["bidamount"] != nil {
+			acount = ConversionMoeny(listdata["bidamount"])
+		} else if listdata["budget"] != nil {
+			acount = ConversionMoeny(listdata["budget"])
+		}
+		if acount != "" {
+			listhtml += `<a>` + acount + `</a>`
+		} else {
+			listhtml += `<a href="#" style="display:none;"></a>`
+		}
+		publishtime, _ := listdata["publishtime"].(float64)
+		if publishtime != 0 {
+			diff := util.TimeDiff(time.Unix(util.Int64All(publishtime), 0))
+			if diff != "" {
+				listhtml += `<span class="com-time">` + diff + `</span>`
+			}
+		}
+		listhtml += `</div></div></li>`
+	}
+	return listhtml
 }
 
 func (f *Front) GetClassifyList() error {
-    defer util.Catch()
-    //判断用户是否开启超级搜索?
+	defer util.Catch()
+	//判断用户是否开启超级搜索?
 
-    classifyname := f.GetString("classifyname")
-    data := redis.Get("other", "classify_"+classifyname)
-    f.ServeJson(map[string]interface{}{
-        "data": data,
-    })
-    return nil
+	classifyname := f.GetString("classifyname")
+	data := redis.Get("other", "classify_"+classifyname)
+	f.ServeJson(map[string]interface{}{
+		"data": data,
+	})
+	return nil
 }
 
 func classify(stp, area, industry string) (string, string, string) {
-    var areas, _ = config.Seoconfig["area"].(map[string]interface{})
-    var stypes, _ = config.Seoconfig["stype"].(map[string]interface{})
-    var industrys, _ = config.Seoconfig["industry"].(map[string]interface{})
-    var tpadd = ""
-    var areaadd = ""
-    var induadd = ""
-    if area != "" && area != "A" {
-        for k, v := range areas {
-            if area == v.(map[string]interface{})["NAME"] {
-                areaadd = k
-            }
-        }
-    }
-    //
-    if stp != "" {
-        for k, v := range stypes {
-            if stp == v.(map[string]interface{})["NAME"] {
-                tpadd = k
-            }
-        }
-    }
-    //
-    if industry != "" {
-        for k, v := range industrys {
-            if strings.Contains(util.ObjToString(v.(map[string]interface{})["NAME"]), industry) {
-                induadd = k
-            }
-        }
-    }
-    return tpadd, areaadd, induadd
+	var areas, _ = config.Seoconfig["area"].(map[string]interface{})
+	var stypes, _ = config.Seoconfig["stype"].(map[string]interface{})
+	var industrys, _ = config.Seoconfig["industry"].(map[string]interface{})
+	var tpadd = ""
+	var areaadd = ""
+	var induadd = ""
+	if area != "" && area != "A" {
+		for k, v := range areas {
+			if area == v.(map[string]interface{})["NAME"] {
+				areaadd = k
+			}
+		}
+	}
+	//
+	if stp != "" {
+		for k, v := range stypes {
+			if stp == v.(map[string]interface{})["NAME"] {
+				tpadd = k
+			}
+		}
+	}
+	//
+	if industry != "" {
+		for k, v := range industrys {
+			if strings.Contains(util.ObjToString(v.(map[string]interface{})["NAME"]), industry) {
+				induadd = k
+			}
+		}
+	}
+	return tpadd, areaadd, induadd
 }
 
 func (f *Front) HasPushHistory() {
-    userId := util.ObjToString(f.GetSession("userId"))
-    var industry_ = []string{}
-    if userId == "" {
-        return
-    }
-    user, _ := jy.NewSubscribePush().UserInfo(public.MQFW, userId)
-    hasKeyFlag := false
-    isVipFlag := false
-    isPassCount := false
-    isExpire := -1
-    tedayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
-    isOnTail := 0
-    var o_jy map[string]interface{}
-    isread := false
-    var keys []string
-    otherFlag := false
-    if user != nil {
-        o_jy, _ = (*user)["o_jy"].(map[string]interface{})
-        if o_jy != nil || len(o_jy) == 0 {
-            a_key, _ := o_jy["a_key"].([]interface{})
-            if a_key != nil {
-                for _, v := range a_key {
-                    kv := util.ObjToMap(v)
-                    keys = append(keys, util.ObjArrToStringArr((*kv)["key"].([]interface{}))...)
-                }
-            }
-        }
-        if util.IntAll((*user)["i_vip_status"]) == 1 || util.IntAll((*user)["i_vip_status"]) == 2 {
-            //
-            var threeRemind = int64(3 * 24 * 60 * 60)
-            var twoRemind = int64(2 * 24 * 60 * 60)
-            var oneRemind = int64(1 * 24 * 60 * 60)
-            var o_vipjy map[string]interface{}
-            if (*user)["isread"] != nil {
-                isread = (*user)["isread"].(bool)
-            }
-            o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})
-            a_buyerclass, _ := o_vipjy["a_buyerclass"].([]interface{})
-            industry_ = util.ObjArrToStringArr(a_buyerclass)
-            if o_vipjy["a_items"] != nil {
-                a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
-                hasKeyFlag = len(a_itmes) > 0
-            }
-            isVipFlag = true
-            isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 2000
-            isOnTail = util.IntAll((*user)["i_vip_status"])
-            _endtime := (*user)["l_vip_endtime"]
-            //是否到期
-            if util.Int64All(_endtime)-time.Now().Unix() < threeRemind && util.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
-                isExpire = 3 //即将到期
-            } else if util.Int64All(_endtime)-time.Now().Unix() < twoRemind && util.Int64All(_endtime)-time.Now().Unix() >= oneRemind {
-                isExpire = 2 //即将到期
-            } else if util.Int64All(_endtime)-time.Now().Unix() < oneRemind && util.Int64All(_endtime)-time.Now().Unix() >= 0 {
-                isExpire = 1 //即将到期
-            }
-            //判断首次用户是否推送的带有”其他“
-            t, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local)
-            today_1 := t.Unix()
-            today_2 := t.AddDate(0, 0, 1).Unix()
-            if public.PushMysql.CountBySql("select count(1) as count from pushsubscribe where isvip =1 and userid =? and buyerclass=?  and (date between ? and ? )", f.GetSession("userId"), 93, today_1, today_2) > 0 {
-                otherFlag = true
-            }
-        } else {
-            if (*user)["i_vip_status"] == nil {
-                isExpire = 0
-            } else {
-                isOnTail = util.IntAll((*user)["i_vip_status"])
-            }
-            if o_jy != nil || len(o_jy) == 0 {
-                a_key, _ := o_jy["a_key"].([]interface{})
-                hasKeyFlag = len(a_key) > 0
-            }
-            isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 150
-        }
-    }
-    pageNum, _ := f.GetInteger("pageNum")
-    spqp := &jy.SubPushQueryParam{
-        Mgo_bidding:   public.Mgo_Bidding,
-        Bidding:       public.DbConf.Mongodb.Bidding.Collection,
-        Bidding_back:  public.DbConf.Mongodb.Bidding.Collection_back,
-        PushMysql:     public.PushMysql,
-        UserId:        userId,
-        PageNum:       pageNum,
-        SelectTime:    f.GetString("selectTime"),
-        Area:          f.GetString("area"),
-        Buyerclass:    f.GetString("buyerclass"),
-        Subtype:       f.GetString("subtype"),
-        Subscopeclass: f.GetString("subscopeclass"),
-        Key:           f.GetString("key"),
-        City:          f.GetString("city"),
-        Price:         f.GetString("price"),      //价格
-        FileExists:    f.GetString("fileExists"), //附件
-    }
-    hasNextPage, _, list := jy.NewSubscribePush().Datas(spqp)
-    if hasKeyFlag && len(list) == 0 && spqp.IsEmpty() && !isVipFlag {
-        flag, data := jy.NewSubscribePush().MakeHistoryDatas(public.MQFW, public.PushMysql, userId, public.PushView)
-        if flag && data != nil {
-            jsonBytes, err := json.Marshal(data)
-            err = json.Unmarshal(jsonBytes, &list)
-            if err != nil {
-                log.Println("err:", err)
-            }
-        }
-    }
-    jy.NewSubscribePush().MakeCollection(userId, public.Mysql, list, FileSignBool)
-    //
-    f.ServeJson(map[string]interface{}{
-        "haskey":      hasKeyFlag,
-        "data":        list,
-        "hasNextPage": hasNextPage,
-        "isInTSguide": isInTSguide(userId),
-        "isVipSub":    isVipFlag,
-        "isPassCount": isPassCount,
-        "isExpire":    isExpire,
-        "isOnTail":    isOnTail,
-        "userId":      encrypt.EncodeArticleId(userId),
-        "keys":        keys,
-        "otherFlag":   otherFlag,
-        "industry":    industry_,
-        "isread":      isread,
-    })
+	userId := util.ObjToString(f.GetSession("userId"))
+	var industry_ = []string{}
+	if userId == "" {
+		return
+	}
+	user, _ := jy.NewSubscribePush().UserInfo(public.MQFW, userId)
+	hasKeyFlag := false
+	isVipFlag := false
+	isPassCount := false
+	isExpire := -1
+	tedayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
+	isOnTail := 0
+	var o_jy map[string]interface{}
+	isread := false
+	var keys []string
+	otherFlag := false
+	if user != nil {
+		o_jy, _ = (*user)["o_jy"].(map[string]interface{})
+		if o_jy != nil || len(o_jy) == 0 {
+			a_key, _ := o_jy["a_key"].([]interface{})
+			if a_key != nil {
+				for _, v := range a_key {
+					kv := util.ObjToMap(v)
+					keys = append(keys, util.ObjArrToStringArr((*kv)["key"].([]interface{}))...)
+				}
+			}
+		}
+		if util.IntAll((*user)["i_vip_status"]) == 1 || util.IntAll((*user)["i_vip_status"]) == 2 {
+			//
+			var threeRemind = int64(3 * 24 * 60 * 60)
+			var twoRemind = int64(2 * 24 * 60 * 60)
+			var oneRemind = int64(1 * 24 * 60 * 60)
+			var o_vipjy map[string]interface{}
+			if (*user)["isread"] != nil {
+				isread = (*user)["isread"].(bool)
+			}
+			o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})
+			a_buyerclass, _ := o_vipjy["a_buyerclass"].([]interface{})
+			industry_ = util.ObjArrToStringArr(a_buyerclass)
+			if o_vipjy["a_items"] != nil {
+				a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
+				hasKeyFlag = len(a_itmes) > 0
+			}
+			isVipFlag = true
+			isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 2000
+			isOnTail = util.IntAll((*user)["i_vip_status"])
+			_endtime := (*user)["l_vip_endtime"]
+			//是否到期
+			if util.Int64All(_endtime)-time.Now().Unix() < threeRemind && util.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
+				isExpire = 3 //即将到期
+			} else if util.Int64All(_endtime)-time.Now().Unix() < twoRemind && util.Int64All(_endtime)-time.Now().Unix() >= oneRemind {
+				isExpire = 2 //即将到期
+			} else if util.Int64All(_endtime)-time.Now().Unix() < oneRemind && util.Int64All(_endtime)-time.Now().Unix() >= 0 {
+				isExpire = 1 //即将到期
+			}
+			//判断首次用户是否推送的带有”其他“
+			t, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local)
+			today_1 := t.Unix()
+			today_2 := t.AddDate(0, 0, 1).Unix()
+			if public.PushMysql.CountBySql("select count(1) as count from pushsubscribe where isvip =1 and userid =? and buyerclass=?  and (date between ? and ? )", f.GetSession("userId"), 93, today_1, today_2) > 0 {
+				otherFlag = true
+			}
+		} else {
+			if (*user)["i_vip_status"] == nil {
+				isExpire = 0
+			} else {
+				isOnTail = util.IntAll((*user)["i_vip_status"])
+			}
+			if o_jy != nil || len(o_jy) == 0 {
+				a_key, _ := o_jy["a_key"].([]interface{})
+				hasKeyFlag = len(a_key) > 0
+			}
+			isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 150
+		}
+	}
+	pageNum, _ := f.GetInteger("pageNum")
+	spqp := &jy.SubPushQueryParam{
+		Mgo_bidding:   public.Mgo_Bidding,
+		Bidding:       public.DbConf.Mongodb.Bidding.Collection,
+		Bidding_back:  public.DbConf.Mongodb.Bidding.Collection_back,
+		PushMysql:     public.PushMysql,
+		UserId:        userId,
+		PageNum:       pageNum,
+		SelectTime:    f.GetString("selectTime"),
+		Area:          f.GetString("area"),
+		Buyerclass:    f.GetString("buyerclass"),
+		Subtype:       f.GetString("subtype"),
+		Subscopeclass: f.GetString("subscopeclass"),
+		Key:           f.GetString("key"),
+		City:          f.GetString("city"),
+		Price:         f.GetString("price"),      //价格
+		FileExists:    f.GetString("fileExists"), //附件
+	}
+	hasNextPage, _, list := jy.NewSubscribePush().Datas(spqp)
+	if hasKeyFlag && len(list) == 0 && spqp.IsEmpty() && !isVipFlag {
+		flag, data := jy.NewSubscribePush().MakeHistoryDatas(public.MQFW, public.PushMysql, userId, public.PushView)
+		if flag && data != nil {
+			jsonBytes, err := json.Marshal(data)
+			err = json.Unmarshal(jsonBytes, &list)
+			if err != nil {
+				log.Println("err:", err)
+			}
+		}
+	}
+	jy.NewSubscribePush().MakeCollection(userId, public.Mysql, list, FileSignBool)
+	//
+	f.ServeJson(map[string]interface{}{
+		"haskey":      hasKeyFlag,
+		"data":        list,
+		"hasNextPage": hasNextPage,
+		"isInTSguide": isInTSguide(userId),
+		"isVipSub":    isVipFlag,
+		"isPassCount": isPassCount,
+		"isExpire":    isExpire,
+		"isOnTail":    isOnTail,
+		"userId":      encrypt.EncodeArticleId(userId),
+		"keys":        keys,
+		"otherFlag":   otherFlag,
+		"industry":    industry_,
+		"isread":      isread,
+	})
 }
 
 // 历史推送
 func (f *Front) Newhistorypush() error {
-    myopenid := util.ObjToString(f.GetSession("s_m_openid"))
-    userId := util.ObjToString(f.GetSession("userId"))
-    if myopenid == "" || userId == "" {
-        return f.Redirect("/swordfish/share/-1")
-    }
-    //
-    times := f.GetString("times")
-    if times == "" {
-        times = f.GetString("pushtime")
-    }
-    // 打开推送
-    data := jyutil.Compatible.Select(userId, `"i_vip_subtips":1,"isread":1`)
-    if data != nil && len(*data) > 0 {
-        //VIP服务到期
-        vipSubtips := (*data)["i_vip_subtips"]
-        if vipSubtips == 0 {
-            if jyutil.Compatible.Update(userId, bson.M{"$set": bson.M{"i_vip_subtips": 1}}) {
-                return f.Redirect("/front/vipsubscribe/renewPage/exprie")
-            }
-        }
-    }
-    f.T["forceShareFlag"] = public.CheckUserNeedForceShare(myopenid, public.ShareType_push, config.Sysconfig)
-    mynickname, _ := f.Session().Get("s_nickname").(string)
-    myavatar, _ := f.Session().Get("s_avatar").(string)
-    f.T["nickname"] = mynickname
-    f.T["avatar"] = myavatar
-    f.T["signature"] = wx.SignJSSDK(f.Site() + f.Url())
-    f.T["openid"] = se.EncodeString(myopenid)
-    f.T["stime"] = times
-    f.T["isVip"] = util.IntAll((*data)["i_vip_status"]) > 0
-    f.T["isread"] = (*data)["isread"]
-    f.T["userId"] = userId
-    //直播活动和预热活动期间
-    if config.ActiveConfig.Live_Active_End > time.Now().Unix() && time.Now().Unix() > config.ActiveConfig.Live_Preheat_Start {
-        f.T["LiveState"] = true
-    }
-    f.T["advertcode"] = f.GetString("advertcode")
-    return f.Render("/weixin/historypush.html", &f.T)
+	myopenid := util.ObjToString(f.GetSession("s_m_openid"))
+	userId := util.ObjToString(f.GetSession("userId"))
+	if myopenid == "" || userId == "" {
+		return f.Redirect("/swordfish/share/-1")
+	}
+	//
+	times := f.GetString("times")
+	if times == "" {
+		times = f.GetString("pushtime")
+	}
+	// 打开推送
+	data, ok := mongodb.FindById("user", userId, nil)
+	if ok && data != nil && len(*data) > 0 {
+		//VIP服务到期
+		vipSubtips := (*data)["i_vip_subtips"]
+		if vipSubtips == 0 {
+			if mongodb.UpdateById("user", userId, bson.M{"$set": bson.M{"i_vip_subtips": 1}}) {
+				return f.Redirect("/front/vipsubscribe/renewPage/exprie")
+			}
+		}
+	}
+	f.T["forceShareFlag"] = public.CheckUserNeedForceShare(myopenid, public.ShareType_push, config.Sysconfig)
+	mynickname, _ := f.Session().Get("s_nickname").(string)
+	myavatar, _ := f.Session().Get("s_avatar").(string)
+	f.T["nickname"] = mynickname
+	f.T["avatar"] = myavatar
+	f.T["signature"] = wx.SignJSSDK(f.Site() + f.Url())
+	f.T["openid"] = se.EncodeString(myopenid)
+	f.T["stime"] = times
+	f.T["isVip"] = util.IntAll((*data)["i_vip_status"]) > 0
+	f.T["isread"] = (*data)["isread"]
+	f.T["userId"] = userId
+	//直播活动和预热活动期间
+	if config.ActiveConfig.Live_Active_End > time.Now().Unix() && time.Now().Unix() > config.ActiveConfig.Live_Preheat_Start {
+		f.T["LiveState"] = true
+	}
+	f.T["advertcode"] = f.GetString("advertcode")
+	return f.Render("/weixin/historypush.html", &f.T)
 }
 
 // 历史推送
 func (f *Front) Historypush() error {
-    return f.Newhistorypush()
+	return f.Newhistorypush()
 }
 
 func (f *Front) HistorypushPaging() error {
-    //
-    if userId, _ := f.GetSession("userId").(string); userId != "" {
-        pageNum, _ := f.GetInteger("pageNum")
-        hasNextPage, _, list := jy.NewSubscribePush().Datas(&jy.SubPushQueryParam{
-            Mgo_bidding:   public.Mgo_Bidding,
-            Bidding:       public.DbConf.Mongodb.Bidding.Collection,
-            Bidding_back:  public.DbConf.Mongodb.Bidding.Collection_back,
-            PushMysql:     public.PushMysql,
-            UserId:        userId,
-            PageNum:       pageNum,
-            SelectTime:    f.GetString("selectTime"),
-            Area:          f.GetString("area"),
-            Buyerclass:    f.GetString("buyerclass"),
-            Subtype:       f.GetString("subtype"),
-            Subscopeclass: f.GetString("subscopeclass"),
-            Key:           f.GetString("key"),
-            City:          f.GetString("city"),
-            Price:         f.GetString("price"),      //价格
-            FileExists:    f.GetString("fileExists"), //附件
-        })
-        jy.NewSubscribePush().MakeCollection(userId, public.Mysql, list, FileSignBool)
-        //		hasNextPage, list, _ := public.HistoryPush.Datas(userId, pageNum, firstPushTime, formatTime)
-        f.ServeJson(map[string]interface{}{
-            "hasNextPage": hasNextPage,
-            "data":        list,
-        })
-    }
-    return nil
+	//
+	if userId, _ := f.GetSession("userId").(string); userId != "" {
+		pageNum, _ := f.GetInteger("pageNum")
+		hasNextPage, _, list := jy.NewSubscribePush().Datas(&jy.SubPushQueryParam{
+			Mgo_bidding:   public.Mgo_Bidding,
+			Bidding:       public.DbConf.Mongodb.Bidding.Collection,
+			Bidding_back:  public.DbConf.Mongodb.Bidding.Collection_back,
+			PushMysql:     public.PushMysql,
+			UserId:        userId,
+			PageNum:       pageNum,
+			SelectTime:    f.GetString("selectTime"),
+			Area:          f.GetString("area"),
+			Buyerclass:    f.GetString("buyerclass"),
+			Subtype:       f.GetString("subtype"),
+			Subscopeclass: f.GetString("subscopeclass"),
+			Key:           f.GetString("key"),
+			City:          f.GetString("city"),
+			Price:         f.GetString("price"),      //价格
+			FileExists:    f.GetString("fileExists"), //附件
+		})
+		jy.NewSubscribePush().MakeCollection(userId, public.Mysql, list, FileSignBool)
+		//		hasNextPage, list, _ := public.HistoryPush.Datas(userId, pageNum, firstPushTime, formatTime)
+		f.ServeJson(map[string]interface{}{
+			"hasNextPage": hasNextPage,
+			"data":        list,
+		})
+	}
+	return nil
 }
 
 // 电脑端招标订阅
 func (m *Front) Subscribe() error {
-    isBuyed := false
-    if userId, _ := m.GetSession("userId").(string); userId != "" {
+	isBuyed := false
+	if userId, _ := m.GetSession("userId").(string); userId != "" {
 
-        vStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
-        isBuyed = vStatus.VipState > 0
-    }
-    m.T["isBuyed"] = isBuyed
-    m.T["logid"] = config.Seoconfig["jydyy"].(string)
-    return m.Render("/pc/subscribe_new.html", &m.T)
+		vStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
+		isBuyed = vStatus.VipState > 0
+	}
+	m.T["isBuyed"] = isBuyed
+	m.T["logid"] = config.Seoconfig["jydyy"].(string)
+	return m.Render("/pc/subscribe_new.html", &m.T)
 }
 
 // 获取高级查询所需的参数
 func getShouldQueryMap(findfield, searchvalue, industry string) []map[string]string {
-    mps := []map[string]string{}
-    for _, v := range strings.Split(industry, ",") {
-        mp := map[string]string{}
-        for _, v := range strings.Split(searchvalue, "+") {
-            mp[v] = findfield
-        }
-        mp[v] = "s_subscopeclass"
-        mps = append(mps, mp)
-    }
-    return mps
+	mps := []map[string]string{}
+	for _, v := range strings.Split(industry, ",") {
+		mp := map[string]string{}
+		for _, v := range strings.Split(searchvalue, "+") {
+			mp[v] = findfield
+		}
+		mp[v] = "s_subscopeclass"
+		mps = append(mps, mp)
+	}
+	return mps
 }
 
 func getSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, findfields, mustquery string) (qstr string) {
-    multi_match := `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
-    //match_phrase := `{"match_phrase": {"s_subscopeclass": "%s"}}`
-    query := `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
-    query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
-    //query_bools_must := `{"bool":{"must":[{"range":{"bidamount":{%s}}}],"must_not":[{"term":{"bidamount":0}},{"term":{"budget":0}}]}},{"bool":{"must":[{"term":{"bidamount":0}},{"range":{"budget":{%s}}}]}},{"bool":{"must":[{"term":{"budget":0}},{"range":{"bidamount":{%s}}}]}}`
-    query_bools_must := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
-    query_bool_must := `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
-    query_missing := `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
-    //rge := `{"range": {"bidamount": {%s}}},{"range": {"budget": {%s}}}`
-    gte := `"gte": %s`
-    lte := `"lte": %s`
-    musts, must_not := []string{}, []string{}
-    if mustquery != "" {
-        musts = append(musts, mustquery)
-    }
-    if keyword != "" {
-        multi_match = fmt.Sprintf(multi_match, "%s", findfields)
-        shoulds := []string{}
-        for _, v := range strings.Split(keyword, "+") {
-            shoulds = append(shoulds, fmt.Sprintf(multi_match, elastic.ReplaceYH(v)))
-        }
-        musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(shoulds, ",")))
-    }
-    if industry != "" {
-        industrys := strings.Split(industry, ",")
-        musts = append(musts, fmt.Sprintf(query_bool_must, `"`+strings.Join(industrys, `","`)+`"`))
-    }
-    if minprice != "" || maxprice != "" {
-        sq := ``
-        if minprice != "" {
-            min, _ := strconv.ParseFloat(minprice, 64)
-            minprice = fmt.Sprintf("%.0f", min*10000)
-            if minprice == "0" {
-                minprice = ""
-            }
-        }
-        if maxprice != "" {
-            max, _ := strconv.ParseFloat(maxprice, 64)
-            maxprice = fmt.Sprintf("%.0f", max*10000)
-            if maxprice == "0" {
-                maxprice = ""
-            }
-        }
-        if minprice != "" {
-            sq += fmt.Sprintf(gte, minprice)
-        }
-        if minprice != "" && maxprice != "" {
-            sq += `,`
-        }
-        if maxprice != "" {
-            sq += fmt.Sprintf(lte, maxprice)
-        }
-        if minprice != "" || maxprice != "" {
-            query_price := fmt.Sprintf(query_bool_should, fmt.Sprintf(query_bools_must, sq, sq))
-            musts = append(musts, query_price)
-        }
-    }
-    if hasBuyerTel != "" {
-        if hasBuyerTel == "y" {
-            must_not = append(must_not, fmt.Sprintf(query_missing, "buyertel"))
-        } else {
-            musts = append(musts, fmt.Sprintf(query_missing, "buyertel"))
-        }
-    }
-    if hasWinnerTel != "" {
-        if hasWinnerTel == "y" {
-            must_not = append(must_not, fmt.Sprintf(query_missing, "winnertel"))
-        } else {
-            musts = append(musts, fmt.Sprintf(query_missing, "winnertel"))
-        }
-    }
-    qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","))
-    return
+	multi_match := `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
+	//match_phrase := `{"match_phrase": {"s_subscopeclass": "%s"}}`
+	query := `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
+	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	//query_bools_must := `{"bool":{"must":[{"range":{"bidamount":{%s}}}],"must_not":[{"term":{"bidamount":0}},{"term":{"budget":0}}]}},{"bool":{"must":[{"term":{"bidamount":0}},{"range":{"budget":{%s}}}]}},{"bool":{"must":[{"term":{"budget":0}},{"range":{"bidamount":{%s}}}]}}`
+	query_bools_must := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	query_bool_must := `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
+	query_missing := `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	//rge := `{"range": {"bidamount": {%s}}},{"range": {"budget": {%s}}}`
+	gte := `"gte": %s`
+	lte := `"lte": %s`
+	musts, must_not := []string{}, []string{}
+	if mustquery != "" {
+		musts = append(musts, mustquery)
+	}
+	if keyword != "" {
+		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
+		shoulds := []string{}
+		for _, v := range strings.Split(keyword, "+") {
+			shoulds = append(shoulds, fmt.Sprintf(multi_match, elastic.ReplaceYH(v)))
+		}
+		musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(shoulds, ",")))
+	}
+	if industry != "" {
+		industrys := strings.Split(industry, ",")
+		musts = append(musts, fmt.Sprintf(query_bool_must, `"`+strings.Join(industrys, `","`)+`"`))
+	}
+	if minprice != "" || maxprice != "" {
+		sq := ``
+		if minprice != "" {
+			min, _ := strconv.ParseFloat(minprice, 64)
+			minprice = fmt.Sprintf("%.0f", min*10000)
+			if minprice == "0" {
+				minprice = ""
+			}
+		}
+		if maxprice != "" {
+			max, _ := strconv.ParseFloat(maxprice, 64)
+			maxprice = fmt.Sprintf("%.0f", max*10000)
+			if maxprice == "0" {
+				maxprice = ""
+			}
+		}
+		if minprice != "" {
+			sq += fmt.Sprintf(gte, minprice)
+		}
+		if minprice != "" && maxprice != "" {
+			sq += `,`
+		}
+		if maxprice != "" {
+			sq += fmt.Sprintf(lte, maxprice)
+		}
+		if minprice != "" || maxprice != "" {
+			query_price := fmt.Sprintf(query_bool_should, fmt.Sprintf(query_bools_must, sq, sq))
+			musts = append(musts, query_price)
+		}
+	}
+	if hasBuyerTel != "" {
+		if hasBuyerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "buyertel"))
+		}
+	}
+	if hasWinnerTel != "" {
+		if hasWinnerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "winnertel"))
+		}
+	}
+	qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","))
+	return
 }
 
 func wxPushViewDatas(index, itype string, keys []elastic.KeyConfig, allquery, findfields, SortQuery, fields string, start, limit int) *[]map[string]interface{} {
-    query_all := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match":1}}}`
-    match_detail := `{"match":{"detail":{"query":"%s","operator": "and"}}}`
-    minq := `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
-    highlightStr := `%s: {"fragment_size": %d,"number_of_fragments": 1}`
-    query_bool := `{"bool":{"must":[%s],"should":[%s],"must_not":[%s],"minimum_should_match":1}}`
-    bool_must := `{"bool":{"must":[%s]}}`
-    //
-    searchDetail := strings.Contains(findfields, `"detail"`)
-    if len(keys) > 0 {
-        qstr := ""
-        new_minq := fmt.Sprintf(minq, "%s", `"title"`)
-        not_new_minq := fmt.Sprintf(minq, "%s", `"title"`) //排除词只查询标题
-        musts := []string{}
-        for _, qs_words := range keys {
-            mq := []string{}
-            notmq := []string{}
-            shoulds := []string{}
-            keywords := []string{}
-            boolmusts := []string{}
-            for _, qs_word := range qs_words.Keys {
-                qs_word = elastic.ReplaceYH(qs_word)
-                keywords = append(keywords, qs_word)
-                boolmusts = append(boolmusts, fmt.Sprintf(new_minq, qs_word))
-            }
-            shoulds = append(shoulds, fmt.Sprintf(bool_must, strings.Join(boolmusts, ",")))
-            if searchDetail {
-                shoulds = append(shoulds, fmt.Sprintf(match_detail, strings.Join(keywords, " ")))
-            }
-            for _, qs_word := range qs_words.NotKeys {
-                notmq = append(notmq, fmt.Sprintf(not_new_minq, elastic.ReplaceYH(qs_word)))
-                if searchDetail {
-                    notmq = append(notmq, fmt.Sprintf(match_detail, elastic.ReplaceYH(qs_word)))
-                }
-            }
-            if len(qs_words.Areas) > 0 {
-                mq = append(mq, fmt.Sprintf(`{"terms":{"area":["%s"]}}`, strings.Join(qs_words.Areas, `","`)))
-            }
-            if len(qs_words.InfoTypes) > 0 {
-                mq = append(mq, fmt.Sprintf(`{"terms":{"toptype":["%s"]}}`, strings.Join(qs_words.InfoTypes, `","`)))
-            }
-            musts = append(musts, fmt.Sprintf(query_bool, strings.Join(mq, ","), strings.Join(shoulds, ","), strings.Join(notmq, ",")))
-        }
-        qstr = fmt.Sprintf(query_all, "", strings.Join(musts, ","))
-
-        qstr = fmt.Sprintf(elastic.FilterQuery, allquery, qstr[1:])
-        ws := []string{}
-        for _, w := range strings.Split(findfields, ",") {
-            ws = append(ws, fmt.Sprintf(highlightStr, w, 1))
-        }
-        qstr = qstr[:len(qstr)-1] + `,` + fmt.Sprintf(elastic.HL, strings.Join(ws, ",")) + `}`
-        if len(fields) > 0 {
-            qstr = qstr[:len(qstr)-1] + `,"_source":[` + fields + "]}"
-        }
-        if len(SortQuery) > 0 {
-            qstr = qstr[:len(qstr)-1] + `,"sort":` + SortQuery + `}`
-        }
-        if start > -1 {
-            qstr = qstr[:len(qstr)-1] + `,"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(limit) + "}"
-        }
-        return elastic.Get(index, itype, qstr)
-    } else {
-        return nil
-    }
+	query_all := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match":1}}}`
+	match_detail := `{"match":{"detail":{"query":"%s","operator": "and"}}}`
+	minq := `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
+	highlightStr := `%s: {"fragment_size": %d,"number_of_fragments": 1}`
+	query_bool := `{"bool":{"must":[%s],"should":[%s],"must_not":[%s],"minimum_should_match":1}}`
+	bool_must := `{"bool":{"must":[%s]}}`
+	//
+	searchDetail := strings.Contains(findfields, `"detail"`)
+	if len(keys) > 0 {
+		qstr := ""
+		new_minq := fmt.Sprintf(minq, "%s", `"title"`)
+		not_new_minq := fmt.Sprintf(minq, "%s", `"title"`) //排除词只查询标题
+		musts := []string{}
+		for _, qs_words := range keys {
+			mq := []string{}
+			notmq := []string{}
+			shoulds := []string{}
+			keywords := []string{}
+			boolmusts := []string{}
+			for _, qs_word := range qs_words.Keys {
+				qs_word = elastic.ReplaceYH(qs_word)
+				keywords = append(keywords, qs_word)
+				boolmusts = append(boolmusts, fmt.Sprintf(new_minq, qs_word))
+			}
+			shoulds = append(shoulds, fmt.Sprintf(bool_must, strings.Join(boolmusts, ",")))
+			if searchDetail {
+				shoulds = append(shoulds, fmt.Sprintf(match_detail, strings.Join(keywords, " ")))
+			}
+			for _, qs_word := range qs_words.NotKeys {
+				notmq = append(notmq, fmt.Sprintf(not_new_minq, elastic.ReplaceYH(qs_word)))
+				if searchDetail {
+					notmq = append(notmq, fmt.Sprintf(match_detail, elastic.ReplaceYH(qs_word)))
+				}
+			}
+			if len(qs_words.Areas) > 0 {
+				mq = append(mq, fmt.Sprintf(`{"terms":{"area":["%s"]}}`, strings.Join(qs_words.Areas, `","`)))
+			}
+			if len(qs_words.InfoTypes) > 0 {
+				mq = append(mq, fmt.Sprintf(`{"terms":{"toptype":["%s"]}}`, strings.Join(qs_words.InfoTypes, `","`)))
+			}
+			musts = append(musts, fmt.Sprintf(query_bool, strings.Join(mq, ","), strings.Join(shoulds, ","), strings.Join(notmq, ",")))
+		}
+		qstr = fmt.Sprintf(query_all, "", strings.Join(musts, ","))
+
+		qstr = fmt.Sprintf(elastic.FilterQuery, allquery, qstr[1:])
+		ws := []string{}
+		for _, w := range strings.Split(findfields, ",") {
+			ws = append(ws, fmt.Sprintf(highlightStr, w, 1))
+		}
+		qstr = qstr[:len(qstr)-1] + `,` + fmt.Sprintf(elastic.HL, strings.Join(ws, ",")) + `}`
+		if len(fields) > 0 {
+			qstr = qstr[:len(qstr)-1] + `,"_source":[` + fields + "]}"
+		}
+		if len(SortQuery) > 0 {
+			qstr = qstr[:len(qstr)-1] + `,"sort":` + SortQuery + `}`
+		}
+		if start > -1 {
+			qstr = qstr[:len(qstr)-1] + `,"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(limit) + "}"
+		}
+		return elastic.Get(index, itype, qstr)
+	} else {
+		return nil
+	}
 }
 
 // 金额转化   金额:0-万元以下单位为元  ,万元以上至亿元以下单位为万元 ,亿元以上单位为亿元。保留 小数点后 2 位,不进行四舍五入。
 func ConversionMoeny(i_money interface{}) string {
-    m := ""
-    if reflect.TypeOf(i_money).Name() == "float64" {
-        m = strconv.FormatFloat(util.Float64All(i_money), 'f', -1, 64)
-    } else {
-        m = util.ObjToString(i_money)
-    }
-    if m == "" {
-        return m
-    }
-    m_arr := strings.Split(m, ".")
-    m_1 := m_arr[0]
-    len_m1 := len([]rune(m_1))
-    if len_m1 >= 9 {
-        m = m_1[0:len_m1-8] + "." + m_1[len_m1-8:len_m1-6] + "亿元"
-    } else if len_m1 >= 5 {
-        m = m_1[0:len_m1-4] + "." + m_1[len_m1-4:len_m1-2] + "万元"
-    } else {
-        if len(m_arr) == 1 {
-            return m + ".00元"
-        }
-        m_2 := m_arr[1]
-        if len([]rune(m_2)) > 1 {
-            m_2 = m_2[0:2]
-        } else {
-            m_2 = m_2[0:1] + "0"
-        }
-        m = m_1 + "." + m_2 + "元"
-    }
-    return m
+	m := ""
+	if reflect.TypeOf(i_money).Name() == "float64" {
+		m = strconv.FormatFloat(util.Float64All(i_money), 'f', -1, 64)
+	} else {
+		m = util.ObjToString(i_money)
+	}
+	if m == "" {
+		return m
+	}
+	m_arr := strings.Split(m, ".")
+	m_1 := m_arr[0]
+	len_m1 := len([]rune(m_1))
+	if len_m1 >= 9 {
+		m = m_1[0:len_m1-8] + "." + m_1[len_m1-8:len_m1-6] + "亿元"
+	} else if len_m1 >= 5 {
+		m = m_1[0:len_m1-4] + "." + m_1[len_m1-4:len_m1-2] + "万元"
+	} else {
+		if len(m_arr) == 1 {
+			return m + ".00元"
+		}
+		m_2 := m_arr[1]
+		if len([]rune(m_2)) > 1 {
+			m_2 = m_2[0:2]
+		} else {
+			m_2 = m_2[0:1] + "0"
+		}
+		m = m_1 + "." + m_2 + "元"
+	}
+	return m
 }

+ 6 - 6
src/jfw/front/vipsubscribe.go

@@ -147,7 +147,7 @@ func (s *Subscribepay) ToSetPage() error {
 		}
 	}
 
-	vipMsg := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
+	vipMsg := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
 	if vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
 		return s.Redirect("/front/tenderSubscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
 	} else if (vSwitch == "" || vSwitch == "v") && vipMsg.VipStatus <= 0 && !vipMsg.IsUpgrade {
@@ -211,7 +211,7 @@ func (s *Subscribepay) Introduce() error {
 				if openid != "" {
 					isSubscribe := CheckUserIsSubscribe(openid)
 					if isSubscribe {
-						FindUserAndCreateSess(openid, s.Session(), "wx", false)
+						FindUserAndCreateSess(openid, s.Session(), "wx", false, true)
 						userId = util.ObjToString(s.GetSession("userId"))
 					}
 				}
@@ -227,7 +227,7 @@ func (s *Subscribepay) Introduce() error {
 	if userId == "" {
 		return s.Redirect("/swordfish/about?v=1")
 	}
-	m := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
+	m := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
 	if m == nil {
 		return s.Redirect("/swordfish/about?v=2")
 	}
@@ -276,7 +276,7 @@ func (s *Subscribepay) ToPurchasePage(flag string) {
 	if userId == "" {
 		return
 	}
-	m := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
+	m := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
 	if m == nil {
 		s.Redirect("/swordfish/about?v=2")
 		return
@@ -421,7 +421,7 @@ func (s *Subscribepay) OpenInvoice(order_code string) {
 
 //预热活动链接跳转
 func (s *Subscribepay) PreheatPoster() {
-	u := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
+	u := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
 	if u != nil {
 		if u.VipStatus == 1 || u.VipStatus == 2 {
 			s.Redirect("/front/vipsubscribe/toSubVipSetPage")
@@ -465,7 +465,7 @@ func (s *Subscribepay) Msgremind() error {
 	if userId == "" {
 		return s.Render("_error.html")
 	}
-	user := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
+	user := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
 	if user == nil {
 		return s.Render("_error.html")
 	}

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

@@ -155,7 +155,7 @@ func LoginInfo(shareid, openid string, Sess interface{}) map[string]interface{}
 	}
 	sess, _ := Sess.(*httpsession.Session)
 	if openid != "" {
-		ok, user, infoData := FindUserAndCreateSess(openid, sess, "pc", true)
+		ok, user, infoData := FindUserAndCreateSess(openid, sess, "pc", true, true)
 		if ok {
 			(*user)["shareid"] = shareid
 			sess.Set("user", *user)

+ 26 - 20
src/jfw/front/ws_dataExport.go

@@ -56,7 +56,7 @@ func (w *WsDataExport) WxToOrderDetail() error {
 			if code != "" {
 				openid := jyutil.Getopenid(code)
 				if openid != "" {
-					FindUserAndCreateSess(openid, w.Session(), "wx", false)
+					FindUserAndCreateSess(openid, w.Session(), "wx", false, true)
 				}
 			}
 		} else {
@@ -232,7 +232,7 @@ func (w *WsDataExport) ToPreview(_id string) error {
 			if code != "" {
 				openid = jyutil.Getopenid(code)
 				if openid != "" {
-					FindUserAndCreateSess(openid, w.Session(), "wx", false)
+					FindUserAndCreateSess(openid, w.Session(), "wx", false, true)
 				}
 			}
 		} else {
@@ -262,7 +262,7 @@ func (w *WsDataExport) SubmitOrder() error {
 			if code != "" {
 				openid = jyutil.Getopenid(code)
 				if openid != "" {
-					FindUserAndCreateSess(openid, w.Session(), "wx", false)
+					FindUserAndCreateSess(openid, w.Session(), "wx", false, true)
 				}
 			}
 		} else {
@@ -356,27 +356,33 @@ func (wd *WsDataExport) SearchExport() error {
 	if userId == "" {
 		return errors.New("未登录")
 	}
+	searchGroup, _ := wd.GetInteger("searchGroup")
+	searchMode, _ := wd.GetInteger("searchMode")
+	wordsMode, _ := wd.GetInteger("wordsMode")
 	//接收超级搜索页面参数
 	reqData := public.BidSearchExport{
-		Keywords:     wd.GetString("searchvalue"),                  //搜索词
-		Publishtime:  wd.GetString("publishtime"),                  //发布时间
-		Area:         wd.GetString("scope"),                        //地区
-		Subtype:      wd.GetString("subtype"),                      //信息类型
-		Minprice:     wd.GetString("minprice"),                     //最低价格
-		Maxprice:     wd.GetString("maxprice"),                     //最高价格
-		Industry:     strings.TrimSpace(wd.GetString("industry")),  //选中的行业
-		SelectType:   wd.GetString("selectType"),                   //标题 or 全文
-		Buyerclass:   wd.GetString("buyerclass"),                   //采购单位行业
-		Hasbuyertel:  wd.GetString("buyertel"),                     //是否有采购电话
-		Haswinnertel: wd.GetString("winnertel"),                    //是否有中标电话
-		SelectIds:    strings.TrimSpace(wd.GetString("selectIds")), //选择信息id
-		Notkey:       wd.GetString("notkey"),                       //排除词
-		City:         wd.GetString("city"),                         //城市
-		FileExists:   wd.GetString("fileExists"),                   //有无附件
+		Keywords:        wd.GetString("searchvalue"),                  //搜索词
+		Publishtime:     wd.GetString("publishtime"),                  //发布时间
+		Area:            wd.GetString("scope"),                        //地区
+		Subtype:         wd.GetString("subtype"),                      //信息类型
+		Minprice:        wd.GetString("minprice"),                     //最低价格
+		Maxprice:        wd.GetString("maxprice"),                     //最高价格
+		Industry:        strings.TrimSpace(wd.GetString("industry")),  //选中的行业
+		SelectType:      wd.GetString("selectType"),                   //标题 or 全文
+		Buyerclass:      wd.GetString("buyerclass"),                   //采购单位行业
+		Hasbuyertel:     wd.GetString("buyertel"),                     //是否有采购电话
+		Haswinnertel:    wd.GetString("winnertel"),                    //是否有中标电话
+		SelectIds:       strings.TrimSpace(wd.GetString("selectIds")), //选择信息id
+		Notkey:          wd.GetString("notkey"),                       //排除词
+		City:            wd.GetString("city"),                         //城市
+		FileExists:      wd.GetString("fileExists"),                   //有无附件
+		SearchGroup:     searchGroup,                                  //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode:      searchMode,                                   //搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode:       wordsMode,                                    //搜索关键词模式;默认0:包含所有,1:包含任意
+		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 	}
 	saveData := reqData.PassBidSearchExport(config.Sysconfig)
-
-	saveData["selectType"] = strings.Join(jy.GetVipState( wd.Session(), *config.Middleground, userId).
+	saveData["selectType"] = strings.Join(jy.GetVipState(wd.Session(), *config.Middleground, userId).
 		GetQueryItems(wd.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId

+ 4 - 3
src/jfw/front/wxMyOrder.go

@@ -1,13 +1,14 @@
 package front
 
 import (
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"errors"
 	"fmt"
 	"jy/src/jfw/config"
 	"jy/src/jfw/wx"
 	"net/url"
 
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+
 	"jy/src/jfw/jyutil"
 
 	"app.yhyue.com/moapp/jypkg/public"
@@ -62,7 +63,7 @@ func (w *WxMyOrder) MyMenu() error {
 			if code != "" {
 				openid := jyutil.Getopenid(code)
 				if openid != "" {
-					FindUserAndCreateSess(openid, w.Session(), "wx", false)
+					FindUserAndCreateSess(openid, w.Session(), "wx", false, true)
 				}
 			}
 		} else {
@@ -187,7 +188,7 @@ func (w *WxMyOrder) Myset() error {
 	userid := util.ObjToString(w.GetSession("userId"))
 	isVip := false
 	if userid != "" {
-		user := jy.GetBigVipUserBaseMsg( w.Session(), *config.Middleground)
+		user := jy.GetBigVipUserBaseMsg(w.Session(), *config.Middleground)
 		if user != nil {
 			if user.VipStatus == 1 || user.VipStatus == 2 {
 				isVip = true

+ 2 - 10
src/jfw/modules/app/src/app/filter/filter.go

@@ -9,6 +9,7 @@ import (
 	util "app.yhyue.com/moapp/jybase/common"
 	fs "app.yhyue.com/moapp/jybase/fsnotify"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/identity"
 )
 
 var RouteConf struct {
@@ -41,16 +42,7 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 		session.Set("mgoUserId", getSession["userId"])
 	}
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
-		identity := Middleground.UserCenter.IdentityByUserId(util.Int64All(getSession["base_user_id"]))
-		if identity != nil {
-			session.SetMultiple(map[string]interface{}{
-				"personId":     identity.PersonId,
-				"userName":     identity.UserName,
-				"accountId":    identity.AccountId,
-				"positionId":   identity.PositionId,
-				"positionType": identity.PositionType,
-			})
-		}
+		identity.SwitchToBest(util.Int64All(getSession["base_user_id"]), session, Middleground)
 	}
 	if !(&logFilter{w, r, getSession}).Do() {
 		return false

+ 1 - 1
src/jfw/modules/app/src/app/filter/mergefilter.go

@@ -25,7 +25,7 @@ type mergeFilter struct {
 
 func (l *mergeFilter) Do() bool {
 	//账户合并-刷新session
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
 			if sUid, ok := val.(string); sUid != "" && ok {
 				log.Printf("账户合并 mergeFilter 自动刷新session old:%s new:%s\n", uid, sUid)

+ 1 - 1
src/jfw/modules/app/src/app/filter/phonefilter.go

@@ -43,7 +43,7 @@ func (l *phoneFilter) Do() bool {
     if qu.Int64All(l.GetSession["positionType"]) == 1 {
         return true
     }
-    userId, _ := l.GetSession["userId"].(string)
+	userId, _ := l.GetSession["mgoUserId"].(string)
     // 请求过滤
     pass := func() bool {
         if !initflag || l.R.Method == "POST" || userId == "" {

+ 40 - 44
src/jfw/modules/app/src/app/front/login.go

@@ -279,26 +279,42 @@ func (l *Login) Sess(ostr string) error {
     str := strings.Split(sewx.DecodeString(strs[0]), ",")
     if len(str) == 4 {
         hasSession := false
-        if l.GetSession("positionId") != nil {
-            hasSession = true
-        } else {
-            loginId := str[0]
-            var identity *pb.Identity
-            if str[1] == "userId" || str[1] == "entUserId" || str[1] == "positionId" {
-                if str[1] == "userId" {
+		hasSession := false
+			loginId := str[0]
+		loginId := str[0]
+		if str[1] == "userId" || str[1] == "entUserId" || str[1] == "positionId" {
+			var identity *pb.Identity
+			sessVal := l.Session().GetMultiple()
+			if str[1] == "userId" {
+				if sessVal["positionType"] == nil || qutil.IntAll(sessVal["positionType"]) != 0 {
                     identity = config.Middleground.UserCenter.IdentityByUserId(qutil.Int64All(loginId))
-                } else if str[1] == "entUserId" {
+				}
+			} else if str[1] == "entUserId" {
+				if sessVal["positionType"] == nil || sessVal["entUserId"] == nil || qutil.Int64All(sessVal["positionType"]) != 1 || qutil.Int64All(sessVal["entUserId"]) != qutil.Int64All(loginId) {
                     identity = config.Middleground.UserCenter.IdentityByEntUserId(qutil.Int64All(loginId))
+				}
                 } else if str[1] == "positionId" {
+				if sessVal["positionId"] == nil || qutil.Int64All(sessVal["positionId"]) != qutil.Int64All(loginId) {
                     identity = config.Middleground.UserCenter.IdentityByPositionId(qutil.Int64All(loginId))
                 }
-                if identity != nil {
-                    if createSession(l.Session(), nil, fmt.Sprint(identity.UserId), 3, l.ResponseWriter) {
+			} else {
+				return l.Redirect("/jyapp/free/mob/err")
+			}
+			if sessVal["userId"] == nil {
+				if createSession(l.Session(), fmt.Sprint(identity.UserId), 3, l.ResponseWriter, false) {
                         hasSession = true
                     } else {
                         log.Println("创建session失败", str)
                     }
+			} else {
+				hasSession = true
                 }
+			if identity != nil {
+				hasSession = hasSession && NewIdentityInfo(identity).Switch(l.Session())
+			}
+		} else {
+			if l.GetSession("userId") != nil {
+				hasSession = true
             } else {
                 loginType := 0
                 if str[1] == "uid" {
@@ -307,17 +323,14 @@ func (l *Login) Sess(ostr string) error {
                         loginType = 1
                     }
                 }
-                if createSession(l.Session(), nil, loginId, loginType, l.ResponseWriter) {
+				if createSession(l.Session(), loginId, loginType, l.ResponseWriter, true) {
                     hasSession = true
-                    identity = config.Middleground.UserCenter.IdentityByUserId(qutil.Int64All(l.GetSession("base_user_id")))
-                } else {
-                    log.Println("创建session失败", str)
-                }
-            }
-            if identity != nil {
+					if identity := config.Middleground.UserCenter.IdentityByUserId(qutil.Int64All(l.GetSession("base_user_id"))); identity != nil {
                 hasSession = hasSession && NewIdentityInfo(identity).Switch(l.Session())
+					}
             } else {
-                log.Println("获取用户身份信息失败", str)
+					log.Println("创建session失败", str)
+				}
             }
         }
         if hasSession {
@@ -997,8 +1010,7 @@ func findWxExistsId(phoneNum string) interface{} {
  * 创建session
  * loginType 0 _id 1 s_phone 2 a_m_openid
  */
-func createSession(s *httpsession.Session, person map[string]interface{}, loginId string, loginType int, rw http.ResponseWriter) bool {
-    if person == nil {
+func createSession(s *httpsession.Session, loginId string, loginType int, rw http.ResponseWriter, isSwitchToBestIdentity bool) bool {
         if loginId == "" {
             return false
         }
@@ -1021,26 +1033,11 @@ func createSession(s *httpsession.Session, person map[string]interface{}, loginI
         default:
             return false
         }
-        field := `{"s_m_openid":1,"s_phone":1,"s_jpushid":1,"s_opushid":1,"s_appponetype":1,"s_headimageurl":1,"s_phone":1,"s_nickname":1,"s_appversion":1,"i_unlimited":1,"s_jyname":1,"base_user_id":1}`
-        data, ok := mongodb.FindOneByField("user", query, field)
-        if !ok {
-            return false
-        }
-        if data == nil || len(*data) == 0 {
-            query = map[string]interface{}{
-                "s_m_openid": loginId,
-                "i_appid":    2,
-            }
-            data, ok = mongodb.FindOneByField("user", query, field)
-            if !ok {
-                return false
-            }
-        }
-        if data == nil || len(*data) == 0 {
+	data, ok := mongodb.FindOneByField("user", query, `{"s_m_openid":1,"s_phone":1,"s_jpushid":1,"s_opushid":1,"s_appponetype":1,"s_headimageurl":1,"s_phone":1,"s_nickname":1,"s_appversion":1,"i_unlimited":1,"s_jyname":1,"base_user_id":1}`)
+	if !ok || data == nil || len(*data) == 0 {
             return false
         }
-        person = *data
-    }
+	person := *data
     sessVal := map[string]interface{}{}
     sessVal["userId"] = BsonIdToSId(person["_id"])
     sessVal["mgoUserId"] = sessVal["userId"]
@@ -1070,6 +1067,9 @@ func createSession(s *httpsession.Session, person map[string]interface{}, loginI
         sessVal["s_jyname"] = person["s_jyname"]
     }
     s.SetMultiple(sessVal)
+	if isSwitchToBestIdentity {
+		SwitchToBest(qutil.Int64All(sessVal["base_user_id"]), s, config.Middleground)
+	}
     //cookie
     maxAge := int(time.Hour * 72 / time.Second) //3天,单位秒
     expires := time.Now().Add(72 * time.Hour)
@@ -1128,7 +1128,6 @@ func getSign(u *UserSign) (string, string) {
 }
 
 func afterLogin(user map[string]interface{}, session *httpsession.Session, rid, oid, phoneType, channel, deviceId string, isNewUser bool, rw http.ResponseWriter) string {
-    log.Println("===>", fmt.Sprint(session.Id()))
     userid := BsonIdToSId(user["_id"])
     old_rid, _ := user["s_jpushid"].(string)
     old_oid, _ := user["s_opushid"].(string)
@@ -1214,10 +1213,7 @@ func afterLogin(user map[string]interface{}, session *httpsession.Session, rid,
             jyutil.UnLoginPush.DeleteBuff(rid)
         }
     }()
-    user["s_jpushid"] = rid
-    user["s_opushid"] = oid
-    user["s_appponetype"] = phoneType
-    createSession(session, user, "", 0, rw)
+	createSession(session, userid, 0, rw, true)
     return createSign(userid, rid, "登录后", session)
 }
 
@@ -1241,7 +1237,7 @@ func autoLogin(sign, from string, session *httpsession.Session, rw http.Response
     // 		return -3
     // 	}
     // }
-    if createSession(session, nil, u.UserId, 0, rw) {
+	if createSession(session, u.UserId, 0, rw, true) {
         return 1
     }
     return 0

+ 508 - 482
src/jfw/modules/app/src/app/front/swordfish.go

@@ -1,353 +1,379 @@
 package front
 
 import (
-    "fmt"
-    _ "jy/src/jfw/modules/app/src/app/filter"
-    . "jy/src/jfw/modules/app/src/app/jyutil"
-    "jy/src/jfw/modules/app/src/jfw/config"
-    "log"
-    "math/rand"
-    "strings"
-    "time"
+	"fmt"
+	_ "jy/src/jfw/modules/app/src/app/filter"
+	. "jy/src/jfw/modules/app/src/app/jyutil"
+	"jy/src/jfw/modules/app/src/jfw/config"
+	"log"
+	"math/rand"
+	"strings"
+	"time"
 
-    util "app.yhyue.com/moapp/jybase/common"
-    . "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jybase/encrypt"
-    . "app.yhyue.com/moapp/jybase/mongodb"
-    "app.yhyue.com/moapp/jybase/redis"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-    "app.yhyue.com/moapp/jypkg/public"
-    utils "jy/src/jfw/modules/app/src/app/jyutil"
+	. "app.yhyue.com/moapp/jybase/date"
 
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	. "app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"app.yhyue.com/moapp/jypkg/public"
 
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-    "go.mongodb.org/mongo-driver/bson"
-    "go.mongodb.org/mongo-driver/bson/primitive"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"go.mongodb.org/mongo-driver/bson"
+	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
 const (
-    INDEX             = "bidding"
-    TYPE              = "bidding"
-    FINDF             = `"title"`
-    bidSearch_field_1 = `"_id","title","publishtime","toptype","subtype","type","area","s_subscopeclass","buyerclass","bidamount","budget","spidercode","site"`
-    bidSearch_field   = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
+	INDEX             = "bidding"
+	TYPE              = "bidding"
+	FINDF             = `"title"`
+	bidSearch_field_1 = `"_id","title","publishtime","toptype","subtype","type","area","s_subscopeclass","buyerclass","bidamount","budget","spidercode","site"`
+	bidSearch_field   = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
 )
 
 // 剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
 func (m *Front) Praise() error {
-    defer util.Catch()
-    var flag = "F"
-    var praiseflag = true
-    thistype := m.GetString("type")
-    uod := m.GetString("uod")
-    util.Try(func() {
-        pdata, _ := mongodb.FindOneByField("praise", `{"s_type":"`+thistype+`"}`, `{"s_no":1}`)
-        if len(*pdata) != 0 {
-            if uod == "U" {
-                praiseflag = mongodb.Update("praise", `{"s_type":"`+thistype+`"}`, `{ "$inc" : { "s_no" : 1 }}`, false, false)
-            } else {
-                praiseflag = mongodb.Update("praise", `{"s_type":"`+thistype+`"}`, `{ "$inc" : { "s_no" : -1 }}`, false, false)
-            }
-            if praiseflag {
-                flag = "T"
-            }
-        }
-    }, func(e interface{}) {
-        log.Println("剑鱼标讯实验室点赞出错", e)
-    })
-    m.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return nil
+	defer util.Catch()
+	var flag = "F"
+	var praiseflag = true
+	thistype := m.GetString("type")
+	uod := m.GetString("uod")
+	util.Try(func() {
+		pdata, _ := mongodb.FindOneByField("praise", `{"s_type":"`+thistype+`"}`, `{"s_no":1}`)
+		if len(*pdata) != 0 {
+			if uod == "U" {
+				praiseflag = mongodb.Update("praise", `{"s_type":"`+thistype+`"}`, `{ "$inc" : { "s_no" : 1 }}`, false, false)
+			} else {
+				praiseflag = mongodb.Update("praise", `{"s_type":"`+thistype+`"}`, `{ "$inc" : { "s_no" : -1 }}`, false, false)
+			}
+			if praiseflag {
+				flag = "T"
+			}
+		}
+	}, func(e interface{}) {
+		log.Println("剑鱼标讯实验室点赞出错", e)
+	})
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }
 
 // 剑鱼标讯保存
 func (m *Front) AjaxReq() error {
-    defer util.Catch()
-    reqType := m.GetString("reqType")
-    var flag = "n"
-    switch reqType {
-    case "feedback": //意见反馈
-        data := make(map[string]interface{})
-        userId, ok := m.GetSession("userId").(string)
-        if !ok || userId == "" {
-            break
-        }
-        userInfo := utils.Compatible.Select(userId, nil)
-        if userInfo == nil || len(*userInfo) <= 0 {
-            break
-        }
-        data["i_type"] = 8
-        data["s_fromName"] = m.GetString("fromName")
-        value := m.GetString("value")
-        if len([]rune(value)) > 200 {
-            value = util.SubString(value, 0, 200)
-        }
-        data["s_remark"] = value
-        //
-        s_name := ""
-        if (*userInfo)["s_name"] != nil {
-            s_name, _ = (*userInfo)["s_name"].(string)
-        }
-        s_nickname := ""
-        if (*userInfo)["s_nickname"] != nil {
-            s_nickname, _ = (*userInfo)["s_nickname"].(string)
-        }
-        s_phone, _ := (*userInfo)["s_phone"].(string)
-        if s_name != "" {
-            data["s_submitname"] = s_name
-        } else if s_nickname != "" {
-            data["s_submitname"] = s_nickname
-        } else if s_phone != "" {
-            data["s_submitname"] = s_phone
-        } else {
-            data["s_submitname"] = userId
-        }
-        //
-        if s_nickname != "" { //昵称
-            data["s_username"] = s_nickname
-        } else if s_name != "" { //s_name
-            data["s_username"] = s_name
-        } else if s_phone != "" {
-            data["s_username"] = s_phone
-        } else { //userId
-            data["s_username"] = userId
-        }
-        //
-        data["s_submitid"] = userId
-        data["s_title"] = m.GetString("title")
-        data["i_status"] = 0
-        data["l_submitdate"] = time.Now().Unix()
-        data["s_source"] = m.GetString("source")
-        data["s_fkid"] = m.GetString("fkid")
-        data["s_from"] = "app"
-        if len(mongodb.Save("interaction", data)) > 0 {
-            flag = "y"
-        }
-        break
-    case "subscribe": //直接订阅
-        if userid := util.ObjToString(m.GetSession("userId")); userid != "" {
-            r := utils.Compatible.Select(userid, `{"o_jy":1}`)
-            o_jy, _ := (*r)["o_jy"].(map[string]interface{})
-            a_key, _ := o_jy["a_key"].([]interface{})
-            keysArray := processKeyword(m.GetString("keys"))
-            if keysArray == nil {
-                break
-            }
-            var isExists bool
-            for _, v := range a_key {
-                //count := 0
-                //for _, kay := range keysArray {
-                keyMap, _ := v.(map[string]interface{})
-                key, _ := keyMap["key"].([]interface{})
-                kystr := ""
-                for _, ky := range key {
-                    kystr = kystr + " " + ky.(string)
-                }
-                if strings.TrimSpace(m.GetString("keys")) == strings.TrimSpace(kystr) {
-                    isExists = true
-                    flag = "y"
-                    break
-                }
-            }
-            //如果不存在
-            if !isExists {
-                if len(a_key) >= 10 {
-                    flag = "o"
-                } else {
-                    ok := utils.Compatible.Update(userid,
-                        bson.M{
-                            "$push": bson.M{"o_jy.a_key": bson.M{"key": keysArray, "area": []string{}, "infotype": []string{}, "notkey": []string{}, "from": 1}},
-                            "$set":  bson.M{"i_ts_guide": 1, "o_jy.l_modifydate": time.Now().Unix()},
-                        })
-
-                    if ok {
-                        flag = "y"
-                    }
-                }
-            } else {
-                if utils.Compatible.Update(userid,
-                    bson.M{
-                        "$set": bson.M{"i_ts_guide": 1},
-                    }) {
-                    flag = "y"
-                }
+	defer util.Catch()
+	reqType := m.GetString("reqType")
+	var flag = "n"
+	switch reqType {
+	case "feedback": //意见反馈
+		data := make(map[string]interface{})
+		userId, ok := m.GetSession("userId").(string)
+		if !ok || userId == "" {
+			break
+		}
+		userInfo, ok := mongodb.FindById("user", userId, nil)
+		if !ok {
+			break
+		}
+		data["i_type"] = 8
+		data["s_fromName"] = m.GetString("fromName")
+		value := m.GetString("value")
+		if len([]rune(value)) > 200 {
+			value = util.SubString(value, 0, 200)
+		}
+		data["s_remark"] = value
+		//
+		s_name := ""
+		if (*userInfo)["s_name"] != nil {
+			s_name, _ = (*userInfo)["s_name"].(string)
+		}
+		s_nickname := ""
+		if (*userInfo)["s_nickname"] != nil {
+			s_nickname, _ = (*userInfo)["s_nickname"].(string)
+		}
+		s_phone, _ := (*userInfo)["s_phone"].(string)
+		if s_name != "" {
+			data["s_submitname"] = s_name
+		} else if s_nickname != "" {
+			data["s_submitname"] = s_nickname
+		} else if s_phone != "" {
+			data["s_submitname"] = s_phone
+		} else {
+			data["s_submitname"] = userId
+		}
+		//
+		if s_nickname != "" { //昵称
+			data["s_username"] = s_nickname
+		} else if s_name != "" { //s_name
+			data["s_username"] = s_name
+		} else if s_phone != "" {
+			data["s_username"] = s_phone
+		} else { //userId
+			data["s_username"] = userId
+		}
+		//
+		data["s_submitid"] = userId
+		data["s_title"] = m.GetString("title")
+		data["i_status"] = 0
+		data["l_submitdate"] = time.Now().Unix()
+		data["s_source"] = m.GetString("source")
+		data["s_fkid"] = m.GetString("fkid")
+		data["s_from"] = "app"
+		if len(mongodb.Save("interaction", data)) > 0 {
+			flag = "y"
+		}
+		break
+	case "subscribe": //直接订阅
+		if userid := util.ObjToString(m.GetSession("userId")); userid != "" {
+			//r, _ := mongodb.FindById("user", userid, `{"o_jy":1}`)
+			o_jy := jy.GetSubScribeInfo(m.Session(), mongodb, "f", "10000")
+			//o_jy, _ := (*r)["o_jy"].(map[string]interface{})
+			a_key, _ := (*o_jy)["a_key"].([]interface{})
+			keysArray := processKeyword(m.GetString("keys"))
+			if keysArray == nil {
+				break
+			}
+			var isExists bool
+			for _, v := range a_key {
+				//count := 0
+				//for _, kay := range keysArray {
+				keyMap, _ := v.(map[string]interface{})
+				key, _ := keyMap["key"].([]interface{})
+				kystr := ""
+				for _, ky := range key {
+					kystr = kystr + " " + ky.(string)
+				}
+				if strings.TrimSpace(m.GetString("keys")) == strings.TrimSpace(kystr) {
+					isExists = true
+					flag = "y"
+					break
+				}
+			}
+			positionType := util.Int64All(m.GetSession("positionType"))
+			//如果不存在
+			ok := false
+			if !isExists {
+				if len(a_key) >= 10 {
+					flag = "o"
+				} else {
 
-            }
-        }
-        break
-    }
-    m.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return nil
+					if positionType == 0 {
+						ok = mongodb.UpdateById("user", userid,
+							bson.M{
+								"$push": bson.M{"o_jy.a_key": bson.M{"key": keysArray, "area": []string{}, "infotype": []string{}, "notkey": []string{}, "from": 1}},
+								"$set":  bson.M{"i_ts_guide": 1, "o_jy.l_modifydate": time.Now().Unix()},
+							})
+					} else {
+						query := map[string]interface{}{
+							"i_userid": util.Int64All(m.GetSession("entUserId")),
+							"i_entid":  util.Int64All(m.GetSession("entId")),
+							"i_type":   2,
+						}
+						if mongodb.Update("entniche_rule", query, bson.M{
+							"$push": bson.M{"o_entniche.a_key": bson.M{"key": keysArray, "area": []string{}, "infotype": []string{}, "notkey": []string{}, "from": 1}},
+							"$set":  bson.M{"i_ts_guide": 1, "o_entniche.l_modifydate": time.Now().Unix()},
+						}, true, false) {
+							ok = true
+						}
+					}
+					if ok {
+						flag = "y"
+					}
+				}
+			} else {
+				/* if mongodb.UpdateById("user", userid,
+				        bson.M{
+				                "$set": bson.M{"i_ts_guide": 1},
+				        }) {
+				        flag = "y"
+				}*/
+				query := map[string]interface{}{
+					"i_userid": util.Int64All(m.GetSession("entUserId")),
+					"i_entid":  util.Int64All(m.GetSession("entId")),
+					"i_type":   2,
+				}
+				if mongodb.Update("entniche_rule", query, bson.M{
+					"$push": bson.M{"o_entniche.a_key": bson.M{"key": keysArray, "area": []string{}, "infotype": []string{}, "notkey": []string{}, "from": 1}},
+					"$set":  bson.M{"i_ts_guide": 1, "o_entniche.l_modifydate": time.Now().Unix()},
+				}, true, false) {
+					flag = "y"
+				}
+			}
+		}
+		break
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }
 
 // 获取我的反馈列表
 func (f *Front) MyFeedbacks() error {
-    userId, _ := f.GetSession("userId").(string)
-    if userId == "" {
-        return f.Redirect("/jyapp/free/mob/err")
-    }
-    list, ok := mongodb.Find("interaction", bson.M{"s_submitid": userId}, `{"l_submitdate":-1}`, `{"s_remark":1,"l_submitdate":1,"s_opinion":1,"i_status":1}`, false, 0, 200)
-    if !ok {
-        return f.Redirect("/jyapp/free/mob/err")
-    }
-    mongodb.Update("jyapp_notice", map[string]interface{}{
-        "s_userid": util.ObjToString(f.GetSession("userId")),
-        "s_type":   "feedback",
-    }, map[string]interface{}{
-        "$set": map[string]interface{}{
-            "i_unread":    0,
-            "l_timestamp": time.Now().Unix(),
-        },
-    }, false, true)
-    if f.Method() == "GET" {
-        f.T["list"] = list
-        f.T["flag"] = true
-        return f.Render("/weixin/feedback.html")
-    }
-    f.ServeJson(map[string]interface{}{
-        "list": list,
-    })
-    return nil
+	userId, _ := f.GetSession("userId").(string)
+	if userId == "" {
+		return f.Redirect("/jyapp/free/mob/err")
+	}
+	list, ok := mongodb.Find("interaction", bson.M{"s_submitid": userId}, `{"l_submitdate":-1}`, `{"s_remark":1,"l_submitdate":1,"s_opinion":1,"i_status":1}`, false, 0, 200)
+	if !ok {
+		return f.Redirect("/jyapp/free/mob/err")
+	}
+	mongodb.Update("jyapp_notice", map[string]interface{}{
+		"s_userid": util.ObjToString(f.GetSession("userId")),
+		"s_type":   "feedback",
+	}, map[string]interface{}{
+		"$set": map[string]interface{}{
+			"i_unread":    0,
+			"l_timestamp": time.Now().Unix(),
+		},
+	}, false, true)
+	if f.Method() == "GET" {
+		f.T["list"] = list
+		f.T["flag"] = true
+		return f.Render("/weixin/feedback.html")
+	}
+	f.ServeJson(map[string]interface{}{
+		"list": list,
+	})
+	return nil
 }
 
 func getRewardText() (string, string) {
-    rewardText, _ := config.Sysconfig["rewardText"].([]interface{})
-    advertText, _ := config.Sysconfig["advertText"].([]interface{})
-    randVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(rewardText))
-    if len(advertText) != 0 {
-        advVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(advertText))
-        return util.ObjToString(rewardText[randVal]), util.ObjToString(advertText[advVal])
-    } else {
-        return util.ObjToString(rewardText[randVal]), ""
-    }
+	rewardText, _ := config.Sysconfig["rewardText"].([]interface{})
+	advertText, _ := config.Sysconfig["advertText"].([]interface{})
+	randVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(rewardText))
+	if len(advertText) != 0 {
+		advVal := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(advertText))
+		return util.ObjToString(rewardText[randVal]), util.ObjToString(advertText[advVal])
+	} else {
+		return util.ObjToString(rewardText[randVal]), ""
+	}
 }
 func (m *Front) About() error {
-    return m.Render("/weixin/about.html")
+	return m.Render("/weixin/about.html")
 }
 func (m *Front) WxsearchlistPaging() {
-    defer util.Catch()
-    var list *[]map[string]interface{}
+	defer util.Catch()
+	var list *[]map[string]interface{}
 
-    pageNum, _ := m.GetInteger("pageNum")
-    searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
-    userid := util.ObjToString(m.GetSession("userId"))
-    if userid != "" {
-        //历史记录
-        history := redis.GetStr("other", "s_"+userid)
-        arrs := bidsearch.AddHistory(history, searchvalue)
-        redis.Del("other", "s_"+userid)
-        redis.Put("other", "s_"+userid, strings.Join(arrs, ","), -1)
-        m.T["history"] = arrs
-    }
-
-    isLimit := 1
-    var (
-        b_word, a_word string
-        secondKWS      = ""
-        secondFlag     = ""
-        queryItems     []string
-        isPayedUser    bool
-        hasNextPage    bool
-        secondList     []map[string]interface{}
-        fileExists     = ""
-        city           = ""
-    )
+	pageNum, _ := m.GetInteger("pageNum")
+	searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
+	userid := util.ObjToString(m.GetSession("userId"))
+	if userid != "" {
+		//历史记录
+		history := redis.GetStr("other", "s_"+userid)
+		arrs := bidsearch.AddHistory(history, searchvalue)
+		redis.Del("other", "s_"+userid)
+		redis.Put("other", "s_"+userid, strings.Join(arrs, ","), -1)
+		m.T["history"] = arrs
+	}
 
-    if searchvalue != "" {
-        selectType := m.GetString("selectType")
-        subtype := m.GetString("subtype")
-        scope := m.GetString("scope")
-        publishtime := m.GetString("publishtime")
-        industry := strings.TrimSpace(m.GetString("industry"))
-        minprice := m.GetString("minprice")
-        maxprice := m.GetString("maxprice")
-        winner := "" //仅大会员用户可以查询中标企业
-        //高级筛选 仅vip用户可查询
-        var hasBuyerTel, hasWinnerTel string = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
-        buyerclass := ""                              //采购单位类别
-        var notkey string = ""                        //排除词
-        fileExists = m.GetString("fileExists")        //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
+	isLimit := 1
+	var (
+		b_word, a_word string
+		secondKWS      = ""
+		secondFlag     = ""
+		queryItems     []string
+		isPayedUser    bool
+		hasNextPage    bool
+		secondList     []map[string]interface{}
+		fileExists     = ""
+		city           = ""
+	)
 
-        isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50, m.Session(), *config.Middleground)
-        if isPayedUser {
-            buyerclass = m.GetString("buyerclass")
-            hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
-            notkey = m.GetString("notkey")
-            city = m.GetString("city")
-        }
-        //校验是否有大会员中标企业查询权限
-        bigBaseMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
-        if bigBaseMsg.CheckBigVipBackPower("search") {
-            winner = m.GetString("winner")
-        }
-        //全文检索限制
-        searchLimit := public.IsSearchLimit(queryItems)
-        if searchLimit {
-            //limitFlag = public.Lst.Flag
-            isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
-            if isLimit == 1 { //没有被限制
-                defer public.Lst.Limit()
-            }
-        }
-        //第一页数据展示多字段(table表格需要)
-        filed := bidSearch_field_1
-        if pageNum == 1 {
-            filed = bidSearch_field
-        }
-        if isLimit == 1 {
-            secondKWS, b_word, a_word, _, secondFlag, _, _, list = bidsearch.SearchData("app", m.Request, pageNum, util.ObjToString(m.GetSession("userId")), secondKWS, searchvalue, scope, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, pageNum, true, queryItems, filed, notkey, isPayedUser, false, "", bidsearch.SearchPageSize_APP, config.Sysconfig)
-        }
-    }
+	if searchvalue != "" {
+		selectType := m.GetString("selectType")
+		subtype := m.GetString("subtype")
+		scope := m.GetString("scope")
+		publishtime := m.GetString("publishtime")
+		industry := strings.TrimSpace(m.GetString("industry"))
+		minprice := m.GetString("minprice")
+		maxprice := m.GetString("maxprice")
+		winner := "" //仅大会员用户可以查询中标企业
+		//高级筛选 仅vip用户可查询
+		var hasBuyerTel, hasWinnerTel string = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
+		buyerclass := ""                              //采购单位类别
+		var notkey string = ""                        //排除词
+		fileExists = m.GetString("fileExists")        //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
+		isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50, m.Session(), *config.Middleground)
+		if isPayedUser {
+			buyerclass = m.GetString("buyerclass")
+			hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
+			notkey = m.GetString("notkey")
+			city = m.GetString("city")
+		}
+		//校验是否有大会员中标企业查询权限
+		bigBaseMsg := jy.GetBigVipUserBaseMsg( m.Session(),  *config.Middleground)
+		if bigBaseMsg.CheckBigVipBackPower("search") {
+			winner = m.GetString("winner")
+		}
+		//全文检索限制
+		searchLimit := public.IsSearchLimit(queryItems)
+		if searchLimit {
+			//limitFlag = public.Lst.Flag
+			isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
+			if isLimit == 1 { //没有被限制
+				defer public.Lst.Limit()
+			}
+		}
+		//第一页数据展示多字段(table表格需要)
+		filed := bidSearch_field_1
+		if pageNum == 1 {
+			filed = bidSearch_field
+		}
+		if isLimit == 1 {
+			secondKWS, b_word, a_word, _, secondFlag, _, _, list = bidsearch.SearchData("app", m.Request, pageNum, util.ObjToString(m.GetSession("userId")), secondKWS, searchvalue, scope, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, pageNum, true, queryItems, filed, notkey, isPayedUser, false, "", bidsearch.SearchPageSize_APP, config.Sysconfig)
+		}
+	}
 
-    secondList, _, hasNextPage = bidsearch.LisetData(3, pageNum, list, secondFlag, config.Seoconfig, isPayedUser, 50, userid)
-    m.ServeJson(map[string]interface{}{
-        "limitFlag":     false,
-        "status":        isLimit,
-        "list":          list,
-        "hasNextPage":   hasNextPage,
-        "history":       m.T["history"],
-        "msgset":        m.T["msgset"],
-        "interceptWord": a_word,
-        "keyWord":       b_word,
-        "isLogin":       m.GetSession("userId") != nil,
-        "secondFlag":    secondFlag,
-        "secondList":    secondList,
-        "secondKWS":     secondKWS,
-    })
+	secondList, _, hasNextPage = bidsearch.LisetData(3, pageNum, list, secondFlag, config.Seoconfig, isPayedUser, 50, userid)
+	m.ServeJson(map[string]interface{}{
+		"limitFlag":     false,
+		"status":        isLimit,
+		"list":          list,
+		"hasNextPage":   hasNextPage,
+		"history":       m.T["history"],
+		"msgset":        m.T["msgset"],
+		"interceptWord": a_word,
+		"keyWord":       b_word,
+		"isLogin":       m.GetSession("userId") != nil,
+		"secondFlag":    secondFlag,
+		"secondList":    secondList,
+		"secondKWS":     secondKWS,
+	})
 
 }
 
 // 预览结果
 func (m *Front) WxpushView() error {
-    defer util.Catch()
-    userid := util.ObjToString(m.GetSession("userId"))
-    if userid == "" {
-        return m.Redirect("/jyapp/login")
-    }
-    a_key, list := public.PushViewDatas(userid, "", bidSearch_field_1, 1, bidsearch.SearchPageSize_APP)
-    public.BidListConvert("", list)
-    m.T["firstPage"] = list
-    m.T["hasNextPage"] = list != nil && len(*list) == bidsearch.SearchPageSize_APP
-    m.T["pageSize"] = bidsearch.SearchPageSize_APP
-    m.T["a_key"] = a_key
-    return m.Render("/weixin/resultpreview.html", &m.T)
+	defer util.Catch()
+	userid := util.ObjToString(m.GetSession("userId"))
+	if userid == "" {
+		return m.Redirect("/jyapp/login")
+	}
+	a_key, list := public.PushViewDatas(userid, "", bidSearch_field_1, 1, bidsearch.SearchPageSize_APP)
+	public.BidListConvert("", list)
+	m.T["firstPage"] = list
+	m.T["hasNextPage"] = list != nil && len(*list) == bidsearch.SearchPageSize_APP
+	m.T["pageSize"] = bidsearch.SearchPageSize_APP
+	m.T["a_key"] = a_key
+	return m.Render("/weixin/resultpreview.html", &m.T)
 }
 func (m *Front) WxpushViewPaging() {
-    defer util.Catch()
-    var list *[]map[string]interface{}
-    pageNum, _ := m.GetInteger("pageNum")
-    if userid := util.ObjToString(m.GetSession("userId")); userid != "" && pageNum <= bidsearch.SearchMaxPageNum_APP {
-        _, list = public.PushViewDatas(userid, "", bidSearch_field_1, pageNum, bidsearch.SearchPageSize_APP)
-    }
-    public.BidListConvert("", list)
-    m.ServeJson(map[string]interface{}{
-        "list":        list,
-        "hasNextPage": list != nil && len(*list) == bidsearch.SearchPageSize_APP && pageNum < bidsearch.SearchMaxPageNum_APP,
-    })
+	defer util.Catch()
+	var list *[]map[string]interface{}
+	pageNum, _ := m.GetInteger("pageNum")
+	if userid := util.ObjToString(m.GetSession("userId")); userid != "" && pageNum <= bidsearch.SearchMaxPageNum_APP {
+		_, list = public.PushViewDatas(userid, "", bidSearch_field_1, pageNum, bidsearch.SearchPageSize_APP)
+	}
+	public.BidListConvert("", list)
+	m.ServeJson(map[string]interface{}{
+		"list":        list,
+		"hasNextPage": list != nil && len(*list) == bidsearch.SearchPageSize_APP && pageNum < bidsearch.SearchMaxPageNum_APP,
+	})
 }
 
 /*func (f *Front) HasPushHistory() {
@@ -441,126 +467,126 @@ func (m *Front) WxpushViewPaging() {
 
 // 历史推送
 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)
-        }
-    }
-    userId, _ := f.GetSession("userId").(string)
-    if userId != "" {
-        vipSubtips := 1
-        // 打开推送
-        data := utils.Compatible.Select(userId, `{"i_vip_subtips":1,"isread":1}`)
-        if data != nil && len(*data) > 0 {
-            //VIP服务到期
-            i_vip_subtips := (*data)["i_vip_subtips"]
-            if i_vip_subtips == 0 {
-                if utils.Compatible.Update(userId, bson.M{"$set": bson.M{"i_vip_subtips": 1}}) {
-                    vipSubtips = 0
-                }
-            }
-        }
-        f.T["isread"] = (*data)["isread"]
-        f.T["vipSubtips"] = vipSubtips
-        f.T["userId"] = userId
-        f.T["isIosExam"], f.T["isIosExamPhone"], f.T["isVip"], _ = IosExamInfo(f.Action, true, false)
-    }
-    return f.Render("/weixin/historypush.html", &f.T)
+	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)
+		}
+	}
+	userId, _ := f.GetSession("userId").(string)
+	if userId != "" {
+		vipSubtips := 1
+		// 打开推送
+		data, ok := mongodb.FindById("user", userId, `{"i_vip_subtips":1,"isread":1}`)
+		if ok && data != nil && len(*data) > 0 {
+			//VIP服务到期
+			i_vip_subtips := (*data)["i_vip_subtips"]
+			if i_vip_subtips == 0 {
+				if mongodb.UpdateById("user", userId, bson.M{"$set": bson.M{"i_vip_subtips": 1}}) {
+					vipSubtips = 0
+				}
+			}
+		}
+		f.T["isread"] = (*data)["isread"]
+		f.T["vipSubtips"] = vipSubtips
+		f.T["userId"] = userId
+		f.T["isIosExam"], f.T["isIosExamPhone"], f.T["isVip"], _ = IosExamInfo(f.Action, true, false)
+	}
+	return f.Render("/weixin/historypush.html", &f.T)
 }
 
 func MFollow(userId, sid string) (bool, string) {
-    defer util.Catch()
-    var followId string
-    followFlag := false
-    follows := public.BaseMysql.FindOne("follow_project_monitor", map[string]interface{}{"s_userid": userId, "s_id": sid}, "id", "")
-    if follows != nil && len(*follows) > 0 {
-        followId = encrypt.EncodeArticleId2ByCheck(util.InterfaceToStr((*follows)["id"]))
-        followFlag = true
-    }
-    return followFlag, followId
+	defer util.Catch()
+	var followId string
+	followFlag := false
+	follows := public.BaseMysql.FindOne("follow_project_monitor", map[string]interface{}{"s_userid": userId, "s_id": sid}, "id", "")
+	if follows != nil && len(*follows) > 0 {
+		followId = encrypt.EncodeArticleId2ByCheck(util.InterfaceToStr((*follows)["id"]))
+		followFlag = true
+	}
+	return followFlag, followId
 }
 func wxvisitD(sid, userId string, isPayUser bool) (objdata map[string]interface{}) {
-    defer util.Catch()
-    var obj map[string]interface{}
-    if len(sid) > 5 {
-        aobj, ok := public.Mgo_Bidding.FindById(public.DbConf.Mongodb.Bidding.Collection, sid, public.MgoBiddingFields)
-        if ok && (aobj == nil || *aobj == nil || len(*aobj) == 0) {
-            aobj, ok = public.Mgo_Bidding.FindById(public.DbConf.Mongodb.Bidding.Collection_back, sid, public.MgoBiddingFields)
-        }
-        //aobj, ok := elastic.GetByIdField("bidding", "bidding", sid, ""), true
-        obj = *aobj
-        if ok && obj != nil && len(obj) >= 3 {
-            if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
-                for k, _ := range obj {
-                    if k != "title" && k != "area" && k != "subtype" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" && k != "site" && k != "spidercode" && k != "recommended_service" &&
-                        k != "owner" && k != "total_investment" && k != "projectaddr" && k != "projectperiod" && k != "approvedept" && k != "approvecontent" && k != "approvecode" && k != "approvenumber" && k != "approvetime" && k != "approvestatus" && k != "project_scale" && k != "projectname" {
-                        delete(obj, k)
-                    }
-                }
-            }
-            obj["_id"] = encrypt.EncodeArticleId2ByCheck(sid)
-            // obj["url"] = obj["href"]
-            pt := obj["publishtime"]
-            obj["l_publishtime"] = pt
-            obj["publishtime"] = FormatDateWithObj(&pt, Date_Full_Layout)
-            //查询是否关注
-            obj["followFlag"] = false
-            obj["hasSession"] = false
-            var infoformat = util.IntAllDef(obj["infoformat"], 1)
-            obj["infoformat"] = infoformat
-            //精准字段(竞争对手的地址) 或  拟建项目
-            if obj["competehref"] != nil || infoformat == 2 {
-                delete(obj, "href")
-            }
-            if userId != "" {
-                //pcode, _ := obj["projectcode"].(string)
-                //pname, _ := obj["projectname"].(string)
-                titleTmp := util.ObjToString(obj["title"])
-                obj["followFlag"], obj["followId"] = MFollow(userId, sid)
-                if len([]rune(titleTmp)) > 100 {
-                    titleTmp = string([]rune(titleTmp)[:100]) + "..."
-                }
-                titleTmp = public.ClearHtml.ReplaceAllString(titleTmp, "")
-                obj["title"] = titleTmp
-                obj["hasSession"] = true
+	defer util.Catch()
+	var obj map[string]interface{}
+	if len(sid) > 5 {
+		aobj, ok := public.Mgo_Bidding.FindById(public.DbConf.Mongodb.Bidding.Collection, sid, public.MgoBiddingFields)
+		if ok && (aobj == nil || *aobj == nil || len(*aobj) == 0) {
+			aobj, ok = public.Mgo_Bidding.FindById(public.DbConf.Mongodb.Bidding.Collection_back, sid, public.MgoBiddingFields)
+		}
+		//aobj, ok := elastic.GetByIdField("bidding", "bidding", sid, ""), true
+		obj = *aobj
+		if ok && obj != nil && len(obj) >= 3 {
+			if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
+				for k, _ := range obj {
+					if k != "title" && k != "area" && k != "subtype" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" && k != "site" && k != "spidercode" && k != "recommended_service" &&
+						k != "owner" && k != "total_investment" && k != "projectaddr" && k != "projectperiod" && k != "approvedept" && k != "approvecontent" && k != "approvecode" && k != "approvenumber" && k != "approvetime" && k != "approvestatus" && k != "project_scale" && k != "projectname" {
+						delete(obj, k)
+					}
+				}
+			}
+			obj["_id"] = encrypt.EncodeArticleId2ByCheck(sid)
+			// obj["url"] = obj["href"]
+			pt := obj["publishtime"]
+			obj["l_publishtime"] = pt
+			obj["publishtime"] = FormatDateWithObj(&pt, Date_Full_Layout)
+			//查询是否关注
+			obj["followFlag"] = false
+			obj["hasSession"] = false
+			var infoformat = util.IntAllDef(obj["infoformat"], 1)
+			obj["infoformat"] = infoformat
+			//精准字段(竞争对手的地址) 或  拟建项目
+			if obj["competehref"] != nil || infoformat == 2 {
+				delete(obj, "href")
+			}
+			if userId != "" {
+				//pcode, _ := obj["projectcode"].(string)
+				//pname, _ := obj["projectname"].(string)
+				titleTmp := util.ObjToString(obj["title"])
+				obj["followFlag"], obj["followId"] = MFollow(userId, sid)
+				if len([]rune(titleTmp)) > 100 {
+					titleTmp = string([]rune(titleTmp)[:100]) + "..."
+				}
+				titleTmp = public.ClearHtml.ReplaceAllString(titleTmp, "")
+				obj["title"] = titleTmp
+				obj["hasSession"] = true
 
-                //obj["title"] = util.If(len([]rune(titleTmp)) > 100, string([]rune(titleTmp)[:100])+"...", string(titleTmp)).(string)
-            }
-            if strings.Trim(util.ObjToString(obj["detail"]), " ") == "" {
-                obj["detail"] = ""
-            }
-        }
-    }
-    return obj
+				//obj["title"] = util.If(len([]rune(titleTmp)) > 100, string([]rune(titleTmp)[:100])+"...", string(titleTmp)).(string)
+			}
+			if strings.Trim(util.ObjToString(obj["detail"]), " ") == "" {
+				obj["detail"] = ""
+			}
+		}
+	}
+	return obj
 }
 func (f *Front) GetRecomKWs() {
-    count, _ := f.GetInteger("count")
-    f.ServeJson(public.RecomKws.GetRecomKws(f.GetString("value"), count, float32(config.Sysconfig["recommendThreshold"].(float64))))
+	count, _ := f.GetInteger("count")
+	f.ServeJson(public.RecomKws.GetRecomKws(f.GetString("value"), count, float32(config.Sysconfig["recommendThreshold"].(float64))))
 }
 
 // 记录用户行为--推荐关键词
 func (f *Front) BehaviorRecord() {
-    flag := saveBehaviorRecord(f.Session(),
-        bson.M{
-            "s_word":   f.GetString("value"),
-            "s_type":   f.GetString("type"),
-            "s_source": f.GetString("source"),
-        })
-    f.ServeJson(bson.M{"flag": flag})
+	flag := saveBehaviorRecord(f.Session(),
+		bson.M{
+			"s_word":   f.GetString("value"),
+			"s_type":   f.GetString("type"),
+			"s_source": f.GetString("source"),
+		})
+	f.ServeJson(bson.M{"flag": flag})
 }
 
 // 记录用户行为
 func saveBehaviorRecord(sess *httpsession.Session, data bson.M) bool {
-    userId, _ := sess.Get("userId").(string)
-    nickName, _ := sess.Get("s_nickname").(string)
-    data["s_userid"] = userId
-    data["s_nickname"] = nickName
-    data["l_createtime"] = time.Now().Unix()
-    return len(mongodb.Save("behavior", data)) > 0
+	userId, _ := sess.Get("userId").(string)
+	nickName, _ := sess.Get("s_nickname").(string)
+	data["s_userid"] = userId
+	data["s_nickname"] = nickName
+	data["l_createtime"] = time.Now().Unix()
+	return len(mongodb.Save("behavior", data)) > 0
 }
 
 /*
@@ -578,80 +604,80 @@ func saveBehaviorRecord(sess *httpsession.Session, data bson.M) bool {
 	}
 */
 func (m *Front) DelWxHistorySearch() {
-    defer util.Catch()
-    //定义一个无用参数作为返回值
-    var rt string = "rt"
-    userId := m.GetSession("userId")
-    history := redis.GetStr("other", "s_"+userId.(string))
-    if len(history) > 0 || history != "" {
-        redis.Del("other", "s_"+userId.(string))
-    }
-    m.ServeJson(map[string]interface{}{
-        "rt": rt,
-    })
+	defer util.Catch()
+	//定义一个无用参数作为返回值
+	var rt string = "rt"
+	userId := m.GetSession("userId")
+	history := redis.GetStr("other", "s_"+userId.(string))
+	if len(history) > 0 || history != "" {
+		redis.Del("other", "s_"+userId.(string))
+	}
+	m.ServeJson(map[string]interface{}{
+		"rt": rt,
+	})
 }
 func (m *Front) GetIndexData() {
-    defer util.Catch()
-    redis_obj := redis.Get("other", "sw_index")
-    var one map[string]interface{}
-    if redis_obj != nil {
-        one = redis_obj.(map[string]interface{})
-        log.Println("newpage from the cache...")
-    } else {
-        rs, err := mongodb.Find("swordfish_index", nil, `{"_id":-1}`, nil, false, 0, 1)
-        if err {
-            one = (*rs)[0]
-            one["i_site"] = util.IntAll(one["i_entsite"]) + util.IntAll(one["i_govsite"])
-            avg := util.IntAll(one["i_bidmonth"])/21 + util.IntAll(one["i_bidmonth"])%21
-            one["i_avg"] = avg
-            one["i_my"] = util.IntAll(one["i_entsite"]) * 35 / 100
-            one["i_hy"] = util.IntAll(one["i_entsite"]) * 15 / 100
-            one["i_zb"] = util.IntAll(one["i_entsite"]) - util.IntAll(one["i_my"]) - util.IntAll(one["i_hy"])
-            redis.Put("other", "sw_index", one, 60*60*2)
-        } else {
-            m.ServeJson("n")
-        }
-    }
-    m.ServeJson(one)
+	defer util.Catch()
+	redis_obj := redis.Get("other", "sw_index")
+	var one map[string]interface{}
+	if redis_obj != nil {
+		one = redis_obj.(map[string]interface{})
+		log.Println("newpage from the cache...")
+	} else {
+		rs, err := mongodb.Find("swordfish_index", nil, `{"_id":-1}`, nil, false, 0, 1)
+		if err {
+			one = (*rs)[0]
+			one["i_site"] = util.IntAll(one["i_entsite"]) + util.IntAll(one["i_govsite"])
+			avg := util.IntAll(one["i_bidmonth"])/21 + util.IntAll(one["i_bidmonth"])%21
+			one["i_avg"] = avg
+			one["i_my"] = util.IntAll(one["i_entsite"]) * 35 / 100
+			one["i_hy"] = util.IntAll(one["i_entsite"]) * 15 / 100
+			one["i_zb"] = util.IntAll(one["i_entsite"]) - util.IntAll(one["i_my"]) - util.IntAll(one["i_hy"])
+			redis.Put("other", "sw_index", one, 60*60*2)
+		} else {
+			m.ServeJson("n")
+		}
+	}
+	m.ServeJson(one)
 }
 
 // 手动删除30天无更新数据
 func (m *Front) DelOL() error {
-    defer util.Catch()
-    var ids []primitive.ObjectID
-    var flag = "F"
-    var arrid = strings.Split(m.GetString("arrid"), ",")
-    log.Println("---->", arrid)
+	defer util.Catch()
+	var ids []primitive.ObjectID
+	var flag = "F"
+	var arrid = strings.Split(m.GetString("arrid"), ",")
+	log.Println("---->", arrid)
 
-    userId, ok := m.GetSession("userId").(string)
-    log.Println("sss", ids)
-    if !ok || userId == "" || len(ids) < 1 {
-        m.ServeJson(map[string]interface{}{
-            "flag": flag,
-        })
-        return nil
-    }
-    arrStr := []string{}
-    for _, v := range arrid {
-        arrStr = append(arrStr, fmt.Sprintf(`"%s"`, v))
-    }
-    idStr := fmt.Sprintf(`SELECT * FROM follow_project_monitor WHERE s_userid ="%s" and id in (%s)`, userId, strings.Join(arrStr, ","))
+	userId, ok := m.GetSession("userId").(string)
+	log.Println("sss", ids)
+	if !ok || userId == "" || len(ids) < 1 {
+		m.ServeJson(map[string]interface{}{
+			"flag": flag,
+		})
+		return nil
+	}
+	arrStr := []string{}
+	for _, v := range arrid {
+		arrStr = append(arrStr, fmt.Sprintf(`"%s"`, v))
+	}
+	idStr := fmt.Sprintf(`SELECT * FROM follow_project_monitor WHERE s_userid ="%s" and id in (%s)`, userId, strings.Join(arrStr, ","))
 
-    if datas := public.BaseMysql.SelectBySql(idStr); datas != nil {
-        for _, v := range *datas {
-            relation := []interface{}{v["s_id"]}
-            go delRelRedis(v["s_userid"], relation)
-            v["s_followid"] = BsonIdToSId(v["id"])
-            delete(v, "id")
-            v["i_status"] = 2
-            mongodb.Save("follow_project_monitor_back", v)
-        }
-    }
-    delIdStr := fmt.Sprintf(`delete FROM follow_project_monitor WHERE s_userid ="%s" and id in (%s)`, userId, strings.Join(arrStr, ","))
-    public.BaseMysql.SelectBySql(delIdStr)
-    flag = "T"
-    m.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return nil
+	if datas := public.BaseMysql.SelectBySql(idStr); datas != nil {
+		for _, v := range *datas {
+			relation := []interface{}{v["s_id"]}
+			go delRelRedis(v["s_userid"], relation)
+			v["s_followid"] = BsonIdToSId(v["id"])
+			delete(v, "id")
+			v["i_status"] = 2
+			mongodb.Save("follow_project_monitor_back", v)
+		}
+	}
+	delIdStr := fmt.Sprintf(`delete FROM follow_project_monitor WHERE s_userid ="%s" and id in (%s)`, userId, strings.Join(arrStr, ","))
+	public.BaseMysql.SelectBySql(delIdStr)
+	flag = "T"
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }

+ 2 - 1
src/jfw/modules/app/src/config.yaml

@@ -2,4 +2,5 @@ etcd:
   hosts:
   - 127.0.0.1:2379
 userCenterKey: "usercenter.rpc" #用户中台rpc
-powerCheckCenterKey: "powercheck.rpc" #权益校验中台
+powerCheckCenterKey: "powercheck.rpc" #权益校验中台
+entManageApplication: "entmanageapplication.rpc" #企业管理中台

+ 1 - 1
src/jfw/modules/app/src/go.mod

@@ -4,7 +4,7 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230209030331-362833655274
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0

+ 2 - 2
src/jfw/modules/app/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20221229065928-e4ba75127ac9/go.mod h1:efAeRPDpJ13JuNODuqtfLlKQSQgCbnUcwGPzhFU5krY=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 4 - 1
src/jfw/modules/app/src/jfw/config/config.go

@@ -39,5 +39,8 @@ func init() {
 		GmailAuth = append(GmailAuth, mailConf)
 	}
 	var ctx = gctx.New()
-	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String())
+	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
+		RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
+		RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
+		RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String())
 }

+ 2 - 1
src/jfw/modules/bigmember/src/config.json

@@ -177,5 +177,6 @@
   "claim": {
     "details": "https://databi-web.jydev.jianyu360.com/nzj/app/nzj.app/nzj_claim_detail.spg",
     "listPage": "https://databi-web.jydev.jianyu360.com/nzj/app/nzj.app/nzj_claim.spg"
-  }
+  },
+  "contextOldVipLimit": 1664553600
 }

+ 1 - 0
src/jfw/modules/bigmember/src/config/config.go

@@ -65,6 +65,7 @@ type config struct {
 		Details  string `json:"details"`
 		ListPage string `json:"listPage"`
 	} `json:"claim"`
+	ContextOldVipLimit int64 `json:'contextOldVipLimit'` //超级订阅部分用户:--- 超前项目权限
 }
 
 type CustomerInfo struct {

+ 1 - 1
src/jfw/modules/bigmember/src/go.mod

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4
 	github.com/gogf/gf/v2 v2.0.6
 	go.mongodb.org/mongo-driver v1.11.1

+ 2 - 2
src/jfw/modules/bigmember/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 10 - 5
src/jfw/modules/bigmember/src/service/push/push.go

@@ -1,16 +1,17 @@
 package push
 
 import (
-	. "app.yhyue.com/moapp/jybase/api"
-	util "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	. "jy/src/jfw/modules/bigmember/src/db"
 	"log"
 	"time"
+
+	. "app.yhyue.com/moapp/jybase/api"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 )
 
 type Action struct {
@@ -42,6 +43,11 @@ func (a *Action) Items() {
 	subScribeInfo := jy.GetSubScribeInfo(a.Session(), Mgo, "m", "10000")
 	data := M{}
 	data["super_subscribe"] = true //超级订阅
+	if bigMsg.VipStatus > 0 {
+		data["super_subscribe"] = true //超级订阅
+	} else {
+		data["free_subscribe"] = true //免费订阅
+	}
 	if bigMsg.Status > 0 {
 		data["member_subscribe"] = OpenStatus(*subScribeInfo, "member_subscribe", bigMsg) //大会员订阅
 		delete(data, "free_subscribe")
@@ -50,7 +56,6 @@ func (a *Action) Items() {
 		data["follow_ent"] = true     //企业关注
 		data["follow_project"] = true //项目关注
 	}
-
 	data["entniche"] = bigMsg.IsEntService
 	a.ServeJson(Result{
 		Data: data,

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

@@ -40,7 +40,7 @@ type Subscribe struct {
 func (s *Subscribe) FreeUserSubscribe() {
 	//isVip, isMember 付费用户 isEntNiche, isEntNicheNew 商机管理用户 iPpStatus 非省份订阅包 promptBool 是否今日已提醒 areaConfig 区域配置
 	var isVip, isMember, isEntNiche, isEntNicheNew, iPpStatus, searchPrompt, promptBool, isAreaConfig bool
-	userId := s.GetSession("userId").(string)
+	userId := qutil.ObjToString(s.GetSession("userId"))
 	if userId == "" {
 		fmt.Println("用户未登录,搜索词不进行校验")
 		s.ServeJson(Result{Data: M{"prompt": false, "areaSet": false, "freeArea": false}})

+ 152 - 30
src/jfw/modules/bigmember/src/service/use/use.go

@@ -16,6 +16,7 @@ import (
 	qu "app.yhyue.com/moapp/jybase/common"
 	elastic "app.yhyue.com/moapp/jybase/esv1"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 
 	elastic1 "app.yhyue.com/moapp/esv1/gopkg.in/olivere/elastic.v1"
@@ -41,11 +42,27 @@ func (u *Use) SubPageMoveTip() {
 	flag := false
 	if userId := qu.ObjToString(u.GetSession("userId")); userId != "" {
 		if u.GetString("doType") == "know" { //我知道了 更新
-			config.Compatible.Update(userId, map[string]interface{}{
-				"$set": map[string]interface{}{
-					"o_member_jy.i_moveTip": 1,
-				},
-			})
+			positionType := qu.IntAll(u.GetSession("positionType"))
+			if positionType == 0 {
+				flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+					"$set": map[string]interface{}{
+						"o_member_jy.i_moveTip": 1,
+					},
+				})
+			} else {
+				entUserId := qu.IntAll(u.GetSession("entUserId"))
+				entId := qu.IntAll(u.GetSession("entId"))
+				query := map[string]interface{}{
+					"i_userid": entUserId,
+					"i_entid":  entId,
+					"i_type":   1,
+				}
+				flag = db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+					"$set": map[string]interface{}{
+						"o_entniche.i_moveTip": 1,
+					},
+				}, true, false)
+			}
 		} else { //查询是否提示弹框
 			bigMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 			//后期需要更改
@@ -105,6 +122,11 @@ func (u *Use) Add() {
 					items[0]["s_item"] = "未分类"
 				}
 				set["business_scope"] = items //业务范围
+				/* if r, ok := db.Mgo.FindById("user", userid, `{"o_member_jy":1}`); r != nil && len(*r) > 0 && ok {
+				        rdata := qu.ObjToMap((*r)["o_member_jy"])
+				        a_items_old, _ := (*rdata)["a_items"].([]interface{}) //获取已经设置的关键词
+				        items = MergeMemberKw(qu.ObjArrToMapArr(a_items_old), items)
+				}*/
 				rdata := jy.GetSubScribeInfo(u.Session(), db.Mgo, "m", "10000")
 				if rdata != nil && len(*rdata) > 0 {
 					member_jy["a_items"] = items
@@ -156,17 +178,32 @@ func (u *Use) Add() {
 			update1 := db.Mgo.Update("member", map[string]interface{}{"userid": userid}, map[string]interface{}{
 				"$set": set,
 			}, true, false)
+			positionType := qu.Int64All(u.GetSession("positionType"))
 			update2 := false
-			config.Compatible.Update(userid, map[string]interface{}{
-				"$set": map[string]interface{}{
-					"o_member_jy": member_jy,
-				},
-			})
+			if positionType == 0 {
+				update2 = db.Mgo.Update("user", map[string]interface{}{"_id": mongodb.StringTOBsonId(userid)}, map[string]interface{}{
+					"$set": map[string]interface{}{
+						"o_member_jy": member_jy,
+					},
+				}, true, false)
+			} else {
+				entUserId := qu.IntAll(u.GetSession("entUserId"))
+				entId := qu.IntAll(u.GetSession("entId"))
+				query := map[string]interface{}{
+					"i_userid": entUserId,
+					"i_entid":  entId,
+					"i_type":   1,
+				}
+				update2 = db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+					"$set": map[string]interface{}{
+						"o_entniche": member_jy,
+					},
+				}, true, false)
+			}
 			// log.Println("use/add:", update1, update2)
 			if update1 && update2 {
 				entity.FirstInitFollowProject(userid)
-				positionId := qu.InterfaceToStr(u.GetSession("positionId"))
-				jy.ClearBigVipUserPower(positionId)
+				jy.ClearBigVipUserPower(userid)
 				return Result{Data: M{"status": 1}}
 			}
 		}
@@ -179,6 +216,7 @@ func (u *Use) Add() {
 func (u *Use) Info() {
 	r := func() Result {
 		userid := qu.ObjToString(u.GetSession("userId"))
+		positionType := qu.IntAll(u.GetSession("positionType"))
 		if userid == "" {
 			return Result{Data: M{"status": -1}, Error_msg: "未登录"}
 		}
@@ -194,12 +232,21 @@ func (u *Use) Info() {
 		regtime := int64(0)
 		i_member_starttime := int64(0)
 		i_member_endtime := int64(0)
-		data := config.Compatible.Select(mainid, `{"i_member_starttime":1,"i_member_endtime":1,"i_member_status":1,"o_member_jy":1,"l_registedate":1}`)
-		i_member_status = qu.Int64All((*data)["i_member_status"])
-		o_member_jy = qu.ObjToMap((*data)["o_member_jy"])
-		regtime, _ = (*data)["l_registedate"].(int64)
-		i_member_starttime = qu.Int64All((*data)["i_member_starttime"])
-		i_member_endtime = qu.Int64All((*data)["i_member_endtime"])
+		if positionType == 0 {
+			data, _ := db.Mgo.FindById("user", mainid, `{"i_member_starttime":1,"i_member_endtime":1,"i_member_status":1,"o_member_jy":1,"l_registedate":1}`)
+			i_member_status = qu.Int64All((*data)["i_member_status"])
+			o_member_jy = qu.ObjToMap((*data)["o_member_jy"])
+			regtime, _ = (*data)["l_registedate"].(int64)
+			i_member_starttime = qu.Int64All((*data)["i_member_starttime"])
+			i_member_endtime = qu.Int64All((*data)["i_member_endtime"])
+		} else {
+			bigVipBaseMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
+			i_member_status = bigVipBaseMsg.Data.Member.Status
+			o_member_jy = jy.GetSubScribeInfo(u.Session(), db.Mgo, "m", "10000")
+			regtime = bigVipBaseMsg.Registedate
+			i_member_starttime = bigVipBaseMsg.Data.Member.StartTime
+			i_member_endtime = bigVipBaseMsg.Data.Member.EndTime
+		}
 		if i_member_status != 0 {
 			//是否展示附加词合并
 			appendK_bl := false
@@ -484,16 +531,21 @@ func (u *Use) Equity() {
 				"customers": config.Config.Customers,
 			}, Error_msg: "未登录"}
 		}
-		person := config.Compatible.Select(userid, `{"s_nickname":1,"s_headimageurl":1,"s_phone":1,"i_member_sub_status":1,"i_bidfileCount":1}`)
+		person, ok := db.Mgo.FindOneByField("user", map[string]interface{}{
+			"_id": mongodb.StringTOBsonId(userid),
+		}, `{"s_nickname":1,"s_headimageurl":1,"s_phone":1,"i_member_sub_status":1,"i_bidfileCount":1}`)
 		data := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		isSubCount := false
-		if person != nil && len(*person) > 0 {
+		if ok && person != nil && len(*person) > 0 {
 			//有父级id 且 子账号是激活状态
 			//if (*person)["s_member_mainid"] != nil && (*person)["i_member_sub_status"] != nil && qu.IntAllDef((*person)["i_member_sub_status"], 0) == 1 {
 			if data.Data.Member.Pid != "" {
 				userid = data.Data.Member.Pid //如果是子账号 则根据主账号id查询
 				isSubCount = true
-				o_member_jy := config.Compatible.Select(userid, `{"o_member_jy":1}`)
+				o_member_jy := &map[string]interface{}{}
+				o_member_jy, _ = db.Mgo.FindOneByField("user", map[string]interface{}{
+					"_id": mongodb.StringTOBsonId(userid),
+				}, `{"o_member_jy":1}`)
 				if o_member_jy != nil && len(*o_member_jy) > 0 {
 					(*person)["o_member_jy"] = o_member_jy
 				}
@@ -579,11 +631,25 @@ func (u *Use) Update() {
 				return Result{Data: M{"status": -1}, Error_msg: "企业名称不能为空"}
 			}
 			if industry := set_map["industry"]; industry != nil {
-				config.Compatible.Update(userid, map[string]interface{}{
-					"$set": map[string]interface{}{
-						"o_member_jy.o_industry": qu.ObjToMap(industry),
-					},
-				})
+				positionType := qu.Int64All(u.GetSession("positionType"))
+				if positionType == 0 {
+					ok2 = db.Mgo.Update("user", map[string]interface{}{"_id": mongodb.StringTOBsonId(userid)}, map[string]interface{}{
+						"$set": map[string]interface{}{
+							"o_member_jy.o_industry": qu.ObjToMap(industry),
+						},
+					}, true, false)
+				} else {
+					query := map[string]interface{}{
+						"i_userid": qu.Int64All(u.GetSession("entUserId")),
+						"i_entid":  qu.Int64All(u.GetSession("entId")),
+						"i_type":   1,
+					}
+					ok2 = db.Mgo.Update("entniche_rule", query, map[string]interface{}{"$set": map[string]interface{}{
+						"$set": map[string]interface{}{
+							"o_entniche.o_industry": qu.ObjToMap(industry),
+						}}}, true, false)
+
+				}
 			}
 			if ok1 && ok2 {
 				return Result{Data: M{"status": 1}}
@@ -633,8 +699,9 @@ type UserInfo struct {
 //是否使用过首次使用
 func (u *Use) IsAdd() {
 	r := func() Result {
-		//uRefer := u.Refer()
+		uRefer := u.Refer()
 		var userInfo = &UserInfo{}
+		userid := qu.ObjToString(u.GetSession("userId"))
 		bigPower := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		userInfo = &UserInfo{
 			BigMemberStatus: bigPower.Status,
@@ -656,12 +723,66 @@ func (u *Use) IsAdd() {
 			FreeBuyerPort:   bigPower.FreeBuyerPort,
 			FreeFile:        bigPower.FreeFile,
 			FreeHasKey:      bigPower.FreeHasKey,
+			VipBefore202209: bigPower.VipStatus > 0 && bigPower.VipStartDate < config.Config.ContextOldVipLimit, //超级订阅 超前项目权限
+		}
+		userInfo.EntName = bigPower.Data.Ent.Name
+		userInfo.EntRoleId = int(bigPower.Data.Ent.EntRoleId)
+		//是否是商机管理有效用户:1、管理员和员工已分配功能
+		userInfo.EntNiche = bigPower.EntnicheStatus == 1 && bigPower.Data.Entniche.IsEntPower > 0
+		userInfo.EntIsNew = bigPower.EntIsNew && userInfo.EntNiche
+		//有商机管理服务的用户 就不是商机管理用户
+		if userInfo.IsEntService = bigPower.Data.Ent.PowerSource > 0 && bigPower.Data.Entniche.IsEntPower > 0; userInfo.IsEntService {
+			userInfo.EntIsNew = false
+			userInfo.EntNiche = false
 		}
 		power := []int{}
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
 		}
 		userInfo.Powers = power
+		//是否是免费用户
+		userInfo.IsFree = bigPower.VipStatus <= 0 && bigPower.Status <= 0 && !userInfo.EntNiche
+		//vip
+		if userInfo.VipStatus > 0 {
+			vipBool := true
+			if len(config.Config.IsAddUrls.Vip) > 0 && uRefer != "" {
+				vipBool = false
+				for _, v := range config.Config.IsAddUrls.Vip {
+					if strings.Contains(uRefer, v) {
+						vipBool = true
+						break
+					}
+				}
+			}
+			if vipBool {
+				//没有大会员附件下载权限
+				var notBigFileBool = userInfo.BigMemberStatus <= 0 || !strings.Contains(intStringsJoin(userInfo.Powers), "3")
+				//超级订阅非大会员用户附件下载本月可用次数
+				uk := qu.If(notBigFileBool && userInfo.VipStatus > 0 && userInfo.Viper, "v", "f").(string)
+				//附件下载包的剩余次数
+				filePackKey := fmt.Sprintf(jy.FilePackNumKey, userid, fmt.Sprint(time.Now().Month()))
+				filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
+				userInfo.FileNum = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month()))) + filePackNum
+			}
+		}
+		//免费用户  // 商机管理用户 可以用免费用户的企业画像权限 留资有一次权限 所以也要验证商机管理用户
+		if userInfo.IsFree || userInfo.EntNiche {
+			freeBool := true
+			if len(config.Config.IsAddUrls.Free) > 0 && uRefer != "" {
+				freeBool = false
+				for _, v := range config.Config.IsAddUrls.Free {
+					if strings.Contains(uRefer, v) {
+						freeBool = true
+						break
+					}
+				}
+			}
+			if freeBool {
+				//免费用户可查看企业画像次数//免费用户可查看采购单位画像次数//免费用户可以进行附件下载次数
+				userInfo.FreeEntPort, userInfo.FreeBuyerPort, userInfo.FreeFile = jy.FreeExperience(userid)
+			}
+		}
+		userInfo.Powers = power
 		userInfo.CustomerService = config.Config.Customers
 		return Result{Data: userInfo}
 	}()
@@ -743,8 +864,8 @@ func (u *Use) Aiused_history() {
 
 //获取当前登录用户的手机号
 func Phone(userId string) (string, string) {
-	u := config.Compatible.Select(userId, `{"s_phone":1,"s_m_phone":1}`)
-	if u != nil {
+	u, ok := db.Mgo.FindById("user", userId, `{"s_phone":1,"s_m_phone":1}`)
+	if ok && u != nil {
 		if s_phone, _ := (*u)["s_phone"].(string); s_phone != "" {
 			return s_phone, "s_phone"
 		} else if s_m_phone, _ := (*u)["s_m_phone"].(string); s_m_phone != "" {
@@ -795,8 +916,9 @@ func Merge(echo_map map[string]interface{}, userid string, session *httpsession.
 		m[v] = []string{}
 	}
 	//获取用户订阅信息
+	//data, _ := db.Mgo.FindById("user", userid, `{"o_jy":1,"o_vipjy":1,"i_vip_status":1}`)
 	o_vipjy := jy.GetSubScribeInfo(session, db.Mgo, "v", "10000")
-	o_jy := jy.GetSubScribeInfo(session, db.Mgo, "f", "10000")
+	o_jy := jy.GetSubScribeInfo(session, db.Mgo, "v", "10000")
 	if (*o_vipjy) != nil {
 		//o_vipjy := *qu.ObjToMap((*data)["o_vipjy"])
 		//区域

+ 601 - 0
src/jfw/modules/common/src/qfw/util/bidsearch/search.go

@@ -0,0 +1,601 @@
+package bidsearch
+
+import (
+	"fmt"
+	"jfw/config"
+	"jfw/public"
+	"log"
+	"net/http"
+	"qfw/util"
+	"qfw/util/elastic"
+	"qfw/util/jy"
+	"strconv"
+	"strings"
+	"time"
+)
+
+//pc、微信、app 招标信息搜索
+
+const (
+	INDEX          = "bidding"
+	TYPE           = "bidding"
+	bidSearch_sort = `{"dataweight":-1,"publishtime":-1}`
+
+	//招标搜索分页--每页显示数量
+	SearchPageSize_APP = 50
+	SearchPageSize_WX  = 50
+	SearchPageSize_PC  = 50
+	//招标搜索分页--最大页数
+	SearchMaxPageNum_APP   = 10
+	SearchMaxPageNum_WX    = 10
+	SearchMaxPageNum_PC    = 10  //免费用户500条记录
+	SearchMaxPageNum_PAYED = 100 //付费用户5000条记录
+
+	SearchMaxPageCount_APP     = 500
+	SearchMaxPageCount_WX      = 500
+	SearchMaxPageCount_PC      = 500  //免费用户500条记录
+	SearchMaxPageCount_PAYED   = 5000 //付费用户5000条记录
+	SearchMaxPageCount_NOLOGIN = 5000 //未登录用户5000条记录
+
+	bidSearch_field_1 = `"_id","title","dataweight","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","filetext","spidercode","site"`
+	bidSearch_field   = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
+)
+
+// GetWxsearchlistData 移动端招标信息搜索
+func GetWxsearchlistData(keywords, scope, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists string, pageNum int, selectTypeArr []string, field, notkey string, searchTypeSwitch bool, pageSize int) (list *[]map[string]interface{}, b_word, a_word, s_word string) {
+	var hightlightContent bool = false //是否高亮正文
+	for _, v := range selectTypeArr {
+		if v == "detail" {
+			hightlightContent = true
+			break
+		}
+	}
+	b_word, a_word, s_word = jy.InterceptSearchKW(keywords, util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), len(industry) == 0)
+	if len(b_word) == 0 {
+		return list, b_word, a_word, s_word
+	}
+	var findfields string
+	if selectTypeArr == nil || len(selectTypeArr) == 0 {
+		findfields = `"title"`
+	} else {
+		findfields = fmt.Sprintf(`"%s"`, strings.Join(selectTypeArr, "\",\""))
+	}
+	qstr := GetSearchQuery(s_word, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, GetBidSearchQuery(scope, city, publishtime, subtype, winner, buyerclass), notkey, searchTypeSwitch, "")
+	if hightlightContent { //全文搜索
+		list = elastic.GetAllByNgram(INDEX, TYPE, qstr, `"detail"`, bidSearch_sort, field, (pageNum-1)*pageSize, pageSize, 100, true)
+	} else { //标题搜索
+		list = elastic.GetAllByNgram(INDEX, TYPE, qstr, ``, bidSearch_sort, field, (pageNum-1)*pageSize, pageSize, 100, false)
+	}
+	if list != nil {
+		public.BidListConvert(industry, list)
+		for _, v := range *list {
+			v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
+		}
+	}
+	return list, b_word, a_word, s_word
+}
+
+// GetPcBidSearchData pc端招标信息搜索
+func GetPcBidSearchData(searchvalue, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists string, start int, isGetCount bool, selectTypeArr []string, field, notkey string, ispayed, searchTypeSwitch bool, bidField string, pageSize int, userId string) (count, totalPage int64, list *[]map[string]interface{}) {
+	var findfields string
+	var hightlightContent bool = false //是否高亮正文
+	for _, v := range selectTypeArr {
+		if v == "detail" {
+			hightlightContent = true
+			break
+		}
+	}
+	if selectTypeArr == nil || len(selectTypeArr) == 0 {
+		findfields = `"title"`
+	} else {
+		findfields = fmt.Sprintf(`"%s"`, strings.Join(selectTypeArr, "\",\""))
+	}
+	qstr := GetSearchQuery(searchvalue, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, GetBidSearchQuery(area, city, publishtime, subtype, winner, buyerclass), notkey, searchTypeSwitch, bidField)
+	if isGetCount && qstr != "" && start == 0 {
+		count = elastic.Count(INDEX, TYPE, qstr)
+	}
+	if !isGetCount || count > 0 || start > 0 {
+		var repl *[]map[string]interface{}
+		if hightlightContent {
+			repl = elastic.GetAllByNgram(INDEX, TYPE, qstr, `"detail"`, bidSearch_sort, field, start, pageSize, 115, true)
+		} else {
+			repl = elastic.GetAllByNgram(INDEX, TYPE, qstr, ``, bidSearch_sort, field, start, pageSize, 0, false)
+		}
+		if repl != nil && *repl != nil && len(*repl) > 0 {
+			public.BidListConvert(industry, repl)
+			list = repl
+		}
+	}
+	limitCount := util.If(ispayed, int64(SearchMaxPageCount_PAYED), int64(SearchMaxPageCount_PC)).(int64)
+	if userId == "" {
+		limitCount = SearchMaxPageCount_NOLOGIN
+	}
+	if count > limitCount {
+		count = limitCount
+	}
+	if count > 0 {
+		totalPage = (count + int64(pageSize) - 1) / int64(pageSize)
+	}
+	return
+}
+
+var topType = map[string]string{
+	"招标预告":   "预告",
+	"招标公告":   "招标",
+	"招标结果":   "结果",
+	"招标信用信息": "其它",
+}
+
+func GetBidSearchQuery(area, city, publishtime, subtype, winner, buyerclass string) string {
+	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	query := ``
+	if area != "" {
+		query += `{"terms":{"area":[`
+		for k, v := range strings.Split(area, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	//
+	if city != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"city":[`
+		for k, v := range strings.Split(city, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	if query != "" {
+		query = fmt.Sprintf(query_bool_should, query)
+	}
+	if publishtime != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		starttime, endtime := "", ""
+		now := time.Now()
+		if publishtime == "lately-7" { //最近7天
+			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishtime == "lately-30" { //最近30天
+			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishtime == "thisyear" { //最近一年
+			starttime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endtime = fmt.Sprint(now.Unix())
+		} else if publishtime == "threeyear" { //最近三年
+			starttime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endtime = fmt.Sprint(now.Unix())
+		} else if publishtime == "fiveyear" { //最近五年
+			starttime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endtime = fmt.Sprint(now.Unix())
+		} else {
+			starttime = strings.Split(publishtime, "_")[0]
+			endtime = strings.Split(publishtime, "_")[1]
+			etTime := time.Now()
+			if endtime != "" {
+				et, _ := strconv.ParseInt(endtime, 0, 64)
+				etTime = time.Unix(et, 0)
+			}
+			endtime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
+		}
+		query += `{"range":{"publishtime":{`
+		if starttime != "" {
+			query += `"gte":` + starttime
+		}
+		if starttime != "" && endtime != "" {
+			query += `,`
+		}
+		if endtime != "" {
+			query += `"lt":` + endtime
+		}
+		query += `}}}`
+	}
+	if subtype != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		var topTypes []string
+		var subTypes []string
+
+		for _, v := range strings.Split(subtype, ",") {
+			if v1, ok := topType[v]; ok {
+				topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
+			} else {
+				subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))
+			}
+		}
+		log.Println("信息类型搜索:", topTypes, subTypes)
+		if len(subTypes) > 0 && len(topTypes) > 0 {
+			query += fmt.Sprintf(`{"bool": {"should": [{"terms": {"subtype": [%s]}},{"terms": {"toptype": [%s]}}]}}`, strings.Join(subTypes, ","), strings.Join(topTypes, ","))
+		} else if len(subTypes) > 0 {
+			query += fmt.Sprintf(`{"terms":{"subtype":[%s]}}`, strings.Join(subTypes, ","))
+		} else if len(topTypes) > 0 {
+			query += fmt.Sprintf(`{"terms":{"toptype":[%s]}}`, strings.Join(topTypes, ","))
+		}
+	}
+	if winner != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"s_winner":[`
+		for k, v := range strings.Split(winner, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	if buyerclass != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"buyerclass":[`
+		for k, v := range strings.Split(buyerclass, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	return query
+}
+
+// 包含正文或 附件 不包含标题
+func DetailFileORTitle(findfields string) bool {
+	return (strings.Contains(findfields, `"detail"`) || strings.Contains(findfields, `"filetext"`)) && !strings.Contains(findfields, `"title"`)
+}
+
+// 包含标题和正文
+func DetailTitle(findfields string) bool {
+	return strings.Contains(findfields, `"detail"`) && strings.Contains(findfields, `"title"`)
+}
+func GetSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, mustquery, notkey string, searchTypeSwitch bool, bidField string) (qstr string) {
+	multi_match := `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
+	query := `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
+	//query := `{"query": {"function_score": {"query": {"bool": {"must": [%s],"must_not": [%s]}},"field_value_factor": {"field": "dataweight","modifier": "ln1p","missing": 0}}}}`
+	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	query_bools_must := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	query_bool_must := `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
+	query_missing := `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	query_bool_must_term := `{"bool": {"must": [{ "term": {"isValidFile": %d }}]}}`
+	query_bool_must_term_domain := `{"bool": {"must": [{ "term": {"bid_field": "%s" }}]}}` // 领域化数据类型
+	gte := `"gte": %s`
+	lte := `"lte": %s`
+	musts, must_not := []string{}, []string{}
+	if mustquery != "" {
+		musts = append(musts, mustquery)
+	}
+	//搜索范围是否只有附件
+	//搜索范围只选择附件,是否有附件条件无效;
+	var isFileSearch bool = findfields == `"filetext"`
+	if keyword != "" {
+		keyword_multi_match := fmt.Sprintf(multi_match, "%s", findfields)
+		shoulds := []string{}
+		for _, v := range strings.Split(keyword, "+") {
+			if elastic.ReplaceYH(v) == "" {
+				continue
+			}
+			if len([]rune(elastic.ReplaceYH(v))) == 1 {
+				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+				if DetailFileORTitle(findfields) {
+					keyword_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`,"title"`)
+				}
+			} else {
+				//标题+全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+				if searchTypeSwitch && DetailTitle(findfields) {
+					if strings.Contains(findfields, `"title",`) {
+						findfields = strings.Replace(findfields, `"title",`, ``, -1)
+					} else if strings.Contains(findfields, `,"title"`) {
+						findfields = strings.Replace(findfields, `,"title"`, ``, -1)
+					}
+					keyword_multi_match = fmt.Sprintf(multi_match, "%s", findfields)
+				}
+			}
+			shoulds = append(shoulds, fmt.Sprintf(keyword_multi_match, elastic.ReplaceYH(v)))
+		}
+		musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(shoulds, ",")))
+	}
+	if industry != "" {
+		industrys := strings.Split(industry, ",")
+		musts = append(musts, fmt.Sprintf(query_bool_must, `"`+strings.Join(industrys, `","`)+`"`))
+	}
+	if minprice != "" || maxprice != "" {
+		sq := ``
+		if minprice != "" {
+			min, _ := strconv.ParseFloat(minprice, 64)
+			minprice = fmt.Sprintf("%.0f", min*10000)
+			if minprice == "0" {
+				minprice = ""
+			}
+		}
+		if maxprice != "" {
+			max, _ := strconv.ParseFloat(maxprice, 64)
+			maxprice = fmt.Sprintf("%.0f", max*10000)
+			if maxprice == "0" {
+				maxprice = ""
+			}
+		}
+		if minprice != "" {
+			sq += fmt.Sprintf(gte, minprice)
+		}
+		if minprice != "" && maxprice != "" {
+			sq += `,`
+		}
+		if maxprice != "" {
+			sq += fmt.Sprintf(lte, maxprice)
+		}
+		if minprice != "" || maxprice != "" {
+			query_price := fmt.Sprintf(query_bool_should, fmt.Sprintf(query_bools_must, sq, sq))
+			musts = append(musts, query_price)
+		}
+	}
+	if hasBuyerTel != "" {
+		if hasBuyerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "buyertel"))
+		}
+	}
+	if hasWinnerTel != "" {
+		if hasWinnerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "winnertel"))
+		}
+	}
+	if notkey = strings.TrimSpace(notkey); notkey != "" {
+		notkey_multi_match := fmt.Sprintf(multi_match, "%s", findfields)
+		notkey_must_not := []string{}
+		for _, v := range strings.Split(notkey, " ") {
+			v = strings.TrimSpace(v)
+			if v == "" {
+				continue
+			}
+			if len([]rune(elastic.ReplaceYH(v))) == 1 {
+				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+				if DetailFileORTitle(findfields) {
+					notkey_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`,"title"`)
+				}
+			}
+			notkey_must_not = append(notkey_must_not, fmt.Sprintf(notkey_multi_match, elastic.ReplaceYH(v)))
+		}
+		must_not = append(must_not, fmt.Sprintf(query_bool_should, strings.Join(notkey_must_not, ",")))
+	}
+	if !isFileSearch && fileExists != "" {
+		if fileExists == "1" { //有附件
+			must_not = append(must_not, fmt.Sprintf(query_missing, "isValidFile"))
+			musts = append(musts, fmt.Sprintf(query_bool_must_term, 1))
+		} else if fileExists == "-1" { //无附件
+			musts = append(musts, fmt.Sprintf(query_missing, "isValidFile"))
+		}
+	}
+	// 如果是领域化数据则需要加标签
+	if bidField != "" {
+		musts = append(musts, fmt.Sprintf(query_bool_must_term_domain, bidField))
+	}
+	qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","))
+	log.Println(qstr)
+	return
+}
+
+func PublicSearch(userId, selectType, publishtime string, bidSearchOldUserLimit int64, currentPage, pageSize, entId int) (bool, string, []string, int, int) {
+	var start int
+	vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	isPayedUser := vipStatus.IsPayedUser()
+	queryItems := vipStatus.GetQueryItems(selectType, bidSearchOldUserLimit)
+
+	if publishtime == "" {
+		if isPayedUser {
+			publishtime = "fiveyear"
+		} else {
+			publishtime = "thisyear"
+		}
+	}
+
+	if isPayedUser {
+		//if currentPage > SearchMaxPageCount_PAYED {
+		//	currentPage = SearchMaxPageCount_PAYED
+		//}
+	} else {
+		//if currentPage > SearchMaxPageCount_PC {
+		//	currentPage = SearchMaxPageCount_PC
+		//}
+		//时间自定义选择默认是vip 大会员 等权限
+		if len(strings.Split(publishtime, "_")) == 2 || publishtime == "threeyear" || publishtime == "fiveyear" {
+			publishtime = ""
+		}
+	}
+	start = (currentPage - 1) * pageSize
+
+	return isPayedUser, publishtime, queryItems, currentPage, start
+}
+
+// 所有的再次分词查询 只查标题
+func IntegratedData(platform string, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, secondFlag, area, city, publishtime, subtype, buyerclass, notkey string, queryItems []string, list *[]map[string]interface{}, field string, searchTypeSwitch bool, bidField string, pageSize int) (string, string, string, string, *[]map[string]interface{}) {
+	var pcAjaxFlag string
+	var secRel *[]map[string]interface{} = list
+	if secondKWS = jy.HttpEs(s_word, "ik_smart", public.DbConf.Elasticsearch.Main.Address); secondKWS != "" {
+		findfields := `"title"`
+		qstr := GetSearchQuery(secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, GetBidSearchQuery(area, city, publishtime, subtype, "", buyerclass), notkey, searchTypeSwitch, bidField)
+		secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, field, 0, 2*pageSize, 0, false)
+		if secRel != nil && len(*secRel) > 0 {
+			public.BidListConvert(industry, secRel)
+			if platform == "app" || platform == "wx" {
+				for _, v := range *secRel {
+					v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
+				}
+			}
+		}
+		if list != nil {
+			secRel = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
+		}
+		secondFlag = "T"
+		pcAjaxFlag = "T"
+		if secondKWS != "" {
+			s_word += "+" + secondKWS
+		}
+	}
+	return s_word, pcAjaxFlag, secondFlag, secondKWS, secRel
+}
+
+func classify(stp, area, industry string, configData map[string]interface{}) (string, string, string) {
+	var areas, _ = configData["area"].(map[string]interface{})
+	var stypes, _ = configData["stype"].(map[string]interface{})
+	var industrys, _ = configData["industry"].(map[string]interface{})
+	var tpadd = ""
+	var areaadd = ""
+	var induadd = ""
+	if area != "" && area != "A" {
+		for k, v := range areas {
+			if area == v.(map[string]interface{})["NAME"] {
+				areaadd = k
+			}
+		}
+	}
+	//
+	if stp != "" {
+		for k, v := range stypes {
+			if stp == v.(map[string]interface{})["NAME"] {
+				tpadd = k
+			}
+		}
+	}
+	//
+	if industry != "" {
+		for k, v := range industrys {
+			if strings.Contains(util.ObjToString(v.(map[string]interface{})["NAME"]), industry) {
+				induadd = k
+			}
+		}
+	}
+	return tpadd, areaadd, induadd
+}
+
+// list != nil && len(*list) == bidsearch.SearchPageSize_APP && pageNum < util.If(isPayedUser, bidsearch.SearchMaxPageNum_PAYED, bidsearch.SearchMaxPageNum_APP).(int)
+// 数据格式化处理
+func LisetData(stype, pageNum int, list *[]map[string]interface{}, secondFlag string, configData map[string]interface{}, isPayedUser bool, pageSize int, userId string) ([]map[string]interface{}, int64, bool) {
+	var (
+		secondList  []map[string]interface{}
+		totalPage   int64
+		hasNextPage bool
+	)
+	if list != nil && len(*list) > 0 {
+		if stype != 3 && stype != 4 {
+			for _, v := range *list {
+				if v["_id"] != nil {
+					v["_id"] = util.EncodeArticleId2ByCheck(v["_id"].(string))
+				}
+				stp, ok := v["subtype"].(string)
+				if ok && stp == "" {
+					stp = v["toptype"].(string)
+				}
+				area, ok := v["area"].(string)
+				indtry := util.ObjToString(v["industry"])
+				v["stypeadd"], v["areaadd"], v["indadd"] = classify(stp, area, indtry, configData)
+				//正文匹配检索关键词
+				highlight, _ := v["highlight"].(map[string][]string)
+				detail := ""
+				for _, val := range highlight["detail"] {
+					detail += public.ClearHtml.ReplaceAllString(val, "")
+				}
+				v["detail"] = detail
+				v["href"] = util.EncodeArticleId2ByCheck(util.GetRandom(20))
+				if isValidFile, _ := v["isValidFile"].(bool); isValidFile {
+					delete(v, "filetext")
+					v["fileExists"] = true
+				}
+			}
+		}
+		if secondFlag != "" {
+			if len(*list) > pageSize {
+				secondList = (*list)[pageSize:]
+				if len(secondList) > pageSize {
+					secondList = secondList[:pageSize]
+				}
+				*list = (*list)[:pageSize]
+				totalPage = 2
+			} else {
+				totalPage = 1
+			}
+		}
+	}
+
+	if list != nil && len(*list) == pageSize {
+		hasNextPage = true
+	}
+	if isPayedUser && pageNum >= SearchMaxPageCount_PAYED {
+		hasNextPage = false
+	} else if !isPayedUser && pageNum >= SearchMaxPageCount_WX {
+		hasNextPage = false
+	}
+	if userId == "" && pageNum > SearchMaxPageCount_NOLOGIN {
+		hasNextPage = false
+	}
+	return secondList, totalPage, hasNextPage
+}
+
+func SearchData(platform string, request *http.Request, currentPage int, userId, secondKWS, s_word, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists string, start int, isGetCount bool, queryItems []string, field, notkey string, isPayedUser, searchTypeSwitch bool, bidField string, pageSize int) (second, b_word, a_word, pcAjaxFlag, secondFlag string, count, totalPage int64, list *[]map[string]interface{}) {
+	//包含标题才能进行二次搜索
+	var secondSearch = strings.Contains(strings.Join(queryItems, ","), "title")
+	var searchvalue = s_word
+	number := util.If(platform == "app" || platform == "wx", 1, 0)
+	if platform == "app" || platform == "wx" {
+		list, b_word, a_word, s_word = GetWxsearchlistData(s_word, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, start, queryItems, field, notkey, searchTypeSwitch, pageSize)
+		if list != nil && len(*list) != 0 {
+			count = int64(len(*list))
+		}
+	} else {
+		count, totalPage, list = GetPcBidSearchData(s_word, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, start, isGetCount, queryItems, field, notkey, isPayedUser, searchTypeSwitch, bidField, pageSize, userId)
+	}
+	if len([]rune(s_word)) > 3 && int(count) < pageSize && start == number && secondSearch {
+		var paramList = list
+		s_word, pcAjaxFlag, secondFlag, second, list = IntegratedData(platform, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, secondFlag, area, city, publishtime, subtype, buyerclass, notkey, queryItems, paramList, field, searchTypeSwitch, bidField, pageSize)
+	}
+
+	listSize := 0
+	if list != nil {
+		listSize = len(*list)
+	}
+	public.SaveUserSearchLog(request, userId, -1, platform, "超级搜索", map[string]interface{}{
+		"search_word":        util.If(platform == "app" || platform == "wx", searchvalue, s_word),
+		"search_area":        area,
+		"search_city":        city,
+		"search_price":       []string{minprice, maxprice},
+		"search_publishtime": publishtime,
+		"search_type":        subtype,
+		"search_industry":    industry,
+		"pagenum":            currentPage,
+		"pagesize":           listSize,
+		"fileExists":         fileExists,
+		"bid_field":          util.If(bidField != "", bidField, nil),
+	})
+	return
+}
+
+func AddHistory(history, searchvalue string) []string {
+	arrs := strings.Split(history, ",")
+	//新增历史记录
+	if history == "" {
+		arrs = make([]string, 0)
+	}
+	for k, v := range arrs {
+		if v == strings.TrimSpace(searchvalue) {
+			arrs = append(arrs[:k], arrs[k+1:]...)
+			break
+		}
+	}
+	arrs = append(arrs, searchvalue)
+	if len(arrs) > 10 {
+		arrs = arrs[1:11]
+	}
+	return arrs
+}

+ 1218 - 0
src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

@@ -0,0 +1,1218 @@
+package dataexport
+
+import (
+	//"config"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"log"
+	"math"
+	mg "mongodb"
+	qutil "qfw/util"
+	"qfw/util/elastic"
+	"qfw/util/jy"
+	"regexp"
+	"sort"
+	"strconv"
+	"strings"
+	"sync"
+	"time"
+)
+
+const (
+	SearchModeAccurate        = 0 // 搜索模式:0:精准搜索;
+	SearchModeFuzzy           = 1 // 搜索模式:1:模糊搜索
+	WordsModeAnd              = 0 // 搜索关键词模式;默认0:包含所有
+	WordsModeOr               = 1 // 搜索关键词模式;1:包含任意
+	SearchGroupAll            = 0 // 搜索分组:默认0:全部;
+	SearchGroupBidding        = 1 // 搜索分组:1:招标采购公告;2:超前项目
+	SearchGroupLeadingProject = 2 // 搜索分组:1:招标采购公告;2:超前项目
+	TopTypesBidding           = "招标预告,招标公告,招标结果,招标信用信息"
+	TopTypesLeadingProject    = "拟建项目,采购意向"
+)
+
+/*筛选条件--关键词*/
+type KeyWord struct {
+	Keyword  string   `json:"keyword"`  //关键词
+	Appended []string `json:"appended"` //附加词
+	Exclude  []string `json:"exclude"`  //排除词
+}
+
+/*筛选条件*/
+type SieveCondition struct {
+	Id               string    `json:"id"`
+	PublishTime      string    `json:"publishtime"`      //发布时间
+	Area             []string  `json:"area"`             //地区-省份
+	City             []string  `json:"city"`             //地区-城市
+	Region           []string  `json:"region"`           //地区-省份+城市
+	Industry         []string  `json:"industry"`         //行业
+	Keyword          []KeyWord `json:"keywords"`         //关键词
+	Buyer            []string  `json:"buyer"`            //招标单位(采购单位)
+	Buyerclass       []string  `json:"buyerclass"`       //采购单位类型
+	HasBuyerTel      string    `json:"hasBuyertel"`      //是否有采购单位电话
+	Winner           []string  `json:"winner"`           //中标单位
+	HasWinnerTel     string    `json:"hasWinnertel"`     //是否有中标单位电话
+	ComeInTime       int64     `json:"comeintime"`       //入库时间(秒)
+	OpenId           string    `json:"openid"`           //用户openid
+	MinPrice         string    `json:"minprice"`         //金额——最少
+	MaxPrice         string    `json:"maxprice"`         //金额——最多
+	SelectType       string    `json:"selectType"`       //筛选(正文 or 标题)
+	Subtype          string    `json:"subtype"`          //信息类型
+	SelectIds        []string  `json:"selectId"`         //选择信息导出
+	PushKeyWords     []string  `json:"pushKeyWords"`     //推送历史匹配词
+	Comeinfrom       string    `json:"comeinfrom"`       //查询来源
+	FileExists       string    `json:"fileExists"`       //是否有附件
+	SearchTypeSwitch bool      `json:"searchTypeSwitch"` //是否开启 正文 标题同时搜索只搜正文的开关
+	BidField         string    `json:"bid_field"`        // 领域化数据 0101-医疗行业
+	SearchGroup      int       `json:"searchGroup"`      // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode       int       `json:"searchMode"`       // 搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode        int       `json:"wordsMode"`        // 搜索关键词模式;默认0:包含所有,1:包含任意
+}
+
+const (
+	INDEX          = "bidding"
+	TYPE           = "bidding"
+	bidSearch_sort = `{"publishtime":-1}`
+)
+
+var ClearOther = regexp.MustCompile("[\n\r\\s\u3000\u2003\u00a0]")
+var ClearHtml = regexp.MustCompile("<[^>]*>")
+var onceSearchCount = 500
+var ExportTable string = "export_search"
+var searchPool = make(chan bool, 8)
+
+var topType = map[string]string{
+	"招标预告":   "预告",
+	"招标公告":   "招标",
+	"招标结果":   "结果",
+	"招标信用信息": "其它",
+	"拟建项目":   "拟建",
+	"采购意向":   "采购意向",
+}
+
+// 包含正文或 附件 不包含标题
+func DetailFileORTitle(findfields string) bool {
+	return (strings.Contains(findfields, "detail") || strings.Contains(findfields, "filetext")) && !strings.Contains(findfields, "title")
+}
+
+// 包含正文包含标题
+func DetailANDTitle(findfields string) bool {
+	return strings.Contains(findfields, "detail") && strings.Contains(findfields, "title")
+}
+
+// 获取数据导出查询语句
+func getDataExportSql(scd *SieveCondition) string {
+	if len(scd.SelectIds) > 0 {
+		query := `{"query":{"bool":{"must":[%s]}}}`
+		doSearchSql := fmt.Sprintf(`{"terms":{"_id":[%s]}}`, `"`+strings.Join(scd.SelectIds, `","`)+`"`)
+		return fmt.Sprintf(query, doSearchSql)
+	}
+	multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
+	query := `{"query":{"bool":{"must":[%s],"must_not":[%s],"should":[%s],"minimum_should_match": %d}}}`
+	//query := `{"query": {"function_score": {"query": {"bool": {"must": [%s],"must_not": [%s],"should": [%s],"minimum_should_match": %d}},"field_value_factor": {"field": "dataweight","modifier": "ln1p","missing": 0}}}}`
+	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	query_bool_should_and := `{"bool":{"should":[%s],"minimum_should_match": 1 %s}}`
+	query_price := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	query_bool_must := `{"terms":{"%s":[%s]}}`
+	query_bool_must_and := `{"bool":{"must":[%s]%s}}`
+	query_missing := `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	query_bool_must_term := `{"bool": {"must": [{ "term": {"isValidFile": %d }}]}}`
+	query_bool_must_term_bidField := `{"bool": {"must": [{ "term": {"bid_field": "%s" }}]}}` // 领域化数据类型
+
+	gte := `"gte": %s`
+	lte := `"lte": %s`
+
+	bools := []string{}
+	musts := []string{fmt.Sprintf(`{"range":{"comeintime":{"lt":%d}}}`, scd.ComeInTime)}
+	must_not := []string{}
+	//省份
+	areaCity := []string{}
+	if len(scd.Area) > 0 {
+		areaquery := `{"terms":{"area":[`
+		for k, v := range scd.Area {
+			if k > 0 {
+				areaquery += `,`
+			}
+			areaquery += `"` + v + `"`
+		}
+		areaquery += `]}}`
+		areaCity = append(areaCity, areaquery)
+	}
+	//城市
+	if len(scd.City) > 0 {
+		areaquery := `{"terms":{"city":[`
+		for k, v := range scd.City {
+			if k > 0 {
+				areaquery += `,`
+			}
+			areaquery += `"` + v + `"`
+		}
+		areaquery += `]}}`
+		areaCity = append(areaCity, areaquery)
+	}
+	if len(areaCity) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_should, strings.Join(areaCity, ",")))
+	}
+	//检索日期
+
+	starttime := ""
+	now := time.Unix(scd.ComeInTime, 0)
+	endtime := fmt.Sprintf("%d", now.Unix())
+	if scd.PublishTime == "lately-7" { //最近7天
+		starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+	} else if scd.PublishTime == "lately-30" { //最近30天
+		starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+	} else if scd.PublishTime == "thisyear" { //去年
+		starttime = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix())
+		endtime = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix())
+	} else if strings.Contains(scd.PublishTime, "_") { //设置检索日期
+		starttime = strings.Split(scd.PublishTime, "_")[0]
+		endTime_tmp := now
+		if etime := strings.Split(scd.PublishTime, "_")[1]; etime != "" {
+			etTime := time.Unix(qutil.Int64All(etime), 0)
+			endTime_tmp = time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local)
+		}
+		//结束时间必须小于筛选时间
+		if endTime_tmp.After(now) {
+			endTime_tmp = now
+		}
+		endtime = fmt.Sprintf("%d", endTime_tmp.Unix())
+	}
+	timequery := `{"range":{"publishtime":{`
+	if starttime != "" {
+		timequery += `"gte":` + starttime
+	}
+	if starttime != "" && endtime != "" {
+		timequery += `,`
+	}
+	if endtime != "" {
+		timequery += `"lt":` + endtime
+	}
+	timequery += `}}}`
+	musts = append(musts, timequery)
+	if scd.Subtype == "" {
+		if scd.SearchGroup == SearchGroupBidding { // 搜索分组处理  招标采购公告 超前项目
+			scd.Subtype = TopTypesBidding
+		} else if scd.SearchGroup == SearchGroupLeadingProject {
+			scd.Subtype = TopTypesLeadingProject
+		}
+	}
+	if scd.Subtype != "" {
+		var subquery string
+		var topTypes []string
+		var subTypes []string
+		for _, v := range strings.Split(scd.Subtype, ",") {
+			if v1, ok := topType[v]; ok {
+				topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
+			} else {
+				subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))
+			}
+		}
+		log.Println("信息类型搜索:", topTypes, subTypes)
+		if len(subTypes) > 0 && len(topTypes) > 0 {
+			subquery = fmt.Sprintf(`{"bool": {"should": [{"terms": {"subtype": [%s]}},{"terms": {"toptype": [%s]}}]}}`, strings.Join(subTypes, ","), strings.Join(topTypes, ","))
+		} else if len(subTypes) > 0 {
+			subquery = fmt.Sprintf(`{"terms":{"subtype":[%s]}}`, strings.Join(subTypes, ","))
+		} else if len(topTypes) > 0 {
+			subquery = fmt.Sprintf(`{"terms":{"toptype":[%s]}}`, strings.Join(topTypes, ","))
+		}
+		musts = append(musts, subquery)
+	}
+	if len(scd.Industry) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "s_subscopeclass", `"`+strings.Join(scd.Industry, `","`)+`"`))
+	}
+	if len(scd.Buyer) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "buyer", `"`+strings.Join(scd.Buyer, `","`)+`"`))
+	}
+	if len(scd.Buyerclass) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "buyerclass", `"`+strings.Join(scd.Buyerclass, `","`)+`"`))
+	}
+	if len(scd.Winner) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "s_winner", `"`+strings.Join(scd.Winner, `","`)+`"`))
+	}
+	_minPrice := ""
+	_maxPrice := ""
+	if scd.MinPrice != "" || scd.MaxPrice != "" {
+		sq := ``
+		if scd.MinPrice != "" {
+			min, _ := strconv.ParseFloat(scd.MinPrice, 64)
+			_minPrice = fmt.Sprintf("%.0f", min*10000)
+			if _minPrice == "0" {
+				_minPrice = ""
+			}
+		}
+		if scd.MaxPrice != "" {
+			max, _ := strconv.ParseFloat(scd.MaxPrice, 64)
+			_maxPrice = fmt.Sprintf("%.0f", max*10000)
+			if _maxPrice == "0" {
+				_maxPrice = ""
+			}
+		}
+		if _minPrice != "" {
+			sq += fmt.Sprintf(gte, _minPrice)
+		}
+		if _minPrice != "" && _maxPrice != "" {
+			sq += `,`
+		}
+		if _maxPrice != "" {
+			sq += fmt.Sprintf(lte, _maxPrice)
+		}
+		if _minPrice != "" || _maxPrice != "" {
+			query_price := fmt.Sprintf(query_bool_should, fmt.Sprintf(query_price, sq, sq))
+			musts = append(musts, query_price)
+		}
+	}
+	boolsNum := 0
+	selectType := scd.SelectType
+	//should
+	if len(scd.Keyword) > 0 {
+		boolsNum = 1
+		queryItem := ""
+		if selectType == "" {
+			queryItem = "title"
+		} else if selectType == "all" {
+			queryItem = "detail\", \"title"
+		} else {
+			if scd.SearchTypeSwitch && DetailANDTitle(selectType) {
+				if strings.Contains(selectType, "title,") {
+					selectType = strings.Replace(selectType, "title,", "", -1)
+				} else if strings.Contains(selectType, ",title") {
+					selectType = strings.Replace(selectType, ",title", "", -1)
+				}
+
+			}
+			queryItem = strings.ReplaceAll(selectType, ",", "\",\"")
+		}
+		multi_match_new := fmt.Sprintf(multi_match, "%s", "\""+queryItem+"\"")
+
+		if scd.Comeinfrom == "supersearchPage" {
+			var keywordArr []string
+			if strings.Contains(scd.Keyword[0].Keyword, "+") {
+				//keywordArr = strings.Split(scd.Keyword[0].Keyword, "+")
+			} else if strings.Contains(scd.Keyword[0].Keyword, " ") {
+				//keywordArr = strings.Split(scd.Keyword[0].Keyword, " ")
+			}
+			if len(keywordArr) > 1 {
+				KeyWordSearch := KeyWord{}
+				for _, v := range keywordArr {
+					KeyWordSearch.Appended = append(KeyWordSearch.Appended, v)
+				}
+				scd.Keyword = []KeyWord{KeyWordSearch}
+			}
+		}
+		for _, v := range scd.Keyword {
+			shoulds := []string{}
+			must_not := []string{}
+			keysShoulds := []string{}
+			if v.Keyword != "" {
+				if strings.Contains(v.Keyword, "+") {
+					for _, vk := range strings.Split(v.Keyword, "+") {
+						if len(vk) == 0 {
+							continue
+						}
+						//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+						if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+							queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+							shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+							keysShoulds = append(keysShoulds, shouldsKey)
+						} else {
+							keysShoulds = append(keysShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+						}
+					}
+				} else if strings.Contains(v.Keyword, " ") {
+					for _, vk := range strings.Split(v.Keyword, " ") {
+						if len(vk) == 0 {
+							continue
+						}
+						//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+						if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+							queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+							shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+							keysShoulds = append(keysShoulds, shouldsKey)
+						} else {
+							keysShoulds = append(keysShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+						}
+					}
+				} else {
+					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+					if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(v.Keyword))) == 1 {
+						queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+						shouldsKey := fmt.Sprintf(multi_match, "\""+v.Keyword+"\"", "\""+queryItem+"\"")
+						keysShoulds = append(keysShoulds, shouldsKey)
+					} else {
+						keysShoulds = append(keysShoulds, fmt.Sprintf(multi_match_new, "\""+v.Keyword+"\""))
+					}
+				}
+				// 单个关键词分词后都包含
+				shoulds = append(shoulds, fmt.Sprintf(query_bool_must_and, strings.Join(keysShoulds, ","), ""))
+			}
+
+			//附加词
+			for _, vv := range v.Appended {
+				appendedShoulds := []string{}
+				if vv != "" {
+					// 附加词处理分词
+					if strings.Contains(vv, "+") {
+						for _, vk := range strings.Split(vv, "+") {
+							if len(vk) == 0 {
+								continue
+							}
+							//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+							if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+								queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+								shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+								appendedShoulds = append(appendedShoulds, shouldsKey)
+							} else {
+								appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+							}
+						}
+					} else if strings.Contains(vv, " ") {
+						for _, vk := range strings.Split(vv, " ") {
+							if len(vk) == 0 {
+								continue
+							}
+
+							//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+							if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+								queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+								shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+								appendedShoulds = append(appendedShoulds, shouldsKey)
+							} else {
+								appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+							}
+						}
+					} else {
+						appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vv+"\""))
+
+					}
+					// 单个关键词分词后都包含
+					shoulds = append(shoulds, fmt.Sprintf(query_bool_must_and, strings.Join(appendedShoulds, ","), ""))
+				}
+			}
+			//排除词
+			for _, vv := range v.Exclude {
+				if len(strings.TrimSpace(vv)) == 0 {
+					continue
+				} // 处理每组里面的空格分词
+				for _, notKeySplit := range strings.Split(vv, " ") {
+					if len(notKeySplit) == 0 {
+						continue
+					}
+					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+					if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(notKeySplit))) == 1 {
+						queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+						shouldsKey := fmt.Sprintf(multi_match, "\""+notKeySplit+"\"", "\""+queryItem+"\"")
+						must_not = append(must_not, shouldsKey)
+					} else {
+						must_not = append(must_not, fmt.Sprintf(multi_match_new, "\""+notKeySplit+"\""))
+					}
+				}
+
+			}
+
+			//添加
+			if len(shoulds) > 0 {
+				notStr := ""
+				if len(must_not) > 0 {
+					notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(must_not, ","))
+				}
+				if scd.WordsMode == WordsModeOr { // 包含任意
+					bools = append(bools, fmt.Sprintf(query_bool_should_and, strings.Join(shoulds, ","), notStr))
+				} else {
+					bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(shoulds, ","), notStr))
+				}
+			}
+		}
+	}
+	if scd.HasBuyerTel != "" {
+		if scd.HasBuyerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "buyertel"))
+		}
+	}
+	if scd.HasWinnerTel != "" {
+		if scd.HasWinnerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "winnertel"))
+		}
+	}
+
+	//搜索范围是否只有附件
+	//搜索范围只选择附件,是否有附件条件无效;
+	var isFileSearch = strings.ReplaceAll(selectType, ",", "\",\"") == "filetext"
+	if !isFileSearch && scd.FileExists != "" {
+		if scd.FileExists == "1" { //有附件
+			must_not = append(must_not, fmt.Sprintf(query_missing, "isValidFile"))
+			musts = append(musts, fmt.Sprintf(query_bool_must_term, 1))
+		} else if scd.FileExists == "-1" { //无附件
+			musts = append(musts, fmt.Sprintf(query_missing, "isValidFile"))
+		}
+	}
+	// 如果是领域化数据则需要加标签
+	if scd.BidField != "" {
+		musts = append(musts, fmt.Sprintf(query_bool_must_term_bidField, scd.BidField))
+	}
+	qstr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","), strings.Join(bools, ","), boolsNum)
+	return qstr
+}
+
+// 获取数据导出筛选条件
+func GetSqlObjFromId(mongo mg.MongodbSim, _id string) *SieveCondition {
+	var (
+		query *map[string]interface{}
+		ok    bool
+	)
+	if query, ok = mongo.FindById(ExportTable, _id, nil); !ok {
+		return nil
+	}
+	searchTypeSwitch, _ := (*query)["searchTypeSwitch"].(bool)
+	return &SieveCondition{
+		Id:               _id,
+		Keyword:          getKeyWordArrFromDbResult((*query)["keywords"]),
+		Industry:         getStringArrFromDbResult((*query)["industry"]),
+		MinPrice:         qutil.ObjToString((*query)["minprice"]),
+		MaxPrice:         qutil.ObjToString((*query)["maxprice"]),
+		Subtype:          qutil.ObjToString((*query)["subtype"]),
+		Area:             getStringArrFromDbResult((*query)["area"]),
+		City:             getStringArrFromDbResult((*query)["city"]),
+		SelectType:       qutil.ObjToString((*query)["selectType"]),
+		PublishTime:      qutil.ObjToString((*query)["publishtime"]),
+		Buyer:            getStringArrFromDbResult((*query)["buyer"]),
+		Buyerclass:       getStringArrFromDbResult((*query)["buyerclass"]),
+		HasBuyerTel:      qutil.ObjToString((*query)["hasBuyertel"]),
+		Winner:           getStringArrFromDbResult((*query)["winner"]),
+		HasWinnerTel:     qutil.ObjToString((*query)["hasWinnertel"]),
+		ComeInTime:       qutil.Int64All((*query)["comeintime"]),
+		Comeinfrom:       qutil.ObjToString((*query)["comeinfrom"]),
+		SelectIds:        getStringArrFromDbResult((*query)["selectIds"]),
+		PushKeyWords:     getStringArrFromDbResult((*query)["pushKeyWords"]),
+		FileExists:       qutil.ObjToString((*query)["fileExists"]),
+		SearchTypeSwitch: searchTypeSwitch,
+		BidField:         qutil.ObjToString((*query)["bid_field"]), // 领域化数据
+		SearchGroup:      qutil.IntAll((*query)["searchGroup"]),    //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode:       qutil.IntAll((*query)["searchMode"]),     // 搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode:        qutil.IntAll((*query)["wordsMode"]),      // 搜索关键词模式;默认0:包含所有,1:包含任意
+	}
+}
+
+// 数据导出-查询结果数量
+func GetDataExportSearchCountByScdId(sim, bid mg.MongodbSim, biddingName, elasticAddress, id string) (count int) {
+	scd := GetSqlObjFromId(sim, id) //用户筛选条件
+	if scd.SelectIds != nil {
+		//部分数据可能已删除、不存在;此处需要统计返回实际数量
+		//return len(scd.SelectIds)
+		return int(GetDataExportSelectReallyCount(bid, biddingName, scd.SelectIds))
+	}
+	return GetDataExportSearchCountBySieveCondition(scd, elasticAddress)
+}
+
+func GetDataExportSearchCountBySieveCondition(scd *SieveCondition, elasticAddress string) (count int) {
+	if isNullSearch(scd) {
+		return -1 //程序端返回最大值
+	}
+	if scd.SearchMode == SearchModeAccurate {
+		qstr := getDataExportSql(scd)
+		log.Printf("GetDataExportSearchCountUseId-%s-sql:%s\n", scd.Id, qstr)
+		count = int(elastic.Count(INDEX, TYPE, qstr))
+	}
+	// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
+	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
+	if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && scd.SearchMode == SearchModeFuzzy {
+		if len(scd.Keyword) != 0 {
+			// 关键词分词
+			searchTextSize := 0
+			if len(scd.Keyword) > 0 {
+				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+			}
+			if searchTextSize > 0 {
+				if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+					scd.Keyword[0].Keyword = secondKWS
+				}
+			}
+			// 附加词分词
+			for i := 0; i < len(scd.Keyword[0].Appended); i++ {
+				appendTextSize := 0
+				if len(scd.Keyword[0].Appended[i]) > 0 {
+					appendTextSize = len([]rune(scd.Keyword[0].Appended[i]))
+				}
+				if appendTextSize > 0 {
+					if secondKWS := jy.HttpEs(scd.Keyword[0].Appended[i], "ik_smart", elasticAddress); secondKWS != "" {
+						scd.Keyword[0].Appended[i] = secondKWS
+					}
+				}
+			}
+
+		}
+		qstr := getDataExportSql(scd)
+		count = int(elastic.Count(INDEX, TYPE, qstr))
+		log.Printf("GetDataExportSearchCountUseId-%s-count:%d-分词-sql:%s\n", scd.Id, count, qstr)
+		return count
+	}
+	log.Printf("GetDataExportSearchCountUseId-%s-count:%d\n", scd.Id, count)
+	return
+}
+
+// 合并map数据,去重
+func delRepeatMapArr(res *[]map[string]interface{}, res2 *[]map[string]interface{}) *[]map[string]interface{} {
+	if res != nil {
+		for _, v := range *res {
+			for n, m := range *res2 {
+				if qutil.ObjToString(v["_id"]) == qutil.ObjToString(m["_id"]) {
+					*res2 = append((*res2)[0:n], (*res2)[n+1:]...)
+					break
+				}
+			}
+		}
+		*res = append(*res, *res2...)
+	} else {
+		res = res2
+	}
+	return res
+}
+
+// 查询条件是否为空
+func isNullSearch(scd *SieveCondition) (isNull bool) {
+	if scd.PublishTime == "" && len(scd.Area) == 0 && len(scd.Industry) == 0 && len(scd.Keyword) == 0 && len(scd.Buyer) == 0 && len(scd.Winner) == 0 && scd.MinPrice == "" && scd.MaxPrice == "" && scd.Subtype == "" && len(scd.City) == 0 {
+		isNull = true
+	}
+	return isNull
+}
+
+/*
+ * 数据导出 查询结果
+ * _id 数据库查询条件记录id
+ * dataType 1-普通字段 2-高级字段
+ * webdomain 三级页域名
+ * count 返回数量 (-1:预览数据查询)
+ */
+
+func GetDataExportSearchResultByScdId(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress, id, dataType string, checkCount int) (*[]map[string]interface{}, error) {
+	scd := GetSqlObjFromId(sim, id)
+	list, err := GetDataExportSearchResult(bid, bidMgoDBName, elasticAddress, scd, dataType, checkCount)
+	if list == nil || err != nil {
+		return nil, err
+	}
+	return list, nil
+}
+
+// GetDataExportIdArrByScdId 数据包去重获取导出信息id
+func GetDataExportIdArrByScdId(sim mg.MongodbSim, elasticAddress, id string, checkCount int) ([]string, error) {
+	scd := GetSqlObjFromId(sim, id)
+	return GetDataExportIds(elasticAddress, scd, checkCount)
+}
+
+// 收藏导出
+var contentfilterReg = regexp.MustCompile("<[^>]+>")
+
+// GetDataExportSelectReallyCount 查询实际可调导出数量
+func GetDataExportSelectReallyCount(bid mg.MongodbSim, biddingName string, ids []string) int64 {
+	sess := bid.GetMgoConn()
+	defer bid.DestoryMongoConn(sess)
+	if ids == nil || len(ids) == 0 {
+		return 0
+	}
+	var queryIds []interface{}
+	for _, idStr := range ids {
+		queryIds = append(queryIds, mg.StringTOBsonId(idStr))
+	}
+	lenNum := int64(len(ids))
+	num1, err1 := sess.DB(biddingName).C("bidding").Find(map[string]interface{}{"_id": map[string]interface{}{
+		"$in": queryIds,
+	}}).Count()
+	if err1 == nil {
+		if num1 == lenNum {
+			return lenNum
+		}
+		num2, err2 := sess.DB(biddingName).C("bidding_back").Find(map[string]interface{}{"_id": map[string]interface{}{
+			"$in": queryIds,
+		}}).Count()
+		if err2 == nil {
+			if num2+num1 == lenNum {
+				return lenNum
+			} else if num1+num2 > lenNum {
+				return lenNum
+			} else if num1+num2 < lenNum {
+				return num1 + num2
+			}
+		}
+	}
+	return -2
+}
+
+func GetDataExportSelectResult(bidding mg.MongodbSim, biddingName string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
+	sess := bidding.GetMgoConn()
+	defer bidding.DestoryMongoConn(sess)
+	var queryIds []interface{}
+	for _, idStr := range scd.SelectIds {
+		queryIds = append(queryIds, mg.StringTOBsonId(idStr))
+	}
+
+	selectMap := map[string]interface{}{
+		"_id": 1, "title": 1, "detail": 1, "area": 1, "city": 1, "publishtime": 1, "projectname": 1, "buyer": 1, "s_winner": 1, "bidamount": 1, "subtype": 1, "toptype": 1, "filetext": 1, "purchasing": 1,
+	}
+	if dataType == "2" {
+		for _, key := range []string{"href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime"} {
+			selectMap[key] = 1
+		}
+	}
+	returnLsit := make([]map[string]interface{}, 0, len(queryIds))
+	iter := sess.DB(biddingName).C("bidding").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
+		"$in": queryIds,
+	}}).Iter()
+	for m := make(map[string]interface{}); iter.Next(&m); {
+		m["_id"] = mg.BsonIdToSId(m["_id"])
+		detail, _ := m["detail"].(string)
+		if detail != "" {
+			m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+		}
+		returnLsit = append(returnLsit, m)
+		m = make(map[string]interface{})
+	}
+	if len(returnLsit) == checkCount {
+		return &returnLsit, nil
+	}
+	iter_back := sess.DB(biddingName).C("bidding_back").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
+		"$in": queryIds,
+	}}).Iter()
+	for m := make(map[string]interface{}); iter_back.Next(&m); {
+		m["_id"] = mg.BsonIdToSId(m["_id"])
+		detail, _ := m["detail"].(string)
+		if detail != "" {
+			m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+		}
+		returnLsit = append(returnLsit, m)
+		m = make(map[string]interface{})
+	}
+	if len(returnLsit) == checkCount || checkCount == -1 {
+		return &returnLsit, nil
+	}
+	return nil, fmt.Errorf("选择数据导出异常 数据量期望%d条,实际查询%d条", checkCount, len(returnLsit))
+}
+
+func GetDataExportIds(elasticAddress string, scd *SieveCondition, checkCount int) ([]string, error) {
+	defer qutil.Catch()
+	if scd == nil {
+		return nil, errors.New("GetDataExportIds-未获取到查询信息")
+	}
+	if scd.SelectIds != nil {
+		return scd.SelectIds, nil
+	}
+	var qstr string
+	if scd.SearchMode == SearchModeAccurate {
+		//获取查询语句
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportIds-%s-sql:%s\n", scd.Id, qstr)
+	}
+	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
+	// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
+	if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
+		if len(scd.Keyword) != 0 {
+			searchTextSize := 0
+			// 关键词分词
+			if len(scd.Keyword) > 0 {
+				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+			}
+			if searchTextSize > 0 {
+				if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+					scd.Keyword[0].Keyword = secondKWS
+				}
+			}
+			// 附加词分词
+			for i := 0; i < len(scd.Keyword[0].Appended); i++ {
+				appendTextSize := 0
+				if len(scd.Keyword[0].Appended[i]) > 0 {
+					appendTextSize = len([]rune(scd.Keyword[0].Appended[i]))
+				}
+				if appendTextSize > 0 {
+					if secondKWS := jy.HttpEs(scd.Keyword[0].Appended[i], "ik_smart", elasticAddress); secondKWS != "" {
+						scd.Keyword[0].Appended[i] = secondKWS
+					}
+				}
+			}
+
+		}
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportIds-%s-分词查询-sql:%s\n", scd.Id, qstr)
+	}
+	res := doSearchByBatch(qstr, "1", checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
+	//获取信息id
+	idArr := make([]string, 0, 0)
+	for _, v := range res {
+		if id := qutil.ObjToString(v["_id"]); id != "" {
+			idArr = append(idArr, id)
+		}
+	}
+	if checkCount != len(idArr) {
+		return nil, fmt.Errorf("GetDataExportIds-%s-数据总量校验异常,期望:%d,实际:%d", scd.Id, checkCount, len(res))
+	}
+	return idArr, nil
+}
+
+// GetDataExportSearchResult 获取数据导出内容
+// entmg 高级字段包查询企业电话邮箱等字段
+// checkCount -1 预览500条
+func GetDataExportSearchResult(bid mg.MongodbSim, bidMgoDBName, elasticAddress string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
+	defer qutil.Catch()
+	if scd == nil {
+		return nil, errors.New("GetDataExportSearchResult-未获取到查询信息")
+	}
+	if scd.SelectIds != nil {
+		idSelectDates, idSelectErr := GetDataExportSelectResult(bid, bidMgoDBName, scd, dataType, checkCount)
+		if idSelectErr != nil {
+			return nil, idSelectErr
+		}
+		GetDataExportMatchKey(scd, idSelectDates)
+		return idSelectDates, idSelectErr
+	}
+	selectType := scd.SelectType
+	var qstr string
+	var res []map[string]interface{}
+	if scd.SearchMode == SearchModeAccurate { // 搜索模式为精确查找
+		//获取查询语句
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportSearchResult-%s-sql:%s\n", scd.Id, qstr)
+		//数据导出数据查询
+		res = doSearchByBatch(qstr, dataType, checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
+	}
+	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
+	if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
+		if len(scd.Keyword) != 0 {
+			searchTextSize := 0
+			// 关键词分词
+			if len(scd.Keyword) > 0 {
+				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+			}
+			if searchTextSize > 0 {
+				if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+					scd.Keyword[0].Keyword = secondKWS
+				}
+			}
+			// 附加词分词
+			for i := 0; i < len(scd.Keyword[0].Appended); i++ {
+				appendTextSize := 0
+				if len(scd.Keyword[0].Appended[i]) > 0 {
+					appendTextSize = len([]rune(scd.Keyword[0].Appended[i]))
+				}
+				if appendTextSize > 0 {
+					if secondKWS := jy.HttpEs(scd.Keyword[0].Appended[i], "ik_smart", elasticAddress); secondKWS != "" {
+						scd.Keyword[0].Appended[i] = secondKWS
+					}
+				}
+			}
+
+		}
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportSearchResult-%s-分词查询-sql:%s\n", scd.Id, qstr)
+		res = doSearchByBatch(qstr, dataType, checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
+	}
+	//校验数量
+	if checkCount != len(res) && checkCount != -1 {
+		return nil, fmt.Errorf("GetDataExportSearchResult-%s-数据总量校验异常,期望:%d,实际:%d", scd.Id, checkCount, len(res))
+	}
+	if selectType != scd.SelectType {
+		scd.SelectType = selectType
+	}
+	GetDataExportMatchKey(scd, &res)
+	return &res, nil
+}
+
+func doSearchByBatch(query, dataType string, searchCount int, flag string) (res []map[string]interface{}) {
+	if searchCount > onceSearchCount { //分批次查询
+		batchNum := qutil.IntAll(math.Ceil(float64(searchCount) / float64(onceSearchCount)))
+		var searchWaitGroup = &sync.WaitGroup{}
+		var lock sync.Mutex
+		for n := 0; n < batchNum; n++ {
+			searchWaitGroup.Add(1)
+			searchPool <- true
+			go func(start int) {
+				defer func() {
+					searchWaitGroup.Done()
+					<-searchPool
+				}()
+				checkNum, checkOk := onceSearchCount, false
+				if start == (batchNum - 1) {
+					if searchCount%onceSearchCount != 0 {
+						checkNum = searchCount % onceSearchCount
+					}
+				}
+
+				var tmp *[]map[string]interface{}
+				for i := 0; i < 3; i++ {
+					tmp = doSearch(query, start*onceSearchCount, onceSearchCount, dataType)
+					if tmp != nil && (len(*tmp) == checkNum) { //校验数据量是否够
+						checkOk = true
+						break
+					}
+				}
+				if tmp == nil {
+					log.Printf("%s-第%d页数据查询结果为空\n", flag, start+1)
+					return
+				}
+				if checkOk {
+					log.Printf("%s-第%d页数据加载完成,共%d条\n", flag, start+1, len(*tmp))
+				} else {
+					log.Printf("%s-第%d页数据加载异常,共%d条,预期%d条\n", flag, start+1, len(*tmp), checkNum)
+				}
+				lock.Lock()
+				res = append(res, *tmp...)
+				lock.Unlock()
+			}(n)
+		}
+		searchWaitGroup.Wait()
+		log.Printf("%s-分批次加载数据总量为%d\n", flag, len(res))
+	} else {
+		queryCount := qutil.If(searchCount == -1, onceSearchCount, searchCount).(int)
+		searchPool <- true
+		tmp := doSearch(query, 0, queryCount, dataType)
+		<-searchPool
+		if tmp == nil || len(*tmp) == 0 {
+			log.Printf("%s-一次性加载数据异常\n", flag)
+		} else {
+			res = *tmp
+			log.Printf("%s-一次性加载数据总量为%d\n", flag, len(res))
+		}
+	}
+	return
+}
+
+func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdomain string, dataType string, encry ...bool) *[]map[string]interface{} {
+	//格式化输出
+	isEncry := false
+	if len(encry) > 0 {
+		isEncry = true
+	}
+	for _, v := range *data {
+		//有中标企业 且 高级字段查询
+		if dataType == "2" {
+			if qutil.Int64All(v["bidendtime"]) > 0 {
+				v["bidendtime"] = strings.Split(time.Unix(qutil.Int64All(v["bidendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
+			} else {
+				v["bidendtime"] = ""
+			}
+			//查询企业公示 法人 公司电话 公司邮箱地址
+			s_winner, ok := v["s_winner"].(string) //改为entidlistxx?
+			if ok && s_winner != "" {
+				if entData, ok := entmg.Find("winner_enterprise", map[string]interface{}{"company_name": s_winner}, nil, `{"company_name":1,"company_email":1,"legal_person":1,"company_phone":1}`, false, -1, -1); ok {
+					if entData != nil && *entData != nil && len(*entData) > 0 {
+						for _, ev := range *entData {
+							if v["s_winner"] == ev["company_name"] {
+								legal_person := ""
+								if ev["legal_person"] != nil {
+									legal_person = ev["legal_person"].(string)
+									if isEncry {
+										var xx = "*"
+										switch len([]rune(legal_person)) {
+										case 3:
+											xx = "**"
+										case 4:
+											xx = "***"
+										}
+										legal_person = string([]rune(legal_person)[:1]) + xx
+									}
+								}
+								company_phone := ""
+								if ev["company_phone"] != nil {
+									company_phone = ev["company_phone"].(string)
+									if isEncry {
+										if len([]rune(company_phone)) > 7 {
+											company_phone = company_phone[:7] + "****"
+										} else {
+											company_phone = "****"
+										}
+									}
+								}
+								company_email := ""
+								if ev["company_email"] != nil && ev["company_email"] != "无" {
+									company_email = ev["company_email"].(string)
+									if isEncry {
+										if len(strings.Split(company_email, "@")) > 1 {
+											company_email = "******" + "@" + strings.Split(company_email, "@")[1]
+										}
+									}
+								}
+								v["legal_person"] = legal_person
+								v["company_phone"] = company_phone
+								v["company_email"] = company_email
+							}
+						}
+					}
+				}
+			}
+		}
+		//====================字段补漏=========================
+		if v["toptype"] == "结果" && dataType == "2" && !(v["agency"] != nil && v["budget"] != nil && v["buyerperson"] != nil && v["buyertel"] != nil) {
+			r := elastic.Get("projectset", "projectset", fmt.Sprintf(`{"query":{"term":{"list.infoid":"%s"}},"_source": ["list"]}`, v["_id"]))
+			if r != nil && len(*r) > 0 {
+				MsgList := (*r)[0]["list"]
+				if MsgList != nil {
+					list := qutil.ObjArrToMapArr(MsgList.([]interface{}))
+					for _, vv := range list {
+						if vv["subtype"] == "招标" {
+							if v["agency"] == nil && vv["agency"] != nil {
+								v["agency"] = vv["agency"]
+							}
+							if v["budget"] == nil && vv["budget"] != nil {
+								v["budget"] = vv["budget"]
+							}
+							if v["buyerperson"] == nil && vv["buyerperson"] != nil {
+								v["buyerperson"] = vv["buyerperson"]
+							}
+							if v["buyertel"] == nil && vv["buyertel"] != nil {
+								v["buyertel"] = vv["buyertel"]
+							}
+							break
+						}
+					}
+				}
+			}
+		}
+		if v["area"] == "A" {
+			v["area"] = "全国"
+		}
+		if v["bidamount"] != nil {
+			v["bidamount"] = formatFloat(qutil.Float64All(v["bidamount"]))
+		}
+		if v["budget"] != nil {
+			v["budget"] = formatFloat(qutil.Float64All(v["budget"]))
+		}
+		if v["publishtime"] != nil {
+			date := v["publishtime"]
+			v["publishtime"] = qutil.FormatDateWithObj(&date, qutil.Date_Short_Layout)
+		}
+		if v["bidopentime"] != nil {
+			date := v["bidopentime"]
+			v["bidopentime"] = qutil.FormatDateWithObj(&date, qutil.Date_Short_Layout)
+		}
+		if v["_id"] != nil {
+			encodeId := qutil.CommonEncodeArticle("content", v["_id"].(string))
+			v["url"] = webdomain + "/article/content/" + encodeId + ".html"
+			v["url_jump"] = webdomain + "/front/reloadTo/article/content/" + encodeId + ".html"
+		}
+		if v["currency"] == "" || v["currency"] == nil {
+			v["currency"] = "人民币"
+		}
+
+		if isEncry {
+			if v["projectscope"] != "" && v["projectscope"] != nil {
+				str := ClearHtml.ReplaceAllString(v["projectscope"].(string), "")
+				str = ClearOther.ReplaceAllString(str, "")
+				str = strings.Replace(str, " ", "", -1)
+				if len([]rune(str)) > 100 {
+					str = qutil.SubString(str, 0, 100) + "..."
+				}
+				v["projectscope"] = str
+			}
+			if v["detail"] != "" && v["detail"] != nil {
+				str := ClearHtml.ReplaceAllString(v["detail"].(string), "")
+				str = ClearOther.ReplaceAllString(str, "")
+				str = strings.Replace(str, " ", "", -1)
+				if len([]rune(str)) > 100 {
+					str = qutil.SubString(str, 0, 100) + "..."
+				}
+				v["detail"] = str
+			}
+			if v["title"] != "" && v["title"] != nil {
+				str := ClearHtml.ReplaceAllString(v["title"].(string), "")
+				str = ClearOther.ReplaceAllString(str, "")
+				str = strings.Replace(str, " ", "", -1)
+				if len([]rune(str)) > 100 {
+					str = qutil.SubString(str, 0, 100) + "..."
+				}
+				v["title"] = str
+			}
+
+		}
+
+		if v["subtype"] == nil && v["toptype"] != nil {
+			v["subtype"] = v["toptype"]
+		}
+	}
+	return data
+}
+
+// 保留到0.01分
+func formatFloat(value float64) string {
+	str := strings.TrimRight(fmt.Sprintf("%.7f", value*10000/100000000), "0")
+	if str[len(str)-1:] == "." {
+		return str[:len(str)-1]
+	}
+	return str
+}
+
+func doSearch(sql string, start, count int, dataType string) *[]map[string]interface{} {
+	if sql != "" {
+		//筛选字段
+		if dataType != "" {
+			dataexport_field := `"_id","title","detail","area","city","publishtime","projectname","buyer","s_winner","bidamount","subtype","toptype","filetext","purchasing"`
+			if dataType == "2" {
+				dataexport_field += `,"href","projectcode","buyerperson","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel","bidendtime"`
+			}
+			sql = sql[:len(sql)-1] + `,"_source":[` + dataexport_field + "]}"
+		}
+		//分页排序
+		sql = sql[:len(sql)-1] + `,"sort": {"dataweight": "desc","publishtime":"desc","id":"desc"},"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(count) + "}"
+	}
+	log.Println("doSearch", sql)
+	return elastic.Get(INDEX, TYPE, sql)
+}
+
+func getKeyWordArrFromDbResult(k interface{}) (arr []KeyWord) {
+	if k == nil {
+		return
+	}
+	kArr := k.([]interface{})
+	for _, v := range kArr {
+		kw := KeyWord{}
+		b, e := json.Marshal(v)
+		if e != nil {
+			log.Println(e.Error())
+		}
+		json.Unmarshal(b, &kw)
+		arr = append(arr, kw)
+	}
+	return
+}
+
+func getStringArrFromDbResult(c interface{}) (arr []string) {
+	if c != nil {
+		cArr := c.([]interface{})
+		arr = qutil.ObjArrToStringArr(cArr)
+	}
+	return
+}
+
+// 获取结果,空字段最少的数据
+func ScreenData(arr *[]map[string]interface{}, dataType string, resultNum int, kws []KeyWord) (res []map[string]interface{}) {
+	AllMap := map[int][]map[string]interface{}{}
+
+	NoKwsMap := map[int][]map[string]interface{}{}
+	lastNum := resultNum
+	for _, v := range *arr {
+		emptyNum := countOfTheEmpty(v, dataType)
+		if emptyNum == -1 {
+			continue
+		}
+		if len(kws) > 0 && kws[0].Keyword != "" {
+			var kwsFlag = true
+			for _, vk := range kws {
+				if strings.Contains(qutil.ObjToString(v["title"]), strings.Replace(vk.Keyword, "+", "", -1)) {
+					kwsFlag = false
+					continue
+				}
+			}
+			if kwsFlag {
+				if NoKwsMap[emptyNum] == nil {
+					NoKwsMap[emptyNum] = []map[string]interface{}{v}
+				} else {
+					NoKwsMap[emptyNum] = append(NoKwsMap[emptyNum], v)
+				}
+				continue
+			}
+		}
+		if AllMap[emptyNum] == nil {
+			AllMap[emptyNum] = []map[string]interface{}{v}
+			continue
+		}
+		AllMap[emptyNum] = append(AllMap[emptyNum], v)
+	}
+	//获取key
+	keys := []int{}
+	for k, _ := range AllMap {
+		keys = append(keys, k)
+	}
+	sort.Ints(keys)
+	//选取结果
+	for _, v := range keys {
+		if len(AllMap[v]) >= resultNum {
+			return append(res, AllMap[v][:resultNum]...)
+		} else {
+			resultNum = resultNum - len(AllMap[v])
+			tmp := append(res, AllMap[v][:len(AllMap[v])]...)
+			res = tmp
+		}
+	}
+	if len(res) < lastNum {
+		resultNum = lastNum - len(res)
+		//获取key
+		Nokeys := []int{}
+		for k, _ := range NoKwsMap {
+			Nokeys = append(Nokeys, k)
+		}
+		sort.Ints(Nokeys)
+		log.Println("没关键词的空字段数量", Nokeys)
+		//选取结果
+		for _, v := range Nokeys {
+			if len(NoKwsMap[v]) >= resultNum {
+				return append(res, NoKwsMap[v][:resultNum]...)
+			} else {
+				resultNum = resultNum - len(NoKwsMap[v])
+				tmp := append(res, NoKwsMap[v][:len(NoKwsMap[v])]...)
+				res = tmp
+			}
+		}
+	}
+	return res
+}
+func countOfTheEmpty(m map[string]interface{}, dataType string) int {
+	MsgType := m["subtype"]
+	//	if MsgType == "拟建" {
+	//		return -1
+	//	}
+	//计算空字段数量
+	var count int = 0
+	//高级字段包
+	if dataType == "2" {
+		if m["href"] == "" || m["href"] == nil {
+			count++
+		}
+		if m["projectcode"] == "" || m["projectcode"] == nil {
+			count++
+		}
+		if m["buyerperson"] == "" || m["buyerperson"] == nil {
+			count++
+		}
+		if m["buyertel"] == "" || m["buyertel"] == nil {
+			count++
+		}
+		if m["budget"] == "" || m["budget"] == nil {
+			count++
+		}
+		if m["bidopentime"] == "" || m["bidopentime"] == nil {
+			count++
+		}
+		if m["agency"] == "" || m["agency"] == nil {
+			count++
+		}
+		if m["projectscope"] == "" || m["projectscope"] == nil {
+			count++
+		}
+	}
+	if m["city"] == "" || m["city"] == nil {
+		count++
+	}
+	if m["publishtime"] == "" || m["publishtime"] == nil {
+		count++
+	}
+	if m["projectname"] == "" || m["projectname"] == nil {
+		count++
+	}
+	if m["buyer"] == "" || m["buyer"] == nil {
+		count++
+	}
+	if m["s_winner"] == "" || m["s_winner"] == nil {
+		if MsgType != "招标" {
+			count++
+		}
+	}
+	if m["bidamount"] == "" || m["bidamount"] == nil {
+		if MsgType != "招标" {
+			count++
+		}
+	}
+	if m["subtype"] == "" || m["subtype"] == nil {
+		count++
+	}
+	return count
+}

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

@@ -0,0 +1,343 @@
+package jy
+
+import (
+	"encoding/json"
+	"fmt"
+	"log"
+	"math/rand"
+	. "mongodb"
+	qutil "qfw/util"
+	"qfw/util/mysql"
+	"qfw/util/redis"
+	"strings"
+	"time"
+)
+
+// 大会员状态redis缓存
+type BigVipBaseMsg struct {
+	Status          int                    `json:"status"`          //大会员状态
+	Used            bool                   `json:"used"`            //是否首次使用大会员
+	PowerMap        map[int]bool           `json:"p_map"`           //权限列表
+	ProNum          int                    `json:"p_num"`           //可关注项目数量
+	EntNum          int                    `json:"e_num"`           //可关注企业数量(取企业情报监控和企业中标动态中最大的值)
+	DailyNum        int                    `json:"d_num"`           //数据包导出数量
+	Pid             string                 `json:"pid"`             //若为子账号此处为父节点userid
+	Uid             string                 `json:"uid"`             //用户id
+	HasTrial        bool                   `json:"has_trial"`       //是否试用过
+	Customers       int                    `json:"customers"`       //可关注客户数量
+	VipStatus       int                    `json:"vip_status"`      //超级订阅状态
+	VipStartDate    int64                  `json:"vipStartDate"`    //超级订阅开始时间
+	Vip_BuySet      BuySet                 `json:"vip_buyset"`      //超级订阅套餐内容
+	EntnicheStatus  int                    `json:"entniche_status"` //商机管理状态
+	IsUpgrade       bool                   `json:"isUpgrade"`       //是否是免费用户订阅升级用户 默认true
+	Registedate     int64                  `json:"registedate"`     //用户注册时间
+	EntName         string                 `json:"entname"`         //企业名称
+	EntIsNew        bool                   `json:"entIsNew"`        //是否是新版商机管理用户
+	IsEntService    bool                   `json:"isEntService"`    //是否有商机管理服务
+	PrivateGD       bool                   `json:"PrivateGD"`       //广东移动DICT 用户
+	Email           string                 `json:"email"`
+	EntInfo         map[int]*EntInfoStruct `json:"entInfo"`         //企业信息
+	MemberPowerType int64                  `json:"memberPowerType"` //大会员权益类型 0无 1个人 2企业
+	VipPowerType    int64                  `json:"vipPowerType"`    //超级订阅权益类型 0无 1个人 2企业
+	BaseUserId      int                    `json:"base_user_id"`    //用户base_user_id
+}
+
+type EntInfoStruct struct {
+	IsNew     bool   `json:"isNew"`     //是否是新版商机管理
+	IsPower   bool   `json:"isPower"`   //是否分配了商机管理权限
+	Status    int    `json:"status"`    //是否购买
+	Name      string `json:"name"`      //企业名称
+	IsService bool   `json:"isService"` //企业商机管理服务
+	RoleId    int    `json:"roleId"`    //角色默认0:员工; 1:系统(企业)管理员;2:部门管理员
+}
+
+// 超级订阅购买内容
+type BuySet struct {
+	Upgrade         int `json:"upgrade"`         //是否是升级版;1是 其他不是
+	AreaCount       int `json:"areacount"`       //省份数量
+	BuyerclassCount int `json:"buyerclasscount"` //行业数
+}
+
+var FrontService, BackService map[string][]int
+
+const (
+	IsNewFreeTimeCell       = 1637830020
+	BigmemberServiceTable   = "bigmember_service"
+	BigmemberUserPowerTable = "bigmember_service_user"
+
+	PowerCacheDb              = "other"
+	PowerCacheKey             = "bigmember_power_3_%s"
+	OneDay                    = 60 * 60 * 24
+	UserUpdateAreaKey         = "free_area_num_%s_%s"
+	BaseAreaNum               = 1
+	VipFileUploadNumKey       = "vip_file_num_%s_%s"  //超级订阅附件本月一下载次数 %s:userid ; %s:当前月份-fmt.Sprint(time.Now().Month())
+	FilePackNumKey            = "file_pack_num_%s_%s" //附件下载包本月  剩余次数  %s:userid   %s 当前月份-fmt.Sprint(time.Now().Month())
+	BaseInfoCacheDb           = "newother"
+	IsGetUserBaseInfoRedisKey = "baseinfo_%s"
+	RedisMenuKeyPC            = "jy_workdesktopmenu_10000_PC_%s"  //剑鱼appid:10000
+	RedisMenuKeyWX            = "jy_workdesktopmenu_10000_WX_%s"  //剑鱼appid:10000
+	RedisMenuKeyAPP           = "jy_workdesktopmenu_10000_APP_%s" //剑鱼appid:10000
+	UserPowerRedisKey         = "jy_userpowerredis_10000_%d_%s"   //工作桌面 用户功能缓存(类似bigmember_power_3_%s)
+)
+
+// 初始化大会员权益
+func InitBigVipService(mysql *mysql.Mysql) {
+	serviceList := mysql.Find(BigmemberServiceTable, nil, "id,s_url_front,s_url_back", "id", -1, -1)
+	if serviceList == nil || len(*serviceList) == 0 {
+		panic(fmt.Sprintf("大会员初始权限失败,请检查mysql链接是否正常、查看%s表是否正常", BigmemberServiceTable))
+	}
+	FrontService, BackService = make(map[string][]int), make(map[string][]int)
+	for _, one := range *serviceList {
+		power := qutil.ObjToMap(one)
+		if power == nil {
+			continue
+		}
+		serviceId := qutil.IntAll((*power)["id"])
+		if urlFronts := qutil.ObjToString((*power)["s_url_front"]); urlFronts != "" {
+			for _, urlFront := range strings.Split(urlFronts, "&") {
+				FrontService[urlFront] = append(FrontService[urlFront], serviceId)
+			}
+		}
+
+		if urlBacks := qutil.ObjToString((*power)["s_url_back"]); urlBacks != "" {
+			for _, urlBack := range strings.Split(urlBacks, "&") {
+				BackService[urlBack] = append(BackService[urlBack], serviceId)
+			}
+		}
+	}
+	log.Printf("init BigVipService status \nFrontService:%+v\nBackService:%+v\n", FrontService, BackService)
+}
+
+// 当大会员状态改变时清除此状态
+func ClearBigVipUserPower(userId string) bool {
+	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
+	baseInfoCacheKey := fmt.Sprintf(IsGetUserBaseInfoRedisKey, userId)
+	redisMenuKeyPC := fmt.Sprintf(RedisMenuKeyPC, userId)
+	redisMenuKeyWX := fmt.Sprintf(RedisMenuKeyWX, userId)
+	redisMenuKeyAPP := fmt.Sprintf(RedisMenuKeyAPP, userId)
+	userPowerRedisKey := fmt.Sprintf(UserPowerRedisKey, time.Now().Day(), userId)
+	return redis.Del(BaseInfoCacheDb, cacheKey) && redis.Del(BaseInfoCacheDb, baseInfoCacheKey) && redis.Del(BaseInfoCacheDb, redisMenuKeyPC) && redis.Del(BaseInfoCacheDb, redisMenuKeyWX) && redis.Del(BaseInfoCacheDb, redisMenuKeyAPP) && redis.Del(BaseInfoCacheDb, userPowerRedisKey)
+}
+
+// 获取商机管理个人基本信息
+func GetEntnicheState(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
+	userPower := BigVipBaseMsg{}
+	userPower.EntnicheStatus = 0
+	//手机号
+	data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
+	if ok && *data != nil && len(*data) > 0 {
+		//查询是否是商机管理付费用户
+		phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
+		if phone != "" {
+			if count := mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
+				userPower.EntnicheStatus = 1
+			}
+		}
+	}
+	return &userPower
+}
+
+// 获取大会员个人基本信息
+func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
+	userPower := BigVipBaseMsg{}
+	userPower.PowerMap = make(map[int]bool)
+	if userId == "" {
+		return &userPower
+	}
+	userPower.IsUpgrade = false
+	userPower.Uid = userId
+	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
+
+	if bytes, err := redis.GetBytes(BaseInfoCacheDb, cacheKey); err == nil && bytes != nil {
+		if err := json.Unmarshal(*bytes, &userPower); err == nil {
+			return &userPower
+		}
+	}
+	//大会员状态
+	data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1,"l_vip_starttime":1,"s_myemail":1,"base_user_id":1}`)
+	if ok && *data != nil && len(*data) > 0 {
+		userPower.Email = qutil.ObjToString((*data)["s_myemail"])
+		userPower.BaseUserId = qutil.IntAll((*data)["base_user_id"])
+		userPower.Registedate = qutil.Int64All((*data)["l_registedate"])
+		userPower.VipStartDate = qutil.Int64All((*data)["l_vip_starttime"])
+		userPower.Status = qutil.IntAllDef((*data)["i_member_status"], 0)
+		//子账号被启用
+		i_member_sub_status := qutil.IntAllDef((*data)["i_member_sub_status"], 0)
+		if (*data)["s_member_mainid"] != nil && qutil.ObjToString((*data)["s_member_mainid"]) != "" && i_member_sub_status > 0 {
+			userPower.Pid = qutil.ObjToString((*data)["s_member_mainid"])
+		}
+		if (userPower.Pid != "" && qutil.IntAllDef((*data)["i_member_sub_status"], 0) == 1) || mg.Count("member", map[string]interface{}{"userid": userId}) > 0 {
+			userPower.Used = true
+		}
+		if (*data)["i_member_trial"] != nil {
+			userPower.HasTrial = true
+		}
+		if vipStatus := qutil.IntAll((*data)["i_vip_status"]); vipStatus > 0 {
+			userPower.VipStatus = vipStatus
+			if o_vipjy := qutil.ObjToMap((*data)["o_vipjy"]); o_vipjy != nil {
+				if o_buyset := qutil.ObjToMap((*o_vipjy)["o_buyset"]); o_buyset != nil {
+					userPower.Vip_BuySet = BuySet{
+						Upgrade:         qutil.IntAll((*o_buyset)["upgrade"]),
+						AreaCount:       qutil.IntAll((*o_buyset)["areacount"]),
+						BuyerclassCount: qutil.IntAll((*o_buyset)["buyerclasscount"]),
+					}
+				}
+			}
+			userPower.VipPowerType = 1
+		}
+		if userPower.Status > 0 {
+			userPower.MemberPowerType = 1
+		}
+		//免费用户画像和附件下载权限
+		//if userPower.Status <= 0 && userPower.VipStatus <= 0 {
+		o_jy := qutil.ObjToMap((*data)["o_jy"])
+		//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+		//IsNewFreeTimeCell dev3.6.4版本之前发了个紧急版本处理老用户订阅问题,i_newfree字段必须用户选择地区才能生成,不能作为判断是否是新用户得唯一标识,在此版本添加了常量:IsNewFreeTimeCell作为判断标准;--ws
+		if qutil.IntAll((*o_jy)["i_newfree"]) > 0 || IsNewFreeTimeCell < userPower.Registedate {
+			userPower.IsUpgrade = true
+		}
+		//}
+		//查询是否是商机管理付费用户
+		//userPower.EntnicheStatus = 0
+		phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
+		if phone != "" {
+			res := mysql.SelectBySql(`SELECT i. STATUS AS status, i.isNew, i.power_source, r.role_id, u.power, i.name,i.id FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id ) LEFT JOIN entniche_info i ON u.ent_id = i.id WHERE u.phone = ? ORDER BY i. STATUS DESC, i.auth_status DESC`, phone)
+			if res != nil && len(*res) > 0 {
+				userPower.EntInfo = map[int]*EntInfoStruct{}
+				//商机管理
+				userPower.EntName = qutil.ObjToString((*res)[0]["name"])
+				//已购买企业未过期-商机管理用户
+				for _, v := range *res {
+					if qutil.IntAll(v["id"]) == 0 {
+						continue
+					}
+					entId := qutil.IntAll(v["id"])
+					userPower.EntInfo[entId] = &EntInfoStruct{
+						IsNew:     qutil.IntAll(v["isNew"]) > 0,
+						IsPower:   qutil.IntAll(v["power"]) > 0,
+						Status:    qutil.IntAll(v["status"]),
+						Name:      qutil.ObjToString(v["name"]),
+						IsService: qutil.IntAll(v["power_source"]) > 0,
+						RoleId:    qutil.IntAll(v["role_id"]),
+					}
+					// 判断是否是新商机管理
+					if qutil.IntAll(v["status"]) == 1 && qutil.IntAll(v["power"]) == 1 {
+						userPower.EntnicheStatus = 1
+						if qutil.IntAll(v["isNew"]) == 1 {
+							userPower.EntIsNew = true
+							// if userPower.EntIsNew && userPower.IsEntService {
+							// 	break
+							// }
+						}
+					}
+					// 判断是否是商机管理服务 (在超级订阅或者大会员、医械通(暂无)的基础上才会有的)
+					// if qutil.IntAll(v["power_source"]) == 1 {
+					// 	userPower.IsEntService = true
+					// 	break
+					// }
+
+				}
+			}
+			// 如果是商机管理服务用户,则不能是旧版商机管理及新版商机管理
+			// if userPower.IsEntService {
+			// 	userPower.EntnicheStatus = 0 // 商机管理状态
+			// 	userPower.EntIsNew = false   // 新版商机管理
+			// }
+			//if count := mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
+			//	userPower.EntnicheStatus = 1
+			//}
+			//广东移动DICT 用户
+			userPower.PrivateGD = mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone) > 0
+
+			//用于判断是否含有企业主体的超级订阅、大会员服务
+			epowerData := mysql.SelectBySql(`SELECT c.product_type FROM entniche_user a INNER JOIN entniche_power b
+		 									INNER JOIN entniche_wait_empower c
+		 									ON a.id =b.ent_user_id  AND c.id = b.wait_empower_id WHERE a.phone =? AND c.end_time >?`, phone, time.Now().Format(qutil.Date_Full_Layout))
+			if epowerData != nil && len(*epowerData) > 0 {
+				for _, v := range *epowerData {
+					product_type := qutil.ObjToString(v["product_type"])
+					if strings.Contains(product_type, "VIP订阅") {
+						userPower.VipPowerType = 2
+					} else if strings.Contains(product_type, "大会员") {
+						userPower.MemberPowerType = 2
+					}
+				}
+			}
+		}
+	}
+
+	//子账号查询父节点权限
+	queryId := qutil.If(userPower.Pid == "", userId, userPower.Pid).(string)
+	//用户购买的服务
+	serviceList := mysql.Find(BigmemberUserPowerTable, map[string]interface{}{"s_userid": queryId, "i_status": 0}, "DISTINCT(s_serviceid),i_frequency", "", -1, -1)
+	if serviceList != nil && len(*serviceList) != 0 {
+		pCount, eCount, dailyNum, customers := 0, 0, 0, 10
+		for _, item := range *serviceList {
+			serviceid := qutil.IntAll(item["s_serviceid"])
+			userPower.PowerMap[serviceid] = true
+			if serviceid == 14 { //项目数量
+				pCount = qutil.IntAll(item["i_frequency"])
+			} else if serviceid == 4 || serviceid == 12 || serviceid == 13 { //企业情报监控 企业中标动态
+				tEcount := qutil.IntAll(item["i_frequency"])
+				if tEcount > eCount {
+					eCount = tEcount
+				}
+			} else if serviceid == 17 || serviceid == 18 { //每日数据包
+				dailyNum = qutil.IntAll(item["i_frequency"])
+			} else if serviceid == 7 { //潜在客户 关注客户
+				customers = qutil.IntAll(item["i_frequency"])
+			}
+		}
+		userPower.EntNum = eCount
+		userPower.ProNum = pCount
+		userPower.DailyNum = dailyNum
+		userPower.Customers = customers
+	}
+
+	//存储缓存
+	go func() {
+		if bytes, err := json.Marshal(userPower); err == nil && bytes != nil {
+			oneDayMore := OneDay + rand.Intn(60*60)
+			_ = redis.PutBytes(BaseInfoCacheDb, cacheKey, &bytes, oneDayMore)
+		}
+	}()
+	return &userPower
+}
+
+// 权限判断
+func (this *BigVipBaseMsg) CheckBigVipFrontPower(reqFlag string) (pass bool) {
+	if reqFlag == "ent_portrait" || reqFlag == "unit_portrayal" { //画像页面无权限控制
+		return true
+	}
+	if this.Vip_BuySet.Upgrade == 1 {
+		if reqFlag == "ent_portrait" || reqFlag == "svip" {
+			return true
+		}
+	}
+	return this.checkPower(reqFlag, FrontService)
+}
+
+func (this *BigVipBaseMsg) CheckBigVipBackPower(reqFlag string) (pass bool) {
+	return this.checkPower(reqFlag, BackService)
+}
+
+func (this *BigVipBaseMsg) checkPower(reqFlag string, servicesPower map[string][]int) bool {
+	powers, ok := servicesPower[reqFlag]
+	if !ok {
+		return false
+	}
+	for _, p := range powers {
+		if this.PowerMap[p] {
+			return true
+		}
+	}
+
+	return false
+}
+
+func (this *BigVipBaseMsg) GetUseId() string {
+	if this.Pid != "" {
+		return this.Pid
+	}
+	return this.Uid
+}

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

@@ -0,0 +1,478 @@
+package jy
+
+import (
+	"crypto/rand"
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"math/big"
+	. "mongodb"
+	"net/http"
+	"net/url"
+	"qfw/util"
+	"qfw/util/mail"
+	"qfw/util/redis"
+	qrpc "qfw/util/rpc"
+	"qfw/util/sms"
+	"regexp"
+	"sort"
+	"strings"
+	"time"
+	"unicode"
+
+	"github.com/go-xweb/httpsession"
+)
+
+//获取用户合并以前,合并以后的openid
+func GetOldOpenid(s_m_openid, a_m_openid, s_phone string, mergeorder interface{}) string {
+	a_mergeorder, _ := mergeorder.([]interface{})
+	openid := ""
+	if len(a_mergeorder) > 0 {
+		first, _ := a_mergeorder[0].(string)
+		if first == "s_m_openid" {
+			openid = s_m_openid
+		} else if first == "a_m_openid" {
+			openid = a_m_openid
+		} else if first == "s_phone" {
+			openid = s_phone
+		}
+	} else {
+		if s_m_openid != "" {
+			openid = s_m_openid
+		} else if a_m_openid != "" {
+			openid = a_m_openid
+		} else if s_phone != "" {
+			openid = s_phone
+		}
+	}
+	return openid
+}
+
+var ClearHtml = regexp.MustCompile("<[^>]*>")
+var MatchSpace = regexp.MustCompile("\\s+")
+var filterReg_3 = regexp.MustCompile("(项目|公告|公示)$")
+var filterReg_2 = regexp.MustCompile("^[)\\)>》】\\]}}〕,,;;::'\"“”。.\\??、/+=\\_—*&……\\^%$¥@!!`~·(\\(<《【\\[{{〔]+$")
+var filterReg_1 = regexp.MustCompile("^([0-9]{1,3}|[零一二三四五六七八九十]{1,2}|联系人?|电话|地址|编号|采购|政府采购|成交|更正|招标|中标|变更|结果)$")
+var filterReg = regexp.MustCompile("^[的人号时元万公告项目地址电话邮编日期联系招标中结果成交项目项目采购采购项目政府采购公告更正公告]+$")
+var PhoneReg = regexp.MustCompile("^[1][3-9][0-9]{9}$")
+var EmailPattern = regexp.MustCompile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$")
+
+func FilteKey(k string) string {
+	k = strings.TrimSpace(k)
+	k = filterReg_3.ReplaceAllString(k, "")
+	k = filterReg_2.ReplaceAllString(k, "")
+	k = filterReg_1.ReplaceAllString(k, "")
+	k = filterReg.ReplaceAllString(k, "")
+	return k
+}
+
+// InterceptSearchKW 超过20个字,截断
+//返回截取后的字符串和截取掉中的前3个字
+func InterceptSearchKW(word string, keywordsLimit int, isFilter bool) (b_word, a_word, s_word string) {
+	if word == "" {
+		return
+	}
+	if isFilter {
+		word = FilteKey(word)
+	}
+	word = MatchSpace.ReplaceAllString(strings.TrimSpace(word), " ")
+	words := []rune(word)
+	if len(words) > keywordsLimit {
+		b_word = string(words[:keywordsLimit])
+		b_word = strings.TrimSpace(b_word)
+		if len(words) > keywordsLimit+3 {
+			a_word = string(words[keywordsLimit : keywordsLimit+3])
+		} else {
+			a_word = string(words[keywordsLimit:])
+		}
+	} else {
+		b_word = word
+	}
+	a_word = strings.TrimSpace(a_word)
+	s_word = MatchSpace.ReplaceAllString(b_word, " ")
+	return
+}
+
+func HttpEs(ques, analyzer, esAddress string) (res string) {
+	var addrs []string
+	surl := ""
+	for _, s := range strings.Split(esAddress, ",") {
+		addrs = append(addrs, s)
+	}
+	i, _ := rand.Int(rand.Reader, big.NewInt(int64(len(addrs)))) //随机
+	surl = addrs[int(i.Int64())] + "/bidding/_analyze"
+	URL, _ := url.Parse(surl)
+	Q := URL.Query()
+	Q.Add("text", ques)
+	Q.Add("analyzer", analyzer)
+	URL.RawQuery = Q.Encode()
+	resp, err := http.Get(URL.String())
+	if err != nil {
+		log.Println("es连接失败 err1:", err)
+		resp, err = getesResp(ques, analyzer, addrs)
+		if err != nil {
+			return
+		}
+	}
+	result, err := ioutil.ReadAll(resp.Body)
+	if err == nil {
+		defer resp.Body.Close()
+		var resmap map[string]interface{}
+		json.Unmarshal(result, &resmap)
+		if resmap != nil && resmap["tokens"] != nil {
+			tokens := util.ObjArrToMapArr(resmap["tokens"].([]interface{}))
+			for _, v := range tokens {
+				token := util.ObjToString(v["token"])
+				if len([]rune(token)) == 1 && !unicode.Is(unicode.Scripts["Han"], []rune(token)[0]) { //(P260保留单个汉字)
+					continue
+				}
+				if res != "" {
+					res += "+"
+				}
+				res += token
+			}
+		}
+	}
+	return
+}
+
+//
+func getesResp(ques, analyzer string, addrs []string) (resp *http.Response, err error) {
+	for _, v := range addrs {
+		surl := v + "/bidding/_analyze"
+		URL, _ := url.Parse(surl)
+		Q := URL.Query()
+		Q.Add("text", ques)
+		Q.Add("analyzer", analyzer)
+		URL.RawQuery = Q.Encode()
+		resp, err = http.Get(URL.String())
+		if err == nil {
+			break
+		}
+	}
+	return resp, err
+}
+
+//发送邮箱验证码
+func SendMailIdentCode(to, code string, auth []*mail.GmailAuth) bool {
+	html := fmt.Sprintf(`<div>
+		<div>
+			%s,您好!
+		</div>
+		<div style="padding: 20px 70px 10px 70px;">
+			<p>您正在进行绑定邮箱地址验证,请在邮件验证码输入框输入下方验证码:</p>
+			<span style="font-weight: bold;font-size: x-large;">%s</span>
+			<p>请勿向任何人泄露您收到的验证码。</p>
+			<p>如果您没有使用剑鱼标讯,请忽略此邮件。</p>
+			<p>此为系统邮件,请勿回复。</p>
+			<p>如有疑问,请联系客服 400-108-6670。</p>
+		</div>
+		<div>
+			<p>此致</p>
+			<p>剑鱼标讯</p>
+		</div>
+	</div>`, to, code)
+
+	for k, v := range auth {
+		if mail.GSendMail("剑鱼标讯", to, "", "", "剑鱼标讯邮箱校验", html, "", "", v) {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件成功", v.User))
+			return true
+		}
+		if k < len(auth)-1 {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!3s后使用其他邮箱尝试", v.User))
+		} else {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!", v.User))
+		}
+		time.Sleep(time.Second * 3)
+	}
+
+	return false
+}
+
+//
+func SendSMS(address, mobile string, params ...string) {
+	sms.SendSms(address, "01", mobile, params...)
+}
+
+//发送验证码
+//增加sessionKey字段 更换手机号防止绕过身份校验
+func SendPhoneIdentCode(address, phone string, session *httpsession.Session, sessionKey ...string) bool {
+	sessionKeyFlag := defaultPhoneFlag
+	if len(sessionKey) > 0 && sessionKey[0] != "" {
+		sessionKeyFlag = sessionKey[0]
+	}
+
+	lastSentTime := util.Int64All(session.Get(fmt.Sprintf("%sTime", sessionKeyFlag)))
+	//60秒之内不允许重复发
+	if lastSentTime > 0 && time.Now().Unix()-lastSentTime <= 60 {
+		return false
+	}
+	s_ranNum := util.GetRandom(6) //生成随机数
+	//s_ranNum = "111111"
+	session.Set(fmt.Sprintf("%sValue", sessionKeyFlag), s_ranNum)
+	session.Set(fmt.Sprintf("%sKey", sessionKeyFlag), phone)
+	session.Set(fmt.Sprintf("%sTime", sessionKeyFlag), time.Now().Unix())
+	//发送短信
+	log.Println("短信验证码", phone, s_ranNum)
+	SendSMS(address, phone, s_ranNum)
+	return true
+}
+
+const defaultPhoneFlag = "identCode"
+
+//短信验证码校验
+func CheckPhoneIdent(session *httpsession.Session, code string, sessionKey ...string) string {
+	sessionKeyFlag := defaultPhoneFlag
+	if len(sessionKey) > 0 && sessionKey[0] != "" {
+		sessionKeyFlag = sessionKey[0]
+	}
+	identCodeValue, _ := session.Get(fmt.Sprintf("%sValue", sessionKeyFlag)).(string)
+	if identCodeValue != "" && identCodeValue == code {
+		identCodeKey, _ := session.Get(fmt.Sprintf("%sKey", sessionKeyFlag)).(string)
+		ClearPhoneIdentSession(session)
+		return identCodeKey
+	}
+	return ""
+}
+
+//删除短信验证码有关的session
+func ClearPhoneIdentSession(session *httpsession.Session, sessionKey ...string) {
+	sessionKeyFlag := defaultPhoneFlag
+	if len(sessionKey) > 0 && sessionKey[0] != "" {
+		sessionKeyFlag = sessionKey[0]
+	}
+	session.Del(fmt.Sprintf("%sValue", sessionKeyFlag))
+	session.Del(fmt.Sprintf("%sKey", sessionKeyFlag))
+	session.Del(fmt.Sprintf("%sTime", sessionKeyFlag))
+}
+
+//邮箱校验
+func IsEmail(value string) bool {
+	return EmailPattern.MatchString(value)
+}
+
+//手机号校验
+func IsPhone(phone string) bool {
+	return PhoneReg.MatchString(phone)
+}
+
+//获取信息行业
+func Getindustrys(industryname string, mongodb MongodbSim) (industry map[string][]string, sortArray []string) {
+	industry = map[string][]string{}
+	sortArray = []string{}
+	classdata, ok1 := mongodb.FindOneByField("rc_task", `{"s_name":"`+industryname+`"}`, `{"s_class":1}`)
+	if ok1 && len(*classdata) > 0 {
+		classid := ""
+		if util.ObjToString((*classdata)["s_class"]) != "" {
+			classids := strings.Split(util.ObjToString((*classdata)["s_class"]), ",")
+			for k, v := range classids {
+				if k > 0 {
+					classid += `,`
+				}
+				classid += `"` + v + `"`
+			}
+		}
+		industryData, ok := mongodb.Find("rc_rule", `{"s_pid":{"$ne":""},"s_classid":{"$in":[`+classid+`]}}`, `{"i_order":1}`, `{"_id":1,"s_name":1}`, false, -1, -1)
+		if ok && industryData != nil && len(*industryData) > 0 {
+			for _, v := range *industryData {
+				fatFlag := 0
+				industryname, _ := v["s_name"].(string)
+				if strings.Contains(industryname, "_") {
+					fat := strings.Split(industryname, "_")[0]
+					child := strings.Split(industryname, "_")[1]
+					if len(industry[fat]) == 0 {
+						sortArray = append(sortArray, fat)
+					}
+					for _, fv := range industry[fat] {
+						if fv == strings.Trim(child, " ") {
+							fatFlag = 1
+							break
+						}
+					}
+					if fatFlag != 1 {
+						industry[fat] = append(industry[fat], child)
+					}
+				}
+			}
+		}
+	}
+	return industry, sortArray
+}
+
+//对应月份
+//
+func GetMonth(mon string) int {
+	month := map[string]int{
+		"January":   1,
+		"February":  2,
+		"March":     3,
+		"April":     4,
+		"May":       5,
+		"June":      6,
+		"July":      7,
+		"August":    8,
+		"September": 9,
+		"October":   10,
+		"November":  11,
+		"December":  12,
+	}
+	return month[mon]
+}
+
+//value unlimited 并发限制登陆用户
+func LoginRedisKey(userid string) string {
+	return fmt.Sprintf("unlimited_%s", userid)
+}
+
+//获取loginSess
+func GetLoginSess(userid string) []string {
+	key := LoginRedisKey(userid)
+	if data, ok := redis.Get("other", key).([]interface{}); ok {
+		return util.ObjArrToStringArr(data)
+	}
+	return []string{}
+}
+
+//判断是否在内
+func IsInLoginSess(key string, arr []string) bool {
+	for _, v := range arr {
+		if key == v {
+			return true
+		}
+	}
+	return false
+}
+
+type TtlMap struct {
+	key   string //sessionid
+	value int    //ttl
+}
+
+type AppLoginPush struct {
+	JgPushId    string `json:"jpushId"`
+	OtherPushId string `json:"opushId"`
+	PhoneType   string `json:"phoneType"`
+}
+
+//更新存储用户sessionid的队列 【sessionid ttl小于三天的清除】  key:sessionid
+func PutLoginSess(mongodb MongodbSim, apppushRpc, key, userid string, limit, max int) bool {
+	value := GetLoginSess(userid)
+	if !IsInLoginSess(key, value) {
+		value = append(value, key)
+	}
+	ttlmap := []TtlMap{}
+	if len(value) >= int(limit*max/100) {
+		new_value := []string{}
+		//如果已存的session大于限制 则清除三天后到期的session
+		for _, vv := range value {
+			ttl := redis.GetTTL("session", vv)
+			if ttl <= 86400*1 && ttl != -1 {
+				// if ttl <= 600 && ttl != -1 {
+				if ok := redis.Del("session", vv); ok {
+					LoginOutPush(mongodb, userid, vv, apppushRpc)
+					log.Println(fmt.Sprintf("%s用户的sessionid 到期时间还有%v 小于三天 清除 %s", userid, ttl, vv))
+				}
+				continue
+			}
+			new_value = append(new_value, vv)
+			ttlmap = append(ttlmap, TtlMap{vv, int(ttl)})
+		}
+		value = new_value
+	}
+	//清除并发最大限制的某个sessionid
+	if len(value) > max {
+		//排序 获取马上过期的session 清除
+		sort.Slice(ttlmap, func(i, j int) bool {
+			return ttlmap[i].value < ttlmap[j].value
+		})
+		if len(ttlmap) > 0 {
+			//清除sessionid
+			delId := ttlmap[0].key
+			redis.Del("session", delId)
+			value = removeArr(value, delId)
+			LoginOutPush(mongodb, userid, delId, apppushRpc)
+			log.Println(fmt.Sprintf("%s用户的sessionid 超过最大限制 清除 %s ,到期时间%v", userid, delId, ttlmap[0].value))
+			for _, v := range ttlmap {
+				log.Println(v.key, "===", v.value)
+			}
+		}
+	}
+	return redis.Put("other", LoginRedisKey(userid), value, -1)
+}
+
+//清除数组中的s
+func removeArr(arr []string, s string) []string {
+	result := []string{}
+	for _, v := range arr {
+		if v == s {
+			continue
+		}
+		result = append(result, v)
+	}
+	return result
+}
+
+//
+func LoginOutPush(mongodb MongodbSim, userid, sessid, apppushRpc string) {
+	rediskey := fmt.Sprintf("app_%s", sessid)
+	r := redis.Get("other", rediskey)
+	if r == nil {
+		return
+	}
+	arr, err := json.Marshal(r)
+	if err != nil {
+		log.Println("json Marshal err:", err)
+	}
+	apppush := AppLoginPush{}
+	// 反序列化
+	err2 := json.Unmarshal(arr, &apppush)
+	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},
+	})
+	//
+	log.Println("多账号登陆:", userid, apppush.PhoneType, apppush.JgPushId, apppush.OtherPushId, "踢人下线")
+	ok := qrpc.AppPush(apppushRpc, map[string]interface{}{
+		"type":        "signOut",
+		"descript":    "您的账号在其他设备登录,如有需要请重新登录。",
+		"jgPushId":    apppush.JgPushId,
+		"otherPushId": apppush.OtherPushId,
+		"phoneType":   apppush.PhoneType,
+		"userId":      userid,
+	})
+	log.Println("ok:", ok)
+}
+
+//session数组清除某个value[针对多账号同时在线的方法、退出登录时调用]
+func DelUnlimitSessionId(sessid, userid string) []string {
+	sessArr := GetLoginSess(userid)
+	newArr := []string{}
+	for _, v := range sessArr {
+		if v == sessid {
+			continue
+		}
+		newArr = append(newArr, v)
+	}
+	return newArr
+}
+
+//获取当天结束时间 单位秒
+func GetExpire() int {
+	t, _ := time.ParseInLocation(util.Date_Short_Layout, time.Now().AddDate(0, 0, 1).Format(util.Date_Short_Layout), time.Local)
+	t2, _ := time.ParseInLocation(util.Date_Full_Layout, time.Now().Format(util.Date_Full_Layout), time.Local)
+	return int(t.Unix() - t2.Unix())
+}
+
+func TimeProcessing(hour interface{}, duration int) time.Time {
+	todayZero, _ := time.ParseInLocation(util.Date_Full_Layout, fmt.Sprint(hour), time.Local)
+	mm, _ := time.ParseDuration(fmt.Sprint(duration) + "m")
+	t := todayZero.Add(mm)
+	return t
+}

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

@@ -0,0 +1,188 @@
+package jy
+
+import (
+	"bytes"
+	"encoding/json"
+	"errors"
+	"io"
+	"io/ioutil"
+	"log"
+	"mongodb"
+	"net/http"
+	qu "qfw/util"
+	"qfw/util/mysql"
+	"strings"
+)
+
+//是否是付费用户
+type VipState struct {
+	VipState     int   //超级订阅状态(1普通 2升级版)
+	BigMember    int   //大会员状态
+	EntMember    int   //商机管理用户状态
+	RegisterData int64 //注册时间
+	VipStartData int64 //超级订阅开始时间
+	IsNewEnt     bool  //新版商机管理
+	EntService   bool  //企业服务权限
+}
+
+func GetVipState(mysql *mysql.Mysql, mg mongodb.MongodbSim, userId string, entId int) (vs *VipState) {
+	vs = &VipState{}
+	if userId == "" {
+		return
+	}
+	phone := ""
+	data, ok := mg.FindById("user", userId, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1,"l_registedate":1,"l_vip_starttime":1`)
+	if data != nil && len(*data) > 0 && ok {
+		iVipStatus := qu.IntAll((*data)["i_vip_status"])
+		if iVipStatus > 1 {
+			vs.VipState = 1
+			oVipJY, _ := (*data)["o_vipjy"].(map[string]interface{})
+			if oVipJY["o_buyset"] != nil {
+				oBuySet := oVipJY["o_buyset"].(map[string]interface{})
+				if oBuySet["upgrade"] != nil {
+					vs.VipState = 2
+				}
+			}
+		}
+		if iMemberStatus := qu.IntAllDef((*data)["i_member_status"], 0); iMemberStatus > 0 {
+			vs.BigMember = iMemberStatus
+		}
+		if sPhone, _ := (*data)["s_phone"].(string); sPhone != "" {
+			phone = sPhone
+		} else if sMPhone, _ := (*data)["s_m_phone"].(string); sMPhone != "" {
+			phone = sMPhone
+		}
+		if phone != "" && entId > 0 {
+			entNicheInfos := mysql.SelectBySql(`SELECT i.status,i.isNew,i.power_source,r.role_id,u.power FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id)  LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone = ? and i.id = ? `, phone, entId)
+			//商机管理用户信息判断
+			if entNicheInfos != nil && len(*entNicheInfos) > 0 {
+				entNicheInfo := (*entNicheInfos)[0]
+				vs.IsNewEnt = qu.Int64All(entNicheInfo["isNew"]) > 0
+				vs.EntService = qu.Int64All(entNicheInfo["power_source"]) > 0
+				//非企业管理服务  商机管理
+				if !vs.EntService && qu.IntAll(entNicheInfo["status"]) > 0 && (qu.IntAll(entNicheInfo["power"]) == 1 || qu.IntAll(entNicheInfo["role_id"]) > 0) {
+					vs.EntMember = 1
+				}
+			}
+		}
+		vs.RegisterData, _ = ((*data)["l_registedate"]).(int64)
+		vs.VipStartData, _ = ((*data)["l_vip_starttime"]).(int64)
+	}
+	return
+}
+
+//是否是付费账户
+func (vs *VipState) IsPayedUser() bool {
+	return vs.VipState > 0 || vs.BigMember > 0 || vs.EntMember > 0
+}
+
+//免费 标题(title)  正文(content) 老用户【中标企业(winner)】
+//付费用户 全部(all)、标题(title)  正文(content)  会员: 采购单位(buyer) 中标企业(winner) 招标代理机构(agency) 附件(file)
+//项目名称projectname和标的物purchasing(ppa)
+func (vs *VipState) GetQueryItems(selectType string, limitOldTime int64) (items []string) {
+	if vs.IsPayedUser() {
+		for _, t := range strings.Split(selectType, ",") {
+			if t == "content" {
+				items = append(items, "detail")
+			} else if t == "buyer" {
+				items = append(items, "mbuyer")
+			} else if t == "winner" {
+				items = append(items, "mwinner")
+			} else if t == "agency" {
+				items = append(items, "magency")
+			} else if t == "title" {
+				items = append(items, "title")
+			} else if t == "ppa" {
+				items = append(items, []string{"purchasing", "projectname.pname"}...)
+			} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
+				items = append(items, "filetext")
+			}
+		}
+		return
+	}
+	isOldUser := vs.RegisterData != 0 && vs.RegisterData < limitOldTime
+	for _, t := range strings.Split(selectType, ",") {
+		if t == "winner" {
+			if isOldUser {
+				items = append(items, "mwinner")
+			}
+		} else if t == "title" {
+			items = append(items, "title")
+		} else if t == "content" {
+			items = append(items, "detail")
+		} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
+			items = append(items, "filetext")
+		}
+	}
+	return
+}
+
+// HasBidFieldPower 获取用户是否有领域化数据权限
+func HasBidFieldPower(url string, userId string, functionCode string) bool {
+	// 是否开通过权益
+	header := map[string]string{
+		"newUserId": userId,
+	}
+	byJson, err := PostByJson(url, []byte(""), header)
+	if err != nil || byJson == nil {
+		log.Println("查询用户权益", url, userId, functionCode, err)
+		return false
+	}
+	if byJson != nil {
+		powerList := byJson["data"].([]interface{})
+		for i := 0; i < len(powerList); i++ {
+			if powerList[i] == functionCode {
+				return true
+			}
+		}
+	}
+	return false
+}
+
+func PostByJson(reqUrl string, data []byte, header map[string]string) (rs map[string]interface{}, err error) {
+	reqData := bytes.NewBuffer(data)
+	log.Println("请求参数", reqData)
+	method := "POST"
+	client := &http.Client{}
+	req, err2 := http.NewRequest(method, reqUrl, reqData)
+	if err2 != nil {
+		log.Println(err2)
+	}
+	req.Header.Add("Content-Type", "application/json")
+	if header != nil && len(header) > 0 {
+		for k, v := range header {
+			req.Header.Add(k, v)
+
+		}
+	}
+	log.Printf("请求url:%v", reqUrl)
+	log.Printf("请求header:%v", header)
+	res, err3 := client.Do(req)
+	if err3 != nil {
+		log.Println(err3)
+	}
+	log.Printf("err:%v,结果:%v", err3, res)
+	defer func(Body io.ReadCloser) {
+		err6 := Body.Close()
+		if err6 != nil {
+			log.Println("ReadCloser Err", err6)
+		}
+	}(res.Body)
+
+	if err3 != nil {
+		log.Println("请求失败:", err3)
+		return map[string]interface{}{}, errors.New("请求失败")
+	}
+	body, err4 := ioutil.ReadAll(res.Body)
+	if err4 != nil {
+		log.Println("读取响应数据信息失败", err4)
+		return map[string]interface{}{}, errors.New("读取响应信息失败")
+	}
+	err5 := json.Unmarshal(body, &rs)
+	if err5 != nil {
+		log.Println("反序列化数据失败", err5)
+		return map[string]interface{}{}, errors.New("反序列化数据失败")
+	}
+	log.Println("结果:", rs)
+	return rs, nil
+}

+ 0 - 1
src/jfw/modules/publicapply/src/attachmentdow/service/service.go

@@ -34,7 +34,6 @@ func (u *Dow) SupplyInfoFileDownload() {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
-
 		BaseMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		vipStatus := jy.GetVipState(u.Session(), *config.Middleground, userid)
 		isPower := false

+ 2 - 1
src/jfw/modules/publicapply/src/config.yaml

@@ -2,4 +2,5 @@ etcd:
   hosts:
   - 127.0.0.1:2379
 userCenterKey: "usercenter.rpc" #用户中台rpc
-powerCheckCenterKey: "powercheck.rpc" #权益校验中台
+powerCheckCenterKey: "powercheck.rpc" #权益校验中台
+entManageApplication: "entmanageapplication.rpc" #企业管理中台

+ 11 - 8
src/jfw/modules/publicapply/src/config/config.go

@@ -70,12 +70,15 @@ var (
 )
 
 func init() {
-    g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
-    //程序配置文件
-    qutil.ReadConfig(&Config)
-    qutil.ReadConfig("./bidcollection.json", &BidCollConfig)
-    qutil.ReadConfig("./adLeague.json", &AdLeaguefig)
-    qutil.ReadConfig("./shareFission.json", &ShareConfig)
-    var ctx = gctx.New()
-    Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String())
+	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
+	//程序配置文件
+	qutil.ReadConfig(&Config)
+	qutil.ReadConfig("./bidcollection.json", &BidCollConfig)
+	qutil.ReadConfig("./adLeague.json", &AdLeaguefig)
+	qutil.ReadConfig("./shareFission.json", &ShareConfig)
+	var ctx = gctx.New()
+	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
+		RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
+		RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
+		RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String())
 }

+ 2 - 10
src/jfw/modules/publicapply/src/filter/sessionfilter.go

@@ -8,6 +8,7 @@ import (
 	. "app.yhyue.com/moapp/jybase/api"
 	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/identity"
 )
 
 //登录限制
@@ -26,16 +27,7 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		session.Set("mgoUserId", getSession["userId"])
 	}
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
-		identity := Middleground.UserCenter.IdentityByUserId(util.Int64All(getSession["base_user_id"]))
-		if identity != nil {
-			session.SetMultiple(map[string]interface{}{
-				"personId":     identity.PersonId,
-				"userName":     identity.UserName,
-				"accountId":    identity.AccountId,
-				"positionId":   identity.PositionId,
-				"positionType": identity.PositionType,
-			})
-		}
+		identity.SwitchToBest(util.Int64All(getSession["base_user_id"]), session, Middleground)
 	}
 	if reg.MatchString(req.URL.Path) || reg.MatchString(req.URL.Path) || reg_share.MatchString(req.URL.Path) || reg_nps.MatchString(req.URL.Path) {
 		return true

+ 1 - 1
src/jfw/modules/publicapply/src/go.mod

@@ -4,7 +4,7 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230129060002-f69424aa14ba
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.0.6

+ 2 - 2
src/jfw/modules/publicapply/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 13 - 12
src/jfw/modules/publicapply/src/userbase/entity/entity.go

@@ -6,7 +6,6 @@ import (
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
 	"jy/src/jfw/modules/publicapply/src/userbase/initjson"
-	. "jy/src/jfw/modules/publicapply/src/userbase/initjson"
 	"net/url"
 	"strings"
 	"time"
@@ -61,7 +60,7 @@ func (this *UserInfo) SaveNameByUserId() bool {
 			"s_platform":   this.Platform,
 		},
 	}
-	return db.Mgo.Update(BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
+	return db.Mgo.Update(initjson.BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
 }
 
 //获取用户已选功能或基本功能
@@ -70,16 +69,16 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 		"s_userId":   this.UserId,
 		"s_platform": this.Platform,
 	}
-	res, ok := db.Mgo.FindOne(BaseFuncInfo.Cfcollotion, queryMap)
+	res, ok := db.Mgo.FindOne(initjson.BaseFuncInfo.Cfcollotion, queryMap)
 	if ok && len(*res) > 0 {
 		names := util.ObjToString((*res)["s_names"])
 		if names != "" {
 		L:
 			for _, nv := range strings.Split(names, ",") {
-				if len(fns) >= BaseFuncInfo.Total {
+				if len(fns) >= initjson.BaseFuncInfo.Total {
 					break
 				}
-				for _, v := range BaseFuncInfo.CommonFunctions {
+				for _, v := range initjson.BaseFuncInfo.CommonFunctions {
 					if v.Name == nv {
 						fns = append(fns, &FuncNames{
 							Name: v.Name,
@@ -92,7 +91,7 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 			}
 		}
 	} else {
-		for _, v := range BaseFuncInfo.CommonFunctions {
+		for _, v := range initjson.BaseFuncInfo.CommonFunctions {
 			if v.Isbase {
 				if v.Name == "订阅管理" && !IsPower(v.Name, this.Session) {
 					continue
@@ -103,7 +102,7 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 					Img:  thisByPlat(this.Platform, "img", &v),
 				})
 			}
-			if len(fns) >= BaseFuncInfo.Total {
+			if len(fns) >= initjson.BaseFuncInfo.Total {
 				break
 			}
 		}
@@ -115,7 +114,7 @@ var ChargeMap = map[string]bool{}
 
 //获取所有用户可用功能
 func (this *UserInfo) AllNames() (fns []*FuncNames) {
-	for _, v := range BaseFuncInfo.CommonFunctions {
+	for _, v := range initjson.BaseFuncInfo.CommonFunctions {
 		ChargeMap[v.Name] = v.Charge
 		if !v.Charge || IsPower(v.Name, this.Session) {
 			fns = append(fns, &FuncNames{
@@ -158,7 +157,7 @@ func thisByPlat(platform, name string, bcv *initjson.BaseFunc) (res string) {
 
 //查看是否有使用此功能的权限
 func IsPower(name string, session *httpsession.Session) (b bool) {
-	BigPower := jy.GetBigVipUserBaseMsg( session,*config.Middleground)
+	BigPower := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if BigPower.Status > 0 {
 		switch name {
 		case "企业情报监控":
@@ -193,7 +192,7 @@ func HasIndustryTag(session *httpsession.Session, userId string) bool {
 		return res.(bool)
 	}
 	var hasTag bool
-	vipStatus := jy.GetVipState( session,*config.Middleground, userId)
+	vipStatus := jy.GetVipState(session, *config.Middleground, userId)
 	if vipStatus.VipState > 0 || vipStatus.BigMember > 0 || vipStatus.EntMember > 0 { // 仅免费用户查询
 		redis.Put("newother", cacheKey, hasTag, cacheTimeout)
 		return hasTag
@@ -255,7 +254,6 @@ func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[stri
 		err = fmt.Errorf("token参数格式异常")
 		return
 	}
-
 	uId = param.Get("uid")
 	sName = param.Get("sName")
 	sid = util.IntAll(param.Get("sid"))
@@ -303,12 +301,15 @@ func (this *TipInfoStruct) GetTipInfo() (flag int) {
 	} else { //查询是否提示弹框
 		//判断是否严重用户注册时间
 		if config.Config.TipInfo[this.TipName] > 0 {
-			userBase := jy.GetBigVipUserBaseMsg( this.Session,*config.Middleground)
+			userBase := jy.GetBigVipUserBaseMsg(this.Session, *config.Middleground)
 			//此时间点后注册的新用户
 			if userBase.Registedate > config.Config.TipInfo[this.TipName] {
 				return 999
 			}
 		}
+		queryMap[this.TipName] = map[string]interface{}{
+			"$gt": 0,
+		}
 		result, ok := db.Mgo.FindOneByField("tip_info", queryMap, map[string]interface{}{this.TipName: 1})
 		if ok && result != nil && len(*result) > 0 {
 			return util.IntAll((*result)[this.TipName])

+ 4 - 3
src/jfw/modules/subscribepay/src/filter/mergefilter.go

@@ -1,14 +1,15 @@
 package filter
 
 import (
-	"app.yhyue.com/moapp/jybase/redis"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"fmt"
 	"jy/src/jfw/modules/subscribepay/src/config"
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
 	"net/http"
 
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 )
 
@@ -22,7 +23,7 @@ type mergeFilter struct {
 
 func (l *mergeFilter) Do() bool {
 	//账户合并-刷新session
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
 			if sUid, ok := val.(string); sUid != "" && ok {
 				log.Printf("账户合并 mergeFilter 自动刷新session old:%s new:%s\n", uid, sUid)

+ 231 - 0
src/jfw/public/dataexport.go

@@ -0,0 +1,231 @@
+package public
+
+import (
+	"fmt"
+	"jy/src/jfw/config"
+	"log"
+	"strings"
+	"sync"
+	"time"
+
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/mail"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+)
+
+var ExConf *DataexportConfig
+
+//价格配置文件
+type DataexportConfig struct {
+	MsgMaxCount int  `json:"msgMaxCount"`
+	Font        Font `json:"font"`
+}
+
+type Font struct {
+	Enabled                 bool   `json:"enabled"`
+	ConvertVersionDefault   string `json:"convertVersionDefault"`
+	UnConvertVersionDefault string `json:"unConvertVersionDefault"`
+	MappingFileExt          string `json:"mappingFileExt"`
+	MappingFilePath         string `json:"mappingFilePath"`
+	RedisPool               string `json:"redisPool"`
+	RedisKey                string `json:"redisKey"`
+}
+
+func init() {
+	util.ReadConfig("./dataexport.json", &ExConf)
+}
+
+//发送邮箱验证码
+func SendMailIdentCode(to, code string, auth []*mail.GmailAuth) bool {
+	html := fmt.Sprintf(`<div>
+		<div>
+			%s,您好!
+		</div>
+		<div style="padding: 20px 70px 10px 70px;">
+			<p>您正在进行导出邮箱地址验证,请在邮件验证码输入框输入下方验证码:</p>
+			<span style="font-weight: bold;font-size: x-large;">%s</span>
+			<p>请勿向任何人泄露您收到的验证码。</p>
+			<p>如果您没有使用剑鱼标讯,请忽略此邮件。</p>
+			<p>此为系统邮件,请勿回复。</p>
+			<p>如有疑问,请联系客服 400-108-6670。</p>
+		</div>
+		<div>
+			<p>此致</p>
+			<p>剑鱼标讯</p>
+		</div>
+	</div>`, to, code)
+
+	for k, v := range auth {
+		if mail.GSendMail("剑鱼标讯", to, "", "", "剑鱼标讯邮箱校验", html, "", "", v) {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件成功", v.User))
+			return true
+		}
+		if k < len(auth)-1 {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!3s后使用其他邮箱尝试", v.User))
+		} else {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!", v.User))
+		}
+		time.Sleep(time.Second * 3)
+	}
+
+	return false
+}
+
+var finaceLock *sync.Mutex = &sync.Mutex{}
+
+func GetWaitPayToken(orderid int64, order_money int, ordercode, payway, userid string) string {
+	return util.GetMd5String(fmt.Sprintf("%d_%d_%s_%s_%s", orderid, order_money, ordercode, payway, userid))
+}
+
+/*
+	获取-筛选条件-金额
+*/
+func GetPriceDes_SieveCondition(minPrice, maxPrice string) string {
+	des := ""
+	unit := "万元"
+	if minPrice != "" && maxPrice != "" {
+		des = minPrice + unit + "-" + maxPrice + unit
+	} else if minPrice != "" {
+		des = "大于" + minPrice + unit
+	} else if maxPrice != "" {
+		des = "小于" + maxPrice + unit
+	}
+	return des
+}
+
+//招标数据导出筛选
+type BidSearchExport struct {
+	Keywords        string //搜索词
+	Publishtime     string //发布时间
+	Area            string //地区
+	Subtype         string //信息类型
+	Minprice        string //最低价格
+	Maxprice        string //最高价格
+	Industry        string //选中的行业
+	SelectType      string //标题 or 全文
+	Winner          string //中标单位
+	Buyerclass      string //采购单位行业
+	Hasbuyertel     string //是否有采购电话
+	Haswinnertel    string //是否有中标电话
+	SelectIds       string //选择单条信息id
+	Notkey          string //排除词 排除词(副:五组,每组最多15个字符)
+	FileExists      string //是否有附件
+	City            string //城市
+	BidField        string // 领域化数据: 0101 医疗
+	SearchGroup     int    // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode      int    // 搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode       int    // 搜索关键词模式;默认0:包含所有,1:包含任意
+	AdditionalWords string // 关键词:附加关键词(副:五组,每组最多15个字符)
+}
+
+func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interface{}) {
+	defer util.Catch()
+	areaSave, industrySave, citySave := []string{}, []string{}, []string{}
+	winnerSave, buyerclassSave := []string{}, []string{}
+	publishtimeSave := this.Publishtime
+	if len(this.Area) > 0 {
+		areaSave = strings.Split(this.Area, ",")
+	}
+	if this.City != "" {
+		citySave = strings.Split(this.City, ",")
+	}
+	if len(this.Industry) > 0 {
+		industrySave = strings.Split(this.Industry, ",")
+	}
+	if len(this.Buyerclass) > 0 {
+		buyerclassSave = strings.Split(this.Buyerclass, ",")
+	}
+
+	if len(this.Winner) > 0 {
+		winnerSave = strings.Split(this.Winner, ",")
+	}
+
+	KeyWordSave := []dataexport.KeyWord{}
+	if len(this.Keywords) > 0 || len(this.AdditionalWords) > 0 {
+		_, _, keywords := jy.InterceptSearchKW(this.Keywords, util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), len(this.Industry) == 0)
+		keywords = strings.Replace(keywords, "+", " ", -1)
+		excludes := []string{}    // 排除词
+		appendWords := []string{} // 附加词
+		//排除词  每组排除词不能超过15个字符
+		if this.Notkey != "" && len(strings.Split(this.Notkey, ",")) > 0 {
+			for _, ak := range strings.Split(this.Notkey, ",") {
+				if len([]rune(ak)) > 15 {
+					excludes = append(excludes, string([]rune(ak)[:15]))
+				} else {
+					excludes = append(excludes, ak)
+				}
+			}
+		}
+		//附加词 每组附加词不能超过15个字符
+		if this.AdditionalWords != "" && len(strings.Split(this.AdditionalWords, ",")) > 0 {
+			for _, ak := range strings.Split(this.AdditionalWords, ",") {
+				if len([]rune(ak)) > 15 {
+					appendWords = append(appendWords, string([]rune(ak)[:15]))
+				} else {
+					appendWords = append(appendWords, ak)
+				}
+			}
+		}
+		KeyWordSave = append(KeyWordSave, dataexport.KeyWord{Keyword: keywords, Exclude: excludes, Appended: appendWords})
+	}
+
+	//时间
+	now := time.Now()
+	if this.Publishtime == "lately-7" { //最近7天
+		starttime := fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		publishtimeSave = fmt.Sprintf("%s_%d", starttime, now.Unix())
+	} else if this.Publishtime == "lately-30" { //最近30天
+		starttime := fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		publishtimeSave = fmt.Sprintf("%s_%d", starttime, now.Unix())
+	} else if this.Publishtime == "thisyear" { //去年
+		starttime := fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+		endtime := fmt.Sprint(now.Unix())
+		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
+	} else if this.Publishtime == "threeyear" { //近三年
+		starttime := fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+		endtime := fmt.Sprint(now.Unix())
+		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
+	} else if this.Publishtime == "fiveyear" { //近五年
+		starttime := fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+		endtime := fmt.Sprint(now.Unix())
+		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
+	}
+	returnData = map[string]interface{}{
+		"keywords":     KeyWordSave,
+		"publishtime":  publishtimeSave,
+		"area":         areaSave,
+		"city":         citySave,
+		"subtype":      this.Subtype,
+		"minprice":     this.Minprice,
+		"maxprice":     this.Maxprice,
+		"industry":     industrySave,
+		"selectType":   this.SelectType,
+		"buyerclass":   buyerclassSave,
+		"winner":       winnerSave,
+		"hasBuyertel":  this.Hasbuyertel,
+		"hasWinnertel": this.Haswinnertel,
+		"fileExists":   this.FileExists,
+		"comeintime":   now.Unix(),
+		"bid_field":    this.BidField,
+		"searchGroup":  this.SearchGroup,
+		"searchMode":   this.SearchMode,
+		"wordsMode":    this.WordsMode,
+	}
+	//选择信息id
+	if this.SelectIds != "" {
+		ids := []string{}
+		for _, encodeId := range strings.Split(this.SelectIds, ",") {
+			if tmp := encrypt.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
+				if id := tmp[0]; id != "" {
+					ids = append(ids, id)
+				}
+			}
+		}
+		if len(ids) > 0 {
+			returnData["selectIds"] = ids
+		}
+	}
+	return returnData
+}

+ 465 - 35
src/web/staticres/css/dev2/biddingSearch.css

@@ -15,15 +15,16 @@
 /*白色字体*/
 #searchInner .searchHeader {
   /*头部*/
+  margin-top: 24px;
   /* height: 110px; */
-  background-color: #f5f5fb;
-  border-top: 1px solid #e0e0e0;
+  /* background-color: #f5f5fb; */
+  /* border-top: 1px solid #e0e0e0; */
 }
 
 #searchInner .searchHeader .searchHeader-container {
   height: inherit;
   box-sizing: border-box;
-  padding: 24px 0 24px 110px;
+  /* padding: 24px 0 24px 110px; */
 }
 
 #searchInner .searchHeader .searchHeader-container .control-tabBtn {
@@ -87,43 +88,54 @@
 
 #searchInner .searchHeader .searchHeader-container .searchInput {
   /*搜索框*/
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+#searchInner .searchHeader .searchHeader-container .searchInput .searchInput-left{
+  display: flex;
+  align-items: center;
+  flex: 1;
 }
 
 #searchInner .searchHeader .searchHeader-container .searchInput form {
   float: left;
   position: relative;
+  margin-top: 4px;
+  flex-shrink: 0;
 }
 
 #searchInner .searchHeader .searchHeader-container .searchInput form input[type='search'] {
   float: left;
-  width: 540px;
-  height: 42px;
+  width: 448px;
+  height: 36px;
   box-sizing: border-box;
-  padding-left: 58px;
+  padding-left: 34px;
   padding-right:45px;
-  background: #fff url("/images/biddingSearch/search-icon1.png") 18px center no-repeat;
+  background: #fff url("/images/biddingSearch/bidding-search.png") 10px center no-repeat;
   border: 2px solid #2cb7ca;
   font-size: 14px;
-	border-top-left-radius: 4px;
-    border-bottom-left-radius: 4px;
+	border-top-left-radius: 8px;
+  border-bottom-left-radius: 8px;
+  background-size: 20px 20px;
 }
 
 
-@media only screen and (max-width:1440px),only screen and (max-device-width:1440px){
+/* @media only screen and (max-width:1440px),only screen and (max-device-width:1440px){
   #searchInner .searchHeader .searchHeader-container .searchInput form input[type='search'] {
     width: 500px;
   }
-}
+} */
 
 
 #searchInner .searchHeader .searchHeader-container .searchInput form input[type='submit'] {
   float: left;
-  width: 100px;
-  height: 42px;
+  width: 80px;
+  height: 36px;
   color: #ffffff;
   background-color: #2cb7ca;
   text-align: center;
-  font-size: 18px;
+  font-size: 16px;
   border: 2px solid #2cb7ca;
   border-left: none;
   cursor: pointer;
@@ -131,17 +143,17 @@
 
 #searchInner .searchHeader .searchHeader-container .searchInput form input[type='button'] {
   float: left;
-  width: 100px;
-  height: 42px;
+  width: 80px;
+  height: 36px;
   color: #ffffff;
   background-color: #2cb7ca;
   text-align: center;
-  font-size: 18px;
+  font-size: 16px;
   border: 2px solid #2cb7ca;
   border-left: none;
   cursor: pointer;
-    border-top-right-radius: 4px;
-    border-bottom-right-radius: 4px;
+    border-top-right-radius: 8px;
+    border-bottom-right-radius: 8px;
 }
 
 #searchInner .searchHeader .searchHeader-container .searchInput form .searchSlideText {
@@ -378,7 +390,7 @@ margin-left: 176px;
 
 #searchInner .searchControl .searchTender .leftTitle {
   float: left;
-  width: 94px;
+  width: 98px;
   text-align: right;
   color: #686868;
   padding: 4px 15px 4px 0px;
@@ -629,7 +641,7 @@ border-radius:2px;
   vertical-align: middle;
   margin-top: 2px;
   margin-right: 10px;
-  margin-left: 8px !important;
+  margin-left: 2px !important;
 }
 
 #searchInner .searchControl .searchTender .information .info-content span {
@@ -704,7 +716,7 @@ border-radius:2px;
 
 #searchInner .searchControl .seaTender-inner .tabTitle {
   line-height: 46px;
-  border: 1px solid #e0e0e0;
+  border-bottom: 1px solid #e0e0e0;
 /*  background-color: #f5f4f9;*/
 }
 
@@ -748,6 +760,7 @@ position: absolute;
   background-color: transparent;
   font-size:14px;
   display:flex;
+  justify-content: flex-end;
 }
 #searchInner .right-tabBtn-superSearch{
   width: 265px;
@@ -765,12 +778,13 @@ position: absolute;
   border-radius: 2px;
   background-color: transparent;
   cursor: pointer;
+  flex-shrink: 0;
 }
 
 #searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(1) {
+  width: 100px!important;
   background: transparent url("/images/biddingSearch/tab-icon4.png") 10px center no-repeat;
   background-size: 16px 14px;
-/*margin-right:20px;*/
 }
 
 #searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(1).active {
@@ -780,20 +794,45 @@ position: absolute;
 }
 
 #searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(2) {
+  width: 100px!important;
+  background: transparent url("/images/biddingSearch/tab-icon5.png") 10px center no-repeat;
+  background-size: 20px 20px;
+}
+
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(2).active {
+  background: #fff url("/images/biddingSearch/tab-icon6.png") 10px center no-repeat;
+  color: #2cb7ca;
+  background-size: 20px 20px;
+}
+
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(3) {
   background: transparent url("/images/biddingSearch/tab-icon2.png") 10px center no-repeat;
   background-size: 16px 14px;
 }
 
-#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(2).active {
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(3).active {
   background: #fff url("/images/biddingSearch/tab-icon1.png") 10px center no-repeat;
   color: #2cb7ca;
   background-size: 16px 14px;
 }
 
-#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(3) {
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(4) {
   background: transparent url("/images/biddingSearch/icons-export.png") 10px center no-repeat;
   background-size: 18px 16px;
 }
+#searchInner .tab-detail-list{
+  position: relative;
+}
+#searchInner .tab-detail-list::after{
+  position: absolute;
+  content: '';
+  top: -8px;
+  right: -4px;
+  width: 32px;
+  height: 14px;
+  background: url('/images/biddingSearch/VIP.png') no-repeat right center;
+  background-size: contain;
+}
 
 #right-export{
 	width: 100px !important;
@@ -822,7 +861,7 @@ position: absolute;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li {
-  padding: 15px 0px 0;
+  /* padding: 15px 0px 0; */
   overflow: hidden;
   font-size: 16px;
 }
@@ -830,8 +869,9 @@ position: absolute;
   background-color: #F5F6F7;
   box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
 }
+
 #searchInner .searchControl .seaTender-inner .tabContainer-2 .lucene li {
-  padding: 15px 0px 0px;
+  /* padding: 15px 0px 0px; */
   overflow: hidden;
   font-size: 16px;
 }
@@ -847,12 +887,12 @@ position: absolute;
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .liLuceneList {
   border-bottom: 1px solid #EBEBEB;
   overflow: hidden;
-  padding:0px 15px 15px;
-width:1200px;
+  width:1200px;
+  padding: 16px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer-2 .lucene li .liLuceneList {
-	padding: 0px 15px 0;
+	/* padding: 0px 15px 0; */
 }
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-left {
   float: left;
@@ -917,9 +957,9 @@ width:1200px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field{
-  float: left;
+  /* float: left;
   margin: 0 0 10px 22px;
-  width: calc(100% - 34px);
+  width: calc(100% - 34px); */
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field .nowrap{
@@ -945,7 +985,7 @@ width:1200px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field>div{
-  padding-bottom: 10px;
+  /* padding-bottom: 10px; */
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field>div:nth-child(1){
@@ -962,7 +1002,7 @@ width:1200px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field>div:last-child{
-  padding-bottom: 8px;
+  /* padding-bottom: 8px; */
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-right a {
@@ -1266,7 +1306,7 @@ width:1200px;
 .haveFile{
   padding: 0px 8px;
   margin: 4px 0 0 15px;
-  width: 52px;
+  /* width: 52px; */
   height: 20px;
   border-radius: 4px;
   border: 1px solid #2CB7CA;
@@ -1275,3 +1315,393 @@ width:1200px;
   color: #2CB7CA;
   line-height: 18px;
 }
+.search-tabs{
+  padding: 0 16px;
+  border-bottom: 1px solid #ECECEC;
+}
+.search-tabs .search-tab-item{
+  display: inline-block;
+  height: 48px;
+  padding: 12px 16px 10px;
+  font-size: 16px;
+  line-height: 24px;
+  color: #686868;
+  cursor: pointer;
+}
+.search-tabs .search-tab-item.tab-active{
+  position: relative;
+  color: #2CB7CA;
+}
+.search-tabs .search-tab-item.tab-active::after{
+  position: absolute;
+  content: '';
+  bottom: 0;
+  left: 50%;
+  width: 32px;
+  height: 2px;
+  transform: translateX(-50%);
+  background: #2CB7CA;
+}
+.search-tabs .search-tab-item.badge-recommend{
+  position: relative;
+}
+.search-tabs .search-tab-item.badge-recommend::before{
+  position: absolute;
+  content: '推荐';
+  top: 0;
+  right: -8px;
+  width: 36px;
+  height: 16px;
+  line-height: 16px;
+  text-align: center;
+  background: #FF3A20;
+  border-radius: 10px 10px 10px 0;
+  color: #fff;
+  font-size: 12px;
+}
+.in-iframe[data-page-name=supsearch] #searchInner .searchHeader .searchHeader-container{
+  padding-right: 0;
+}
+.searchInput{
+  padding: 16px 24px 16px 32px;
+}
+.search-type{
+  position: relative;
+  margin-left: 16px;
+  color: #2CB7CA;
+  font-size: 14px;
+  line-height: 22px;
+  cursor: pointer;
+  flex-shrink: 0;
+}
+.search-type .icon-caret-top-gold,
+.search-type .icon-caret-bottom-gold
+{
+  display: inline-block;
+  width: 16px;
+  height: 16px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+.search-type .icon-caret-top-gold {
+  background: url('/images/biddingSearch/icon-caret-top-gold.png') no-repeat center;
+  background-size: contain;
+}
+.search-type .icon-caret-bottom-gold {
+  background: url('/images/biddingSearch/icon-caret-bottom-gold.png') no-repeat center;
+  background-size: contain;
+}
+.search-type .search-type-dialog{
+  position: absolute;
+  bottom: -70px;
+  left: 50%;
+  width: 104px;
+  padding: 4px 0;
+  border: 1px solid #2CB7CA;
+  border-radius: 4px;
+  transform: translateX(-50%);
+  overflow: hidden;
+  z-index: 9;
+}
+.search-type .s-t-d-item{
+  padding: 4px 16px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #1D1D1D;
+  background: #fff;
+}
+.search-type .s-t-d-item.selected,
+.search-type .s-t-d-item:hover{
+  background: #ECECEC;
+}
+.checkbox-keyword{
+  margin-left: 16px;
+  flex-shrink: 0;
+}
+.checkbox-keyword .search-list-checkbox{
+  padding-left: 20px;
+  cursor: pointer;
+  background: url(/images/biddingSearch/icon-checkbox.png) no-repeat center left;
+  background-size: 14px 14px;
+  border: 0;
+  font-size: 14px;
+  vertical-align: middle;
+}
+.checkbox-keyword .search-list-checkbox.checkbox-checked{
+  background: url(/images/biddingSearch/icon-checked.png) no-repeat center left;
+  background-size: 14px 14px;
+}
+.tooltip-help-class{
+  width: 360px;
+  padding: 16px!important;
+  background: rgba(0, 0, 0, 0.75)!important;
+  border-radius: 4px!important;
+}
+.el-tooltip__popper .popper__arrow{
+  opacity: 0.85!important;
+}
+.tooltip-help-btn{
+  width: 15px;
+  height: 15px;
+  margin: 0 4px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+.tooltip-slot-content{
+  text-align: justify;
+  font-size: 12px;
+  line-height: 18px;
+}
+.add-keyword-input{
+  width: auto!important;
+}
+.add-keyword-input > .el-input__inner{
+  width: 280px;
+  height: 30px;
+  line-height: 30px;
+  border: 1px solid #E0E0E0;
+  border-radius: 4px;
+}
+.keyword-input-container{
+  display: flex;
+  align-items: center;
+  padding: 0 32px 24px;
+  flex-wrap: wrap;
+}
+.add-keyword-container{
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+.add-keyword-btn{
+  margin-left: 8px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #999999;
+  cursor: pointer;
+}
+.add-keyword-btn.focus{
+  color: #2CB7CA;
+}
+.add-keyword-tags{
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+.add-keyword-tags .el-tag{
+  margin-top: 6px;
+  height: 24px;
+  line-height: 22px;
+  padding: 0 8px;
+  background: #F5F6F7;
+  border: 1px solid #ECECEC;
+  border-radius: 4px;
+  margin-right: 8px;
+  color: #1D1D1D;
+  font-size: 14px;
+}
+.add-keyword-tags .el-tag .el-tag__close{
+  color: #AAAAAA;
+}
+.add-keyword-tags .el-tag:hover{
+  color: #2CB7CA;
+  border: 1px solid #2ABED1;
+  background: #fff;
+}
+.add-keyword-tags .el-tag:hover .el-tag__close{
+  background-color: transparent;
+  color: #2CB7CA;
+}
+.keyword-radio-group {
+  margin-left: 16px;
+  margin-top: 6px;
+  display: flex!important;
+}
+.keyword-radio-group .el-radio__label{
+  padding-left: 6px;
+}
+.keyword-radio-group  .el-radio{
+  display: flex;
+  align-items: center;
+  margin-right: 8px;
+}
+.keyword-radio-group .el-radio__input.is-checked+.el-radio__label{
+  color: #686868;
+}
+/* 标讯列表新样式 */
+.liLuceneList {
+  display: flex;
+}
+.liLuceneList .custom-checkbox{
+  float: none;
+  flex-shrink: 0;
+}
+.liLuceneList .list-container{
+  padding-left: 16px;
+  flex: 1;
+  width: calc(100% - 32px);
+}
+.liLuceneList .bid-list-title{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.liLuceneList .list-title-flex {
+  display: flex;
+}
+.liLuceneList .list-title-flex > a{
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  margin-right: 60px!important;
+}
+.liLuceneList .list-title-flex .visited-hd{
+  margin-right: 8px;
+  font-size: 16px;
+  line-height: 24px;
+  color: #1D1D1D;
+  text-decoration: none;
+}
+.liLuceneList .bid-list-title .com-time{
+  color: #999999;
+  font-size: 12px;
+  line-height: 18px;
+  flex-shrink: 0;
+}
+#searchInner .searchControl .seaTender-inner .tabContainer .lucene li:hover .list-title-flex > a,
+#searchInner .searchControl .seaTender-inner .tabContainer .lucene li:hover .list-title-flex > em
+{
+  /* color: #2CB7CA!important; */
+}
+.liLuceneList .bid-list-content {
+  padding: 8px 120px 0 0;
+  font-size: 14px;
+  line-height: 22px;
+  color: #686868;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  text-align: justify
+}
+.liLuceneList .bid-list-tags{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: 8px;
+}
+.liLuceneList .bid-list-tags .tags-item{
+  display: inline-block;
+  padding: 1px 8px;
+  line-height: 18px;
+  font-size: 12px;
+  border-radius: 4px;
+  margin-right: 8px;
+  background: #F5F5FB;
+  color: #686868;
+  box-sizing: border-box;
+  border: 1px solid #ECECEC;
+}
+.liLuceneList .bid-list-tags .tags-item.tags-publish{
+  color: #FF3A20;
+  background: rgba(254, 115, 122, 0.16);
+}
+.liLuceneList .tags-item.tags-file{
+  color: #2CB7CA;
+  background: #fff;
+  border: 1px solid #2CB7CA;
+}
+.liLuceneList .bid-list-tags .icon-collect{
+  position: relative;
+  width: 54px;
+  background-size: 20px 20px;
+  background-position: left center;
+}
+.liLuceneList .bid-list-tags .icon-collect::after{
+  position: absolute;
+  content: '收藏';
+  left: 24px;
+  width: 32px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #1D1D1D;
+}
+.liLuceneList .bid-list-tags .icon-collect.checked{
+  width: 68px;
+}
+.liLuceneList .bid-list-tags .icon-collect.checked::after{
+  position: absolute;
+  content: '已收藏';
+  left: 24px;
+  width: 48px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #1D1D1D;
+}
+.liLuceneList  .luce-field{
+  margin-top: 16px;
+}
+/* .liLuceneList .bid-detail-info{
+  padding-top: 8px;
+} */
+.liLuceneList .bid-detail-info .d-i-item{
+  margin-top: 8px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #686868;
+}
+.liLuceneList .bid-detail-info .d-i-item:nth-child(1) {
+  margin-top: 16px;
+}
+.liLuceneList .bid-detail-info .d-i-item > span{
+  margin-right: 32px;
+  color: #1d1d1d;
+}
+.liLuceneList .bid-detail-info .d-i-item-label{
+  color: #686868;
+}
+.highlight-text{
+  color: #2cb7ca !important;
+  cursor: pointer;
+}
+.highlight-text:hover,
+.highlight-text:active,
+.highlight-text:focus
+{
+  text-decoration: none;
+}
+.over-run-tips{
+  position: absolute;
+  top: 30px;
+  right: 20px;
+  color: #686868;
+  text-align: right;
+  font-size: 14px;
+  line-height: 22px;
+}
+.notkey-component .el-input.is-disabled .el-input__inner{
+  cursor: text!important;
+  background-color: #fff;
+}
+.q-mark-buyer{
+  width: 16px;
+  height: 16px;
+}
+.change-search-input{
+  padding: 16px 24px 10px 32px;
+}
+/* 未登录页面样式调整为与嵌入页面一样 */
+body{
+  background: #f2f2f4;
+}
+#searchInner .searchControl .searchTender,
+#searchInner .searchHeader-container,
+#searchInner .filter-header{
+  background: #fff;
+}
+#searchInner .searchHeader-container,
+#searchInner .searchControl .searchTender{
+  border-radius: 8px;
+}
+#searchInner .searchControl .searchTender{
+  border: 0;
+}

+ 21 - 1
src/web/staticres/css/dev2/newBidSearch.css

@@ -168,14 +168,27 @@
   border: 1px solid #E0E0E0;
   border-radius: 3px;
   background-color: #fff;
-  margin: 8px 16px 0 0!important;
+  margin: 4px 0 0 0!important;
 }
 .all-text-checkbox{
   margin: 4px 16px 0 0!important;
 }
 .check-all{
+  position: relative;
   margin: 16px 0 0 15px!important;
 }
+.check-all.custom-checkbox:checked::before,
+.check-all::before{
+  position: absolute;
+  content: '全选';
+  left: 28px;
+  width: 40px;
+  height: 24px;
+  top: 50%;
+  transform: translateY(-50%);
+  z-index: 9;
+  font-size: 16px;
+}
 .custom-checkbox:checked{
   width: 14px;
   height: 14px;
@@ -186,6 +199,13 @@
 .custom-checkbox:checked:disabled{
   opacity: 0.5;
 }
+.tab-bid-count{
+  float: left;
+  margin: 12px 0 0 60px;
+  font-size: 14px;
+  color: #686868;
+  line-height: 22px;
+}
 #bid-collect{
   width: 100px!important;
   background: transparent url(/images/collect.png) 10px center no-repeat;

+ 5 - 1
src/web/staticres/css/dev2/superSearch-inside.css

@@ -145,6 +145,8 @@
 	        transform: scale(1.2);
 }
 .j-clearicon{
+  width: 18px;
+  height: 18px;
 	right:118px !important;
 }
 .lucene-table tr{
@@ -274,12 +276,14 @@
   color: #999!important;
 }
 .publish-button {
-  margin-left: 40px;
+  margin-left: 24px;
 }
 .publish-button .el-button--primary {
   background-color: #2cb7ca;
   border-color: #2cb7ca;
   color: #fff;
+  padding: 10px 24px!important;
+  border-radius: 8px;
 }
 .publish-button .el-badge__content {
   padding: 0 6px;

+ 26 - 8
src/web/staticres/css/dev2/superSearch.css

@@ -133,16 +133,16 @@
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding: 0 16px 0 30px;
+  padding: 0 16px 0 22px;
   margin: 0 -15px;
   height: 50px;
   line-height: 50px;
   background: #F5F5FB;
-  border: 1px solid #ECECEC;
+  border-bottom: 1px solid #ECECEC;
 }
 .filter-header .f-h-label{
   width: 100px;
-  padding-left: 16px;
+  padding-left: 10px;
   background-repeat: no-repeat;
   background-position: right center;
   background-size: 16px 16px;
@@ -166,7 +166,7 @@
   align-items: center;
 }
 .filter-header .f-h-action .action-item{
-  min-width: 90px;
+  padding: 0 10px;
   height: 30px;
   line-height: 30px;
   border-radius: 4px;
@@ -219,6 +219,8 @@
   padding: 0 0 32px!important;
 }
 .has-filter-dialog > .el-dialog__body{
+  width: 686px;
+  overflow: hidden;
   padding: 0!important;
 }
 .has-filter-dialog .el-dialog__headerbtn{
@@ -242,6 +244,7 @@
   flex: 1;
   color: #1D1D1D;
   text-align: left;
+  font-size: 12px;
 }
 .filter-save-item .save-value-bg{
   margin-bottom: 8px;
@@ -256,6 +259,12 @@
 .filter-save-item .save-value-bg > span{
   color: #636467;
 }
+.filter-save-item .search_model{
+  margin-top: 4px;
+  font-size: 12px;
+  line-height: 18px;
+  color: #686868;
+}
 .filter-dialog .btn-group,
 .filter-messagebox .btn-group{
   width: 132px;
@@ -280,10 +289,14 @@
 .filter-data-container{
   max-height: 400px;
   overflow-y: scroll;
+  width: 694px;
 }
 .filter-dialog ::-webkit-scrollbar {
   /*滚动条整体样式*/
-  width: 0px!important;
+  width: 8px!important;
+}
+.filter-data-container {
+  scrollbar-width: thin
 }
 .filter-data-container .filter-data-list{
   margin-top: 12px;
@@ -292,7 +305,7 @@
   border-radius: 4px;
 }
 .filter-data-container  .f-l-title{
-  padding: 8px 0;
+  padding: 8px 0 2px;
 }
 .filter-data-container .f-l-content {
   padding: 12px 0;
@@ -328,19 +341,24 @@
   cursor: pointer;
   background-size: contain;
 }
+.filter-data-list .has-search-model{
+  padding:0 0 8px 22px;
+  font-size: 12px;
+  line-height: 18px;
+}
 .filter-data-list .f-l-title{
   display: flex;
   align-items: center;
   justify-content: space-between;
   cursor: pointer;
   font-size: 14px;
-  min-height: 38px;
+  min-height: 22px;
   color: #1D1D1D;
 }
 .filter-data-list .f-l-title .f-l-title-text{
   flex: 1;
   text-align: justify;
-  font-size: 12px;
+  font-size: 14px;
   line-height: 22px;
   max-width: 582px;
 }

+ 29 - 20
src/web/staticres/css/pc/index.css

@@ -65,13 +65,9 @@
   display: flex;
   align-items: center;
   justify-content: space-between;
-  width: 1200px;
-  height: 80px;
-  margin: auto;
-  border-radius: 8px;
-  border: 1px solid #2CB7CA;
-  margin-top: 20px;
-  padding: 0 16px;
+  width: 960px;
+  height: 24px;
+  margin: 24px auto 0;
 }
 .jy-index .noActive {
   margin-top: 56px;
@@ -81,6 +77,11 @@
   flex-direction: initial;
   align-items: center;
 }
+.jy-index .list-msg .l-msg .words .icon_voice{
+  margin-right: 4px;
+  width: 24px;
+  height: 24px;
+}
 .jy-index .list-msg .l-msg .words:nth-child(2) {
   margin-top: 8px;
 }
@@ -98,14 +99,14 @@
 }
 .jy-index .list-msg .l-msg .words h3 {
   font-size: 16px;
-  font-weight: bold;
-  color: #2CB7CA;
+  font-weight: 400;
+  color: #1D1D1D;
   line-height: 24px;
 }
 .jy-index .list-msg .l-msg .words span {
   font-size: 14px;
   color: #1D1D1D;
-  line-height: 22px;
+  line-height: 24px;
   margin: 0 16px;
 }
 .jy-index .list-msg .l-msg .words span:hover {
@@ -115,7 +116,7 @@
 .jy-index .list-msg .l-msg .words p {
   font-size: 12px;
   color: #999999;
-  line-height: 18px;
+  line-height: 24px;
 }
 .jy-index .list-msg .l-msg .words .isActive {
   margin-left: 15px;
@@ -139,7 +140,7 @@
   object-fit: cover;
 }
 .jy-index-banner .custom-dot {
-  bottom: 48px;
+  bottom: 28px;
 }
 .jy-index-banner .custom-dot .swiper-pagination-bullet{
   width: 40px;
@@ -148,6 +149,14 @@
   background: rgba(0, 0, 0, 0.2);
   border-radius: 10px;
   cursor: pointer;
+  opacity: 1;
+}
+.jy-index-banner .custom-dot.light-swiper-bg-light-color .swiper-pagination-bullet {
+  background: rgba(255, 255, 255, 0.32);
+  opacity: 1;
+}
+.jy-index-banner .custom-dot.light-swiper-bg-light-color .swiper-pagination-bullet-active {
+  background: #fff
 }
 .jy-index-banner .custom-dot .swiper-pagination-bullet-active{
   background: #2CB7CA;
@@ -159,7 +168,7 @@
 .jy-index-search{
   position: relative;
   width: 1200px;
-  margin: -20px auto 0;
+  margin: 32px auto 0;
   background: transparent;
   z-index: 1;
 }
@@ -167,12 +176,12 @@
   position: relative;
   display: flex;
   align-items: center;
-  width: 856px;
+  width: 960px;
   margin: 0 auto;
 }
 
 .jy-index-search .search{
-  width: 856px;
+  width: 960px;
   position: relative;
   text-align: center;
   position: relative;
@@ -180,10 +189,10 @@
 }
 
 .jy-index-search .ser {
-  width: 788px;
+  width: 888px;
   height: 48px;
   padding: 0 24px;
-  border: 1px solid #2ABED1;
+  border: 2px solid #2ABED1;
   border-radius: 8px 0 0 8px;
   color: #1d1d1d;
   box-sizing: border-box;
@@ -260,7 +269,7 @@
 .jy-index-search .tips{
   display: inline-block;
   /* width: 620px; */
-  margin-top: 8px;
+  /* margin-top: 8px; */
   text-align: left;
   font-size: 14px;
   line-height: 22px;
@@ -269,7 +278,7 @@
 }
 .jy-index-search .tips i{
   position: absolute;
-  top: 4px;
+  top: 41px;
   left: 58px;
   display: inline-block;
   width: 14px;
@@ -324,7 +333,7 @@
 
 /* 热点事件 */
 .jy-index-hot{
-  margin-top: 32px;
+  margin-top: 48px;
 }
 .jy-index-hot > .hot-container{
   display: flex;

二进制
src/web/staticres/images/biddingSearch/bidding-search.png


二进制
src/web/staticres/images/biddingSearch/tab-icon5.png


二进制
src/web/staticres/images/biddingSearch/tab-icon6.png


二进制
src/web/staticres/images/pc/icon_voice.png


+ 181 - 4
src/web/staticres/js/common.js

@@ -361,7 +361,7 @@ function keyWordHighlight (value, oldChars, newChar) {
   lastArr = lastArr.sort(function (a, b) {
     return b.length - a.length
   })
-  
+
   if (notStrReplacer.length) {
     for (var j = 0; j < notStrReplacer.length; j++) {
       // 正则替换
@@ -371,7 +371,7 @@ function keyWordHighlight (value, oldChars, newChar) {
   if (lastArr.length) {
     value = value.replace(new RegExp('(' + lastArr.join('|') + ')', 'gmi'), newChar)
   }
-  
+
   return value
 }
 function getWxVersion(){
@@ -845,7 +845,7 @@ function isElementVisible (el) {
 	var rect = el.getBoundingClientRect()
 	var vWidth = window.innerWidth || document.documentElement.clientWidth
 	var vHeight = window.innerHeight || document.documentElement.clientHeight
-  
+
 	if (
 	  rect.right < 0 ||
 	  rect.bottom < 0 ||
@@ -854,6 +854,183 @@ function isElementVisible (el) {
 	) {
 	  return false
 	}
-  
+
 	return true
 }
+
+/**
+ * 适用于快速集成不同搜索页面与顶部导航搜索模块的通信
+ * 1. 监听容器 scroll 事件,更新顶部搜索可见状态
+ * 2. 监听容器 input 事件,更新顶部搜索 input 值
+ * 3. 监听顶部搜索 change 事件,更新页面 input 值
+ * 4. 监听顶部搜索 submit 事件,执行传递的页面 submit 函数
+ * 5. 监听 window.onbeforeunload 事件,销毁上述事件监听
+ * 6. 返回 { off: fn, syncInput: fn } 提供手动 off 函数,用于手动销毁上述事件监听, syncInput 用于手动触发同步 input
+ * 7. 初始化时自动触发 change, scroll 事件更新状态
+ *
+ * // 对应支持的搜索类型
+ * types: [
+ *   {
+ *     label: '招标采购搜索',
+ *     key: 'bidding',
+ *   },
+ *   {
+ *     label: '企业搜索',
+ *     key: 'company'
+ *   },
+ *   {
+ *     label: '采购单位搜索',
+ *     key: 'buyer'
+ *   },
+ *   {
+ *     label: '供应搜索',
+ *     key: 'supplier'
+ *   }
+ * ]
+ * @param config
+ * @param config.el - 当前页面 input 搜索框的父容器
+ * @param config.type - 当前页面搜索类型, 对应 key 见上方类型
+ * @param config.submit - 用于实现当前页面搜索事件函数
+ * @param config.change - 用于实现当前页面输入框值改变事件回调函数,vue页面需要使用该函数更新 v-model 值
+ * @param config.inputSelector - 用于实现当前页面搜索 input 输入框选择器特殊处理,默认 input
+ * @param config.submitSelector - 用于实现当前页面搜索提交按钮选择器特殊处理,默认 button
+ * @returns {{off: fn, syncInput: fn}}
+ */
+function initSearchPageEvent (config) {
+  // el 对应容器 submit 自定义提交函数
+  var el = config.el
+  var inputSelector = config.inputSelector || 'input'
+  var submitSelector = config.submitSelector || 'button'
+  // 默认提交函数处理,仅处理相同 type
+  var searchType = config.type || ''
+  var submit = function (item, next) {
+    if (item.params.type === searchType) {
+      return triggerFormSubmit()
+    } else {
+      return next(item)
+    }
+  }
+  if (typeof config.submit === 'function') {
+    submit = config.submit
+  }
+
+  // 需要的工具函数集
+
+  /**
+   * 触发原表单提交按钮点击事件
+   */
+  function triggerFormSubmit () {
+    $(el).find(submitSelector).trigger('click')
+  }
+
+  /**
+   * 返回当前容器可见状态
+   * @returns {boolean}
+   */
+  function getElementVisible () {
+    if (!$(el).get(0)) return false
+    var elRect = $(el).get(0).getBoundingClientRect()
+    var headerTop = 0
+    if ($("#public-nav").is(':visible')) {
+      headerTop = $("#public-nav").height() || 0
+    }
+    return (elRect.top + elRect.height - headerTop) >= 0
+  }
+
+  /**
+   * 检查并更新顶部搜索模块可见状态
+   */
+  function checkShowSearchModule () {
+    if (window.$BRACE && typeof window.$BRACE.$emit === 'function') {
+      window.$BRACE.$emit('nav-search', {
+        type: 'change',
+        params: {
+          show: !getElementVisible()
+        }
+      })
+    }
+  }
+
+  /**
+   * 监听输入值更新并通知顶部搜索模块更新
+   * @param e
+   */
+  function onChangeInput (e) {
+    var nowInput = e.target.value
+    if (window.$BRACE && typeof window.$BRACE.$emit === 'function') {
+      window.$BRACE.$emit('nav-search', {
+        type: 'change',
+        from: 'page',
+        params: {
+          input: nowInput,
+          type: searchType
+        }
+      })
+    }
+  }
+
+  /**
+   * 监听顶部导航搜索模块输入值 change 事件,同步页面 input
+   * @param data
+   */
+  function onListenNavbarSearchChange (data) {
+    if (data.from === 'nav-search' && data.type === 'change') {
+      if (data.params.input !== $(inputEl).val()) {
+        $(inputEl).val(data.params.input)
+        if (typeof config.change === 'function') {
+          config.change(data.params.input)
+        }
+      }
+    }
+  }
+
+  // 绑定滚动事件,切换顶部搜索模块展示
+  $(window).on('scroll', checkShowSearchModule)
+  checkShowSearchModule()
+
+  // 绑定输入事件,通过钩子更新同步搜索 input 值
+  var inputEl = $(el).find(inputSelector)
+  $(inputEl).on('input', onChangeInput)
+  $(inputEl).trigger('input')
+
+  // 绑定提交事件,接手 submit 提交事件
+  if (typeof submit === 'function') {
+    if (window.$BRACE && typeof window.$BRACE.$on === 'function') {
+      window.$BRACE.$on('nav-search-submit', submit)
+    }
+  }
+  // 监听顶部导航搜索模块输入值 change 事件,同步页面 input
+  try {
+    window.$BRACE.$on('nav-search', onListenNavbarSearchChange)
+  } catch (e) {
+    console.warn(e)
+  }
+
+  // 解绑提交事件
+  function offEvent () {
+    $(window).off('scroll', checkShowSearchModule)
+    $(inputEl).off('input', onChangeInput)
+    try {
+      window.$BRACE.$off('nav-search-submit', submit)
+      window.$BRACE.$off('nav-search', onListenNavbarSearchChange)
+    } catch (e) {
+      console.warn(e)
+    }
+  }
+
+  window.onbeforeunload = function () {
+    offEvent()
+  }
+
+  return {
+    off: function () {
+      offEvent()
+    },
+    syncInput: function (val) {
+      if (typeof val === 'string') {
+        $(inputEl).val(val)
+      }
+      $(inputEl).trigger('input')
+    }
+  }
+}

+ 25 - 4
src/web/staticres/js/ent-search-index-pc.js

@@ -175,7 +175,7 @@ var vm = new Vue({
                 entClass: '', // 单位类型
                 entContact: '', // 联系方式
                 establish:[],//成立时间
-                
+
             },
             listState: {
                 loaded: false, // 是否已经搜索过
@@ -288,6 +288,20 @@ var vm = new Vue({
         // 全选按钮逻辑
         // this.searchTypeChange([], true)
         this.industryTab()
+        /**
+         * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+         * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+         */
+        if (goTemplateData.inIframe) {
+          this._$SearchEvent = initSearchPageEvent({
+            type: 'company',
+            el: '.search-header-top .input-container',
+            submitSelector: '.search-button',
+            change: (val) => {
+              this.searchContent = val
+            }
+          })
+        }
     },
     methods: {
         industryTab: function() {
@@ -486,7 +500,7 @@ var vm = new Vue({
                             // thisList.push(_this.getTimeDate(10)+'-'+_this.getTimeDate(1))
                             thisList.push('10y-')
                             break;
-                    
+
                         default:
                             break;
                     }
@@ -543,7 +557,7 @@ var vm = new Vue({
                     this.endDate = this.getThisDate(e);
                 }
             }
-            
+
         },
         //成立时间自定义区间搜索按钮
         establishSearch:function () {
@@ -664,6 +678,13 @@ var vm = new Vue({
             Object.assign(this.listState, state)
         },
         getPreSearchList: utils.debounce(function () {
+            /**
+             * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+             * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+             */
+            if (this._$SearchEvent) {
+              this._$SearchEvent.syncInput()
+            }
             var data = {
                 name: this.searchContent.trim()
             }
@@ -980,4 +1001,4 @@ function baiduEvent(name) {
   } catch (e) {
     console.log('未初始化百度统计')
   }
-}
+}

+ 8 - 3
src/web/staticres/js/login.js

@@ -337,6 +337,7 @@ function checkBigStatus () {
         window.entniche = res.data.entniche // 商机管理用户
         window.fileNum = res.data.fileNum // 超级订阅用户可下载附件次数
         window.isLogin = true // 用于其他页面判断是否已登录
+        window.isNewEntNiche = res.data.entIsNew
         sessionStorage.setItem('bidPower', JSON.stringify(res.data.power))
         if (res.data.memberStatus > 0) {
           $(".myorderDiv.lastBox").show()
@@ -493,15 +494,19 @@ var logic = function(data,num){
       phone: '',
       avatar: data.s_headimage || ''
     })
+    if (typeof window.GuideIntroDialog === 'function') {
+      window.guideIntroDialog = new GuideIntroDialog()
+    }
     try{
       checkBigStatus()
       infoListCss();
       message.init()
       checkCounts()
-      initIndexMsgList()
-      window.guideIntroDialog = new GuideIntroDialog()
+      if (typeof window.initIndexMsgList === 'function') {
+        initIndexMsgList()
+      }
 		} catch (e) {
-      console.error(e)
+      console.warn(e)
     }
 	}
 }

+ 1 - 1
src/web/staticres/js/pc-message-index.js

@@ -1,4 +1,4 @@
-var temp = '<div class="list-msg" v-if="lists.length"><div class="l-msg"><div class="words" v-for="item in lists" :key="item.id"><i v-show="item.isRead == 0"></i><h3 :class="{isActive: item.isRead == 1}">@@item.msg_type@@</h3><span @click="titleGoto(item)">@@item.title@@</span><p>@@item.createtime@@</p></div></div><img @click="gotoUrl" class="r-msg" src="/images/pc/msg-arrow.png"></div>'
+var temp = '<div class="list-msg" v-if="lists.length"><div class="l-msg"><div class="words" v-for="item in lists" :key="item.id"><img class="icon_voice" src="/images/pc/icon_voice.png" v-show="item.isRead == 0" /><h3 :class="{isActive: item.isRead == 1}">@@item.msg_type@@</h3><span @click="titleGoto(item)">@@item.title@@</span><p>@@item.createtime@@</p></div></div></div>'
 
 var vmMesg = new Vue({
   // el: '#vue-message-index-pc',

+ 18 - 0
src/web/staticres/js/pur-search-index-pc.js

@@ -184,6 +184,17 @@ var vm = new Vue({
         this.$on('updatescope', (data) => {
             this.setData.keyList = data
         })
+        /**
+         * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+         * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+         */
+        if (goTemplateData.inIframe) {
+          this._$SearchEvent = initSearchPageEvent({
+            type: 'buyer',
+            el: '.search-header-top .input-container',
+            submitSelector: '.search-button'
+          })
+        }
     },
     methods: {
         updatescope(data) {
@@ -197,6 +208,13 @@ var vm = new Vue({
         },
         // 采购单位模糊搜索
         getPreSearchList: utils.debounce(function () {
+            /**
+             * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+             * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+             */
+            if (this._$SearchEvent) {
+              this._$SearchEvent.syncInput()
+            }
             var data = {
                 name: this.searchContent.trim()
             }

+ 85 - 0
src/web/staticres/js/selector/keyword-tags.js

@@ -0,0 +1,85 @@
+var keywordTagsComponentTemplate = `
+  <div class="add-keyword-container">
+    <div class="add-keyword-tags">
+      <el-tag
+        :key="tag"
+        v-for="tag in list"
+        closable
+        :disable-transitions="false"
+        @close="handleClose(tag)">
+        {{tag}}
+      </el-tag>
+    </div>
+    <div v-if="list.length < maxListLength" style="margin-top:6px;">
+      <el-input
+        class="add-keyword-input"
+        type="text"
+        :placeholder="placeholder"
+        v-model="addKeywordVal"
+        :maxlength="maxLength"
+        show-word-limit
+        :disabled="disabled"
+        @keyup.native="onKeyup"
+      ></el-input>
+      <span class="add-keyword-btn" :class="{'focus': addKeywordVal}" @click="addKeyTags">添加</span>
+    </div>
+    <slot name="radio"></slot>
+  </div>
+`
+
+// var keywordTagsComponentTemplate = "\n<div class=\"selector-content select-list-content\" ref=\"selectContainer\">\n    <span class=\"action-button show-more\" @click=\"showMore = !showMore\" v-if=\"needShowMore\">\n        <span class=\"action-text\">{{ showMore ? '\u6536\u8D77' : '\u66F4\u591A' }}</span>\n        <span class=\"el-icon-arrow-down\" :class=\"showMore ? 'rotate180' : ''\"></span>\n    </span>\n    <div class=\"select-group-container\" v-if=\"selectButtonType === 'checkbox'\">\n        <el-checkbox\n            v-for=\"(item, index) in selectList\"\n            :key=\"index\"\n            :name=\"item.value\"\n            ref=\"selectItem\"\n            v-model=\"item.selected\"\n            v-show=\"showAll(item)\"\n            @change=\"changeState(item)\"\n        >{{ item.label }}</el-checkbox>\n    </div>\n    <div class=\"select-group-container\" v-else-if=\"selectButtonType === 'button'\">\n        <div\n            v-for=\"(item, index) in selectList\"\n            :key=\"index\"\n            ref=\"selectItem\"\n            class=\"j-button-item bgc\"\n            v-show=\"showAll(item)\"\n            :class=\"{\n                active: item.selected,\n                all: item.label === selectItemExp.label\n            }\"\n            @click=\"changeState(item)\"\n        >{{ item.label }}</div>\n    </div>\n</div>\n";
+
+var keywordTagsComponent = {
+    name: 'keyword-tags-pc',
+    template: keywordTagsComponentTemplate,
+    props: {
+      placeholder: {
+        type: String,
+        default: '请输入关键词'
+      },
+      // 输入框可输入最大长度
+      maxLength: {
+        type: Number,
+        default: 15
+      },
+      list: {
+        type: Array,
+        default: function () {
+          return []
+        }
+      },
+      // 数组最大长度
+      maxListLength: {
+        type: Number,
+        default: 5
+      },
+      // 输入框是否禁用
+      disabled: Boolean,
+      beforeChange: Function
+    },
+    data: function () {
+      return {
+        addKeywordVal: ''
+      }
+    },
+    mounted: function () {},
+    methods: {
+      addKeyTags: function () {
+        var beforeChange = this.beforeChange()
+        if (!beforeChange) return
+        if (!this.addKeywordVal) return
+        this.list.push(this.addKeywordVal.replace(/\s*$/g,''))
+        console.log(this.list);
+        this.$emit('change', this.list)
+        this.addKeywordVal = ''
+      },
+      handleClose: function (tag) {
+        this.list.splice(this.list.indexOf(tag), 1)
+        this.$emit('change', this.list)
+      },
+      onKeyup: function () {
+        // this.addKeywordVal = this.addKeywordVal.replace(/^\s+|\s+$/g, '')
+        this.addKeywordVal = this.addKeywordVal.replace(/^\s*/g, '')
+      }
+    }
+}

+ 1660 - 0
src/web/staticres/js/superSearch copy.js

@@ -0,0 +1,1660 @@
+var pageSize = 50;
+var nbflag = false;//是否显示的是最新招标数据
+var currentPage = 1;//当前页
+var submitflag = true;
+var tabularflag = "Y";
+$(function() {
+	priceTime();
+	$(".Price-content").find("span:first-child").click(function(){
+		$(this).addClass("active");
+		$(".pricefat").removeClass("active");
+		beforeSubmit();
+	})
+	$(".timer").find("ul li:first-child").click(function(){
+		timeshow = false;
+		$("#starttime").css({"border-color":""});
+		$("#endtime").css({"border-color":""});
+		$("#timebut").hide();
+		$(".timerInput").removeClass("customtime-active");
+		$(this).addClass("active");
+		$(".timerInput").removeClass("active");
+	})
+	//
+	$(".pricebut").click(function(){
+		priceCss();
+		beforeSubmit();
+	})
+	//
+	$("#timebut").click(function(){
+		timeshow=false;
+		$(this).hide();
+		$(".timerInput").removeClass("customtime-active");
+		if($("#starttime").val()==""&&$("#endtime").val()==""){
+			$("#starttime").css({"border-color":""});
+			$("#endtime").css({"border-color":""});
+			$("#timebut").hide();
+			$(".timerInput").removeClass("customtime-active");
+			$("#timerAll").addClass("active");
+			$(".timerInput").removeClass("active");
+		}else{
+			$(".timerInput").addClass("active");
+			$(".timer").find("ul li:first-child").removeClass("active");
+			$(".release-time .timer li").removeClass("active");
+		}
+		beforeSubmit()
+	})
+	//
+	$(".nbprev").click(function(){
+		$(window).scrollTop(0);
+		$('.custom-checkbox.check-all').prop('checked', false)
+		prev();
+	})
+	$(".nbnext").click(function(){
+    	$(window).scrollTop(0);
+    	$('.custom-checkbox.check-all').prop('checked', false)
+		next();
+
+	})
+	//筛选关闭和打开
+	//根据cookie值设置筛选是否显示 移除该需求操作
+	// var rsw = localStorage.getItem("hideorshow");
+	// if(rsw!=null){
+	// 	if(rsw=="D"){
+	// 		$("#screenBtn").addClass("down");
+  //     $(".searchTender").show();
+  //     $('#fold').show()
+	// 	}else{
+	// 		$("#screenBtn").removeClass("down");
+  //     $(".searchTender").hide();
+  //     $('#fold').hide()
+	// 	}
+	// }
+	//记录用户刷选按钮状态
+	$("#screenBtn").click(function(){
+		if($(this).attr("class").indexOf("down")>0){
+      // localStorage.setItem("hideorshow", "D");
+      $('#fold').show()
+		}else{
+      // localStorage.setItem("hideorshow", "U");
+      $('#fold').hide()
+		}
+	})
+	//
+	var iuod = localStorage.getItem("industryuod");
+	if(iuod!=null){
+		if(iuod=="U"){
+			$(".stop").click();
+		}
+	}
+	//
+	$(".stop").click(function(){
+		if($(this).attr("class").indexOf("up")>0){
+			localStorage.setItem("industryuod", "U");
+		}else{
+			localStorage.setItem("industryuod", "D");
+		}
+	})
+	//全文检索和标题检索切换
+	$("#newsclass li:nth-child(2)").click(function(){
+    // searchInnerVue.listState.total = totalPage
+    // 重置全选按钮
+    $('.custom-checkbox.check-all').prop('checked', false)
+		$(".tabContainer-2 .lucene ul").html("");
+		$("#zbSeatchT [name='selectType']").val("all");
+		$("#right-list").addClass("active").siblings().removeClass("active");
+		$("#allnews .lucene").show().siblings().hide();
+		$(".tabContainer-2").hide();
+		currentPage=1;
+		if(submitflag){
+			$(".hasNoData").hide();
+      $(".working").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+			$(".tabContainer").css("min-height","600px");
+			selectType = "all";
+			searchOnsubmit();
+      submitflag=false;
+    }
+	})
+	$("#newsclass li:nth-child(1)").click(function(){
+    // 重置全选按钮
+    $('.custom-checkbox.check-all').prop('checked', false)
+		$("#allnews .lucene ul").html("");
+		$("#zbSeatchT [name='selectType']").val("title");
+		$("#right-list").addClass("active").siblings().removeClass("active");
+		$(".tabContainer-2 .lucene").show().siblings().hide();
+		$("#allnews").hide();
+		currentPage=1;
+		if(submitflag){
+			$(".hasNoData").hide();
+      $(".working").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+			$(".tabContainer").css("min-height","600px");
+			selectType = "title";
+			searchOnsubmit();
+      submitflag=false;
+		}
+	})
+
+  $('#entsearch, #pursearch, #gysearch').on('click', function () {
+    if($(this).attr('datahref')){
+      location.href= $(this).attr('datahref')
+    }
+
+  })
+})
+//
+function next(){
+	if($(".nbnext").hasClass("disabled")){
+		return false;
+	}
+	$(".hasNoData").hide();
+	$(".working").show();
+	$(".tabContainer").hide();
+	$("#allnews").hide();
+	$(".pagination").hide();
+	currentPage = parseInt($(".pagination-inner").find("span").text())+parseInt(1)
+	if(currentPage==10){
+		$(".nbnext").addClass("disabled");
+	}else if(currentPage==2){
+		$(".nbprev").removeClass("disabled");
+	}
+	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
+		getNewBids(currentPage);
+	}else{
+		if(!$("#right-table").hasClass("active")){
+			if(secondFlag=="T"){
+				$(".tabContainer").show();
+				$(".hasNoData").hide();
+				$(".nbnext").addClass("disabled");
+				appendDatas(secondList,true,false);
+			}else if(!nbflag&&currentPage<11){
+				getNewBiddings();
+			}else{
+				searchOnsubmit(true);
+			}
+		}else{
+//表格点击下一页
+//			if(secondFlag=="T"){
+//				$(".tabContainer").show();
+//				$(".hasNoData").hide();
+//				$(".nbnext").addClass("disabled");
+//				appendDatas(secondList,true,false);
+//			}else{
+//				getVIPData(true);
+//			}
+		}
+	}
+}
+function prev(){
+	if($(".nbprev").hasClass("disabled")){
+		return false;
+	}
+	$(".hasNoData").hide();
+	$(".working").show();
+	$(".tabContainer").hide();
+	$("#allnews").hide();
+	$(".pagination").hide();
+	currentPage = parseInt($(".pagination-inner").find("span").text())-parseInt(1)
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}else if(currentPage<10){
+		$(".nbnext").removeClass("disabled");
+	}
+	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
+		getNewBids(currentPage);
+	}else{
+		if(!$("#right-table").hasClass("active")){
+			if(secondFlag=="T"){
+				$(".tabContainer").show();
+				$(".hasNoData").hide();
+				//$(".nbnext").addClass("disabled");
+				appendDatas(list,true,false);
+			}else if(!nbflag&&currentPage>0){
+				getNewBiddings();
+			}else{
+				searchOnsubmit(true);
+			}
+		}else{
+//表格点击上一页
+//			getVIPData(true);
+		}
+	}
+}
+
+//取redis里的数据
+function getNewBids(pnum, size){
+	$.post("/jylab/supsearch/getNewBids",{pageNumber:pnum,pageSize: size? size : pageSize, pageType:"", fileExists: $("#zbSeatchT [name='fileExists']").val(),bid_field: $("#zbSeatchT [name='bid_field']").val()},function(r){
+		if(r&&r.list!=null&&r.list.length>0){
+			$(".tabContainer").show();
+			//$(".pagination").show();
+			$(".hasNoData").hide();
+			//$(".pagination-inner").find("span").text(currentPage);
+			if(r.list.length<pageSize||currentPage==10){
+				$(".nbnext").addClass("disabled");
+			}else{
+				$(".nbnext").removeClass("disabled");
+      }
+      searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
+      searchInnerVue.checkPageNumAdd1()
+      if (size) {
+        appendDatas(r.list,false,true, true);
+      } else {
+        appendDatas(r.list,false,true);
+      }
+		}else{
+			submitflag=true;
+			$(".tabContainer").hide();
+			$(".pagination").hide();
+			$(".working").hide();
+      $(".hasNoData").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+    }
+    // getBidIsColl()
+	})
+}
+
+////最新招标信息
+function getNewBiddings(num, size){
+	// $("#newsclass").hide();
+	// $("#newsnow").show();
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}
+	var param = {
+    pageNumber: num ? num : currentPage,
+    pageSize: size ? size : pageSize,
+    reqType: "lastNews",
+    tabularflag: "Y",
+    searchvalue: $("#zbSeatchT [name='keywords']").val(),
+    area: $("#zbSeatchT [name='area']").val(),
+    subtype: $("#zbSeatchT [name='subtype']").val(),
+    publishtime: $("#zbSeatchT [name='publishtime']").val(),
+    selectType : $("#zbSeatchT [name='selectType']").val() || 'title,content',
+    minprice : $("#zbSeatchT [name='minprice']").val(),
+    maxprice : $("#zbSeatchT [name='maxprice']").val(),
+    industry : $("#zbSeatchT [name='industry']").val(),
+    buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+    buyertel: $("#zbSeatchT [name='buyertel']").val(),
+    winnertel: $("#zbSeatchT [name='winnertel']").val(),
+    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    fileExists: $("#zbSeatchT [name='fileExists']").val(),
+    city: $("#zbSeatchT [name='city']").val(),
+    bid_field: $("#zbSeatchT [name='bid_field']").val()
+  };
+	$.post("/front/pcAjaxReq",param,function(r){
+		if(r&&r.list!=null&&r.list.length>0){
+      // 计算总页码
+      if (currentPage == 1) {
+        searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
+        searchInnerVue.checkPageNumAdd1()
+      }
+			$(".tabContainer").show();
+			//$(".pagination").show();
+			$(".hasNoData").hide();
+			//$(".pagination-inner").find("span").text(currentPage);
+			if(r.list.length<pageSize||currentPage==10){
+				$(".nbnext").addClass("disabled");
+			}else{
+				$(".nbnext").removeClass("disabled");
+			}
+      if (size && num === 1) {
+			  appendDatas(r.list,true,true, true);
+      } else {
+        appendDatas(r.list,false,false);
+      }
+		}else{
+			if(currentPage>1){
+				$(".nbnext").addClass("disabled");
+				if(currentPage==2){
+					$(".nbprev").addClass("disabled");
+				}
+				currentPage = currentPage-1;
+				return false
+			}
+			submitflag=true;
+			$(".tabContainer").hide();
+			$(".pagination").hide();
+			$(".working").hide();
+      $(".hasNoData").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+    }
+	})
+}
+//
+
+function appendDatas(datas,flag,isNew,onlyUpdateTable){
+  // flag // 是否有输入
+  let is_field=$("#zbSeatchT [name='bid_field']").val() //是否是领域化
+  let selectContext=selectType.indexOf('content') > -1 //是否正文搜索
+  console.log('selectType: ' + selectType,',flag: ',flag)
+	var listHtml = '';
+	var tableHtml = '';
+	$(".working").hide();
+  $(".pagination").show();
+  // 显示页码
+  searchInnerVue.showPage = true
+	var searchvalueArray = searchvalue.split("+");
+	$(".pagination-inner").find("span").text(currentPage);
+	if(datas.length<pageSize){
+		$(".nbnext").addClass("disabled");
+	}
+	if(!isNew && typeof(totalPage) != "undefined"){
+		if(currentPage == totalPage){
+			$(".nbnext").addClass("disabled");
+		}else{
+			$(".nbnext").removeClass("disabled");
+		}
+	}
+	//(数据够20条显示查看更多遮罩层)
+	if (currentPage==1){//第一页得时候需要判断 是否显示遮罩层
+		if(datas.length>=20){
+			$(".shade_table").css("display","");
+		}else{
+			$(".shade_table").css("display","none");
+		}
+	}
+	for(var i=0;i<datas.length;i++){
+		var index = (currentPage - 1) * pageSize + i + 1;
+		var title = datas[i].title;
+		var detail = datas[i].detail;
+    var fileExists = datas[i].fileExists
+		if(detail){
+			detail = detail.replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"")
+			if(detail.length>200){
+				detail = detail.substring(0,200)+"..."
+			}
+		}
+		if(flag){
+			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
+			title=title.replace(/\<br>/g,"")
+			detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
+		}
+		if(title.length<40){
+				title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
+		}
+		var type = datas[i].subtype;
+		if(typeof(type) == "undefined" || type == null || type == ""){
+			type = datas[i].toptype;
+		}
+		if(typeof(type) == "undefined" || type == null || type == ""){
+			type = datas[i].type;
+			if(type == "bid"){
+				type = "中标";
+				datas[i].stypeadd="ZHB"
+			}else if(type == "tender"){
+				datas[i].stypeadd="ZB"
+				type = "招标";
+			}else{
+				type = "";
+			}
+		}
+
+		if (!onlyUpdateTable){ //是否仅更新table
+			listHtml += '<li>'
+			//if(datas.length==(i+1)){
+			//	listHtml +='<div class="liLuceneList">'
+			//}else{
+				listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
+      //}
+      // 标题搜索 选择框
+      if (!selectContext || !flag) {
+        listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+        listHtml +='<div class="luce-left">'
+		if(datas[i].site == '剑鱼信息发布平台') {
+			listHtml += '<span class="userPublish">用户发布</span>'
+		}
+		listHtml += '<em class="visited-hd">'+index+'.</em>'
+						+'<div class="left-title" style="width:auto;max-width:700px">'
+						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
+        if(fileExists) {
+          listHtml+='<span class="haveFile">'+'有附件'+'</span>'
+        }
+        listHtml+='</div>'
+      }
+      // 全文搜索
+			if(flag && selectContext){
+				listHtml +='<div class="luce-left">'
+				if(datas[i].site == '剑鱼信息发布平台') {
+					listHtml += '<span class="userPublish">用户发布</span>'
+					listHtml += '<em class="visited-hd">'+index+'.</em>'
+						+'<div class="left-title" style="width:auto;max-width:1080px">'
+						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
+				} else {
+					listHtml +='<em class="visited-hd" style="padding-left:30px;">'+index+'.</em>'
+						+'<div class="left-title" style="width:auto;max-width:1080px">'
+						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
+				}
+				if(fileExists) {
+					listHtml+='<span class="haveFile">'+'有附件'+'</span>'
+				}
+				listHtml+='</div>'
+				// 全文搜索选择框
+				listHtml += '<div class="left-content" style="width:100%;padding:0;">'
+					+ '<input class="custom-checkbox all-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+					+'<a style="float:left;width:calc(100% - 32px)" href="javascript:volid(0);">'+detail+'...</a>'
+					+'</div>'
+			}
+			listHtml += '</div><div class="luce-right">'
+			if($.trim(datas[i].area) != "" && datas[i].area != "A"){
+
+          listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
+			}else{
+				listHtml += '<a href="#" style="display:none;"></a>';
+			}
+			if(typeof(type) != "undefined" && type != null && type != ""){
+				// listHtml += '<a href="/list/stype/'+datas[i].stypeadd+'.html">'+type+'</a>';
+        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
+			}else{
+				listHtml += '<a href="#" style="display:none;"></a>';
+			}
+			//
+			if(typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field){
+				// listHtml += '<a href="/list/industry/'+datas[i].indadd+'.html">'+datas[i].industry+'</a>';
+        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
+			}else{
+				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+      }
+      // vipState付费用户显示采购单位类型 免费用户不显示
+      // if(typeof(datas[i].buyerclass) != "undefined" && datas[i].buyerclass != null && datas[i].buyerclass != "" && vipState){
+			// 	listHtml += '<a href="javascript:;">'+datas[i].buyerclass+'</a>';
+			// }else{
+			// 	listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+			// }
+
+			var amount= getacount(datas[i].bidamount,datas[i].budget)
+			if(amount!=""){
+				listHtml += '<a>'+conversionMoeny(amount)+'</a>';
+			}else{
+				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+			}
+
+			//
+			if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
+				var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
+				if(diff != null){
+					listHtml += '<span class="com-time">'+diff+'</span>';
+				}
+      }
+      // 是否收藏
+      listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
+      // 是否山川应用嵌入环境 添加操作按钮
+      var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
+      if (inInjectBI) {
+        listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
+      }
+      listHtml += '</div>'
+
+
+      //领域化展示 商品&采购单位&中标单位
+      if (is_field && !selectContext){
+        listHtml += '<div class="luce-field">'
+        if (typeof(datas[i].purchasing) != "undefined" && datas[i].purchasing != null && datas[i].purchasing != ""){
+          listHtml += '<div class="nowrap"><span>产品</span><span>'+datas[i].purchasing +'</span></div>'
+        }
+
+        let secondLine=''
+        if (typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
+          secondLine += '<div class="nowrap"><span>采购单位</span><span>'+datas[i].buyer +'</span></div>'
+        }
+
+        if (typeof(datas[i].s_winner) != "undefined" && datas[i].s_winner != null && datas[i].s_winner != ""){
+          secondLine += '<div class="nowrap"><span>中标单位</span><span>'+datas[i].s_winner +'</span></div>'
+        }
+
+        if (secondLine!=='') {
+          listHtml += '<div class="secondLine">'+secondLine+'</div>'
+        }
+
+        listHtml += '</div>'
+      }
+
+      listHtml += '</div></li>';
+
+			if(i == 5) {
+				listHtml += '<div data-list-ad class="_t3di2018y5"></div>'
+			}
+			if(i == 26) {
+				listHtml += '<div data-list-ad class="_6omliqck79a"></div>'
+			}
+		}
+
+		//表格仅显示前20条信息
+		if (i >= 20||currentPage!=1){
+			continue
+		}
+		tableHtml +='<tr onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank">'
+				+'<td width="48"><div>'+index+'</div></td>'
+		if(typeof(datas[i].projectname) != "undefined" && datas[i].projectname != null && datas[i].projectname != ""){
+			datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray,"<font class='com-highlight'>$1</font>");
+			tableHtml += '<td class="tt-l" width="315"><div>'+datas[i].projectname+'</div></td>';
+		}else{
+			let title=datas[i].title.replace(/\<br>/g,"")
+			tableHtml += '<td class="tt-l" width="315"><div>'+title+'</div></td>';
+		}
+
+		if(typeof(type) != "undefined" && type != null && type != ""){
+			tableHtml += '<td width="84"><div>'+type+'公告</div></td>';
+		}else{
+			tableHtml += '<td width="84"><div></div></td>';
+		}
+
+		if(typeof(datas[i].budget) != "undefined" && datas[i].budget != null && datas[i].budget != ""){
+      var budget = tableFormatMoney(datas[i].budget, {
+        type: 'number',
+        digit: 2,
+        level: 1
+      })
+			tableHtml += '<td class="tt-r" width="73"><div>'+budget+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-r" width="73"><div></div></td>';
+		}
+		if(typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
+			tableHtml += '<td class="tt-l" width="181"><div>'+datas[i].buyer+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-l" width="181"><div></div></td>';
+		}
+		if(typeof(datas[i].bidopentime) != "undefined" && datas[i].bidopentime != null && datas[i].bidopentime != ""){
+			var diff = formatDate(Number(datas[i].bidopentime),"l");
+			tableHtml += '<td width="103"><div>'+diff+'</div></td>';
+		}else{
+			tableHtml += '<td width="103"><div></div></td>';
+		}
+		if(typeof(datas[i].winner) != "undefined" && datas[i].winner != null && datas[i].winner != ""){
+			tableHtml += '<td class="tt-l" width="174"><div>'+datas[i].winner+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-l" width="174"><div></div></td>';
+		}
+		if(typeof(datas[i].bidamount) != "undefined" && datas[i].bidamount != null && datas[i].bidamount != ""){
+      var bidamount = tableFormatMoney(datas[i].bidamount, {
+        type: 'number',
+        digit: 2,
+        level: 1
+      })
+			tableHtml += '<td class="tt-r" width="76"><div>'+bidamount+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-r" width="76"><div></div></td>';
+		}
+
+		if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
+			var diff = formatDate(Number(datas[i].publishtime),"s");
+			if(diff != null){
+				tableHtml += '<td width="103"><div>'+diff+'</div></td>';
+			}
+		}else{
+			tableHtml += '<td width="103"><div></div></td>';
+		}
+			tableHtml+='</tr>'
+  }
+  // 搜索框有输入词
+	if(flag){
+    if(selectContext) {
+      $("#allnews").show();
+      $(".tabContainer-2").hide();
+    } else {
+      $("#allnews").hide();
+		  $(".tabContainer-2").show();
+    }
+	}else{
+		$("#allnews").hide();
+		$(".tabContainer-2").show();
+	}
+
+	if (currentPage!=1){
+		tableHtml = sessionStorage.getItem("table_first_context")
+	}else{
+		sessionStorage.setItem("table_first_context",tableHtml)
+	}
+  //console.log(listHtml)
+  // 没有关键词或者没有选中正文
+	if(!flag||!selectContext){
+		if (!onlyUpdateTable){
+			$(".tabContainer-2 .lucene ul").html(listHtml);
+		}
+		$(".tabContainer-2 .lucene-table table tbody").html(tableHtml);
+	}else{
+		if(selectContext){
+			if (!onlyUpdateTable){
+				$("#allnews .lucene ul").html(listHtml);
+			}
+			$("#allnews .lucene-table table tbody").html(tableHtml);
+		}
+	}
+	$(".tabContainer").css("min-height","");
+	submitflag=true;
+  // backTopAdjust();
+  // 生成dom之后再查标讯有无收藏
+  getBidIsColl()
+  checkVisited()
+  // 生成dom之后再查询是否勾选
+  getCheckList()
+  /**
+   * @date 2022/12/15 山川环境嵌入搜索
+   * 更新是否已添加状态
+   */
+  InBIInjectHooks.check()
+}
+
+function getacount(bidamount,budget){
+	if(typeof(bidamount) != "undefined" && bidamount != null && bidamount != ""){
+		return bidamount
+	}
+	if(typeof(budget) != "undefined" && budget != null && budget != ""){
+		return budget
+	}
+	return ""
+}
+
+//金额转化   金额:0-万元以下单位为元  ,万元以上至亿元以下单位为万元 ,亿元以上单位为亿元。保留 小数点后 2 位,不进行四舍五入。
+function conversionMoeny(money){
+	var m = ""+money;
+	var m_arr = m.split(".")
+	var m_1 = m_arr[0]
+	var len_m1 = m_1.length;
+	if (len_m1 >= 9 ){
+		m = m_1.substring(0,len_m1-8) + "." + m_1.substring(len_m1-8,len_m1-6) + "亿元"
+	} else if (len_m1 >= 5) {
+		m =m_1.substring(0,len_m1-4) + "." + m_1.substring(len_m1-4,len_m1-2) + "万元"
+	} else {
+		if(m_arr.length == 1) {
+			return m + ".00元"
+		}
+		var m_2 = m_arr[1]
+		if (m_2.length > 1) {
+			m_2 = m_2.substring(0,2)
+		} else {
+			m_2 = m_2.substring(0,1) + "0"
+		}
+		m = m_1 + "." + m_2 + "元"
+	}
+	return m
+}
+
+//关闭遮罩层
+function layerClose(){
+	$("#myModal").modal("hide");
+}
+//
+function formatDate(date,sl)   {
+	var myDate = new Date(date*1000);
+    var   year=myDate.getFullYear();
+    var   month=myDate.getMonth()+1;
+    var   date=myDate.getDate();
+	var hour = myDate.getHours()
+	var min = myDate.getMinutes()
+	if(sl=="l"){
+		if(hour<10){
+			hour="0"+hour
+		}
+		if(min<10){
+			min="0"+min
+		}
+		return   year+"-"+month+"-"+date+"<br>"+hour+":"+min;
+	}else{
+		return   year+"-"+month+"-"+date;
+	}
+}
+//
+function onpicking(dp,obj){
+	var time = new Date(dp.cal.newdate.y,dp.cal.newdate.M-1,dp.cal.newdate.d).getTime()+"";
+	time = time.substring(0,time.length - 3);
+	$(obj).attr("data-value",time);
+}
+//
+function onclearing(obj){
+	$(obj).attr("data-value","");
+	//localStorage.removeItem($(obj).attr("id"))
+	if($(".customtime").hasClass("active") && getInputTime().join("") == ""){
+		$(".customtime").removeClass("active");
+		$("#publishtime #alltime").addClass("active");
+	}
+}
+//
+function picked(dp,obj){
+	//localStorage.setItem($(obj).attr("id"),$(obj).val()+"_"+$(obj).attr("data-value"))
+}
+//
+function getInputTime(){
+	var starttime = $("#starttime").attr("data-value");
+	if(starttime){
+		starttime = $.trim(starttime);
+	}else{
+		starttime = "";
+	}
+	var endtime = $("#endtime").attr("data-value");
+	if(endtime){
+		endtime = $.trim(endtime);
+	}else{
+		endtime = "";
+	}
+	return [starttime,endtime]
+}
+
+//---取VIP数据---
+function getVIPData(clickpaging){
+	var this_selectType = $("#zbSeatchT [name='selectType']").val();
+	if(this_selectType != "all"){
+		LimitClass.limitFlag = false;
+		LimitClass.result = null;
+		LimitClass.list = null;
+	}else{
+		if(LimitClass.limitFlag){
+			if(clickpaging){
+				LimitClass.paging(currentPage);
+			}else{
+				$(".tabContainer .lucene").hide();
+				$(".tabContainer .lucene-table").show();
+			}
+			return true;
+		}
+	}
+	var tlflag = false;
+	$(".tabContainer-2 .lucene").hide();
+  $("#allnews").hide();
+	$(".pagination").hide();
+  $(".working").show();
+  // 隐藏页码
+  searchInnerVue.showPage = false
+	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
+		$(".working").hide();
+    $(".pagination").show();
+    // 显示页码
+    searchInnerVue.showPage = true
+		return true;
+	}
+	var tabflag = false;
+	if($("#zbSeatchT [name='keywords']").val()!=""){
+		// $("#newsclass").show();
+		// $("#newsnow").hide();
+		tlflag = true;
+	}else{
+		// $("#newsclass").hide();
+		// $("#newsnow").show();
+		tlflag = false;
+	}
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}
+	var reqType="bidSearch";
+	if($("#zbSeatchT [name='keywords']").val()==""){
+		reqType="lastNews";
+	}
+	var param = {
+				pageNumber: 1,
+        pageSize: pageSize,
+				reqType: reqType,
+				searchvalue: $("#zbSeatchT [name='keywords']").val(),
+				area: $("#zbSeatchT [name='area']").val(),
+				subtype: $("#zbSeatchT [name='subtype']").val(),
+				publishtime: $("#zbSeatchT [name='publishtime']").val(),
+				selectType : this_selectType || 'title,content',
+				minprice : $("#zbSeatchT [name='minprice']").val(),
+				maxprice : $("#zbSeatchT [name='maxprice']").val(),
+				industry : $("#zbSeatchT [name='industry']").val(),
+        tabularflag : tabularflag,
+        buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+        buyertel: $("#zbSeatchT [name='buyertel']").val(),
+        winnertel: $("#zbSeatchT [name='winnertel']").val(),
+		    notkey: $(".not-key-input-group input").val().slice(0, 10),
+        fileExists: $("#zbSeatchT [name='fileExists']").val(),
+        city: $("#zbSeatchT [name='city']").val(),
+        bid_field: $("#zbSeatchT [name='bid_field']").val()
+      };
+	$.ajax({
+       type:'post',
+       url:'/front/pcAjaxReq',
+       async:false,
+	   data:param,
+       dataType:'json',
+       success:function(r){
+			afterAjaxReq(r);
+			if(r&&r.list!=null&&r.list.length>0){
+				$(".hasNoData").hide();
+				if(r.list.length<pageSize||currentPage==10){
+					$(".nbnext").addClass("disabled");
+				}else{
+					$(".nbnext").removeClass("disabled");
+				}
+				// appendDatas(r.list,tlflag,true,true);
+				appendDatas(r.list,tlflag,true,false);
+			}else{
+				$(".working").hide();
+        $(".hasNoData").show();
+        // 隐藏页码
+        searchInnerVue.showPage = false
+			}
+      tabflag = true;
+		}
+	})
+	return tabflag
+}
+///
+function beforeSubmit(n){
+  // n有值即执行的是点击搜索按钮或回车搜索事件
+  // n有值且关键词不为空时 存sessionStorage值
+  if ($("#zbSeatchT [name='keywords']").val() !=="") {
+    sessionStorage.setItem('is-click-search', 1)
+  } else {
+    sessionStorage.removeItem('is-click-search')
+  }
+  // 重置全选按钮
+  $('.custom-checkbox.check-all').prop('checked', false)
+	$(".hasNoData").hide();
+  $(".working").show();
+  // 隐藏页码
+  searchInnerVue.showPage = false
+	//$(".tabContainer-2 .lucene ul").html("");
+	//$(".tabContainer-2 .lucene-table table tbody").html("");
+	$(".tabContainer .lucene ul").html("");
+	//$(".tabContainer .lucene-table table tbody").html("");
+	$(".tabContainer").css("min-height","600px");
+	$("#right-list").addClass("active").siblings().removeClass("active");
+	$(".tabContainer-2 .lucene").show().siblings().hide();
+	$("#right-list").addClass("active").siblings().removeClass("active");
+	$("#allnews .lucene").show().siblings().hide();
+	$(".tabContainer-2").hide();
+	$("#allnews").hide();
+	$(".pagination").hide();
+	setTimeout(function(){
+    currentPage=1;
+    // 重置element ui页码为1
+    searchInnerVue.listState.num = 1
+		//时间
+		if(currentPage==1){
+			$(".nbprev").addClass("disabled");
+		}
+		var publishtime = null;
+		var timeslot = getInputTime().join("_");
+		if($(".timerInput").hasClass("active")){
+			if(timeslot != "_"){
+				$("#zbSeatchT [name='publishtime']").val(timeslot);
+			}else{
+				$("#zbSeatchT [name='publishtime']").val("");
+			}
+		}else{
+			publishtime = $(".timer .active").attr("data-value");
+			if(typeof(publishtime) != "undefined"){
+				$("#zbSeatchT [name='publishtime']").val(publishtime);
+			}else{
+				$("#zbSeatchT [name='publishtime']").val("");
+			}
+		}
+		if(timeslot != "_"){
+			$("#zbSeatchT [name='timeslot']").val(timeslot);
+		}else{
+			$("#zbSeatchT [name='timeslot']").val("");
+		}
+		//地区
+		// var selectAreas = "";
+		// $(".region-content .active:not(.parent-node)").each(function(){
+		// 	var thisText = $(this).text();
+		// 	if(thisText != "全国"){
+		// 		if(selectAreas != ""){
+		// 			selectAreas += ",";
+		// 		}
+		// 		selectAreas += thisText;
+		// 	}
+		// });
+		// $("#zbSeatchT [name='area']").val(selectAreas);
+		//类型
+		var selectSubTypes = "";
+		$(".info-content .active:not(.parent-node)").each(function(){
+			if($(this).attr("id") == "whole"||$(this).attr("id") == "infoBtn"){
+				return true;
+			}
+			var thisText = $(this).attr("data-value");
+			if (thisText!=undefined){
+				if(selectSubTypes != ""){
+				selectSubTypes += ",";
+				}
+				selectSubTypes += thisText;
+			}
+		});
+    // 信息类型二级分类全选只传一级分类文案
+    $(".info-content .parent-node").each(function(){
+			if($(this).attr("id") == "whole"||$(this).attr("id") == "infoBtn"){
+				return true;
+			}
+			var thisHaveClass = $(this).hasClass("active");
+      let thisText = $(this).text()
+			if (thisHaveClass){
+        if(thisText == '招标预告') {
+          selectSubTypes = selectSubTypes.replace(/预告,预审,预审结果,论证意见,需求公示/, "招标预告")
+        } else if(thisText == '招标公告') {
+          selectSubTypes = selectSubTypes.replace(/招标,邀标,询价,竞谈,单一,竞价,变更/, "招标公告")
+        } else if(thisText == '招标结果') {
+          selectSubTypes = selectSubTypes.replace(/中标,成交,废标,流标/, "招标结果")
+        } else if(thisText == '招标信用信息') {
+          selectSubTypes = selectSubTypes.replace(/合同,验收,违规/, "招标信用信息")
+        }
+			}
+		});
+		$("#zbSeatchT [name='subtype']").val(selectSubTypes);
+		//行业
+		var selectIndustrys = "";
+		var thisText = "";
+		$(".industry-content .active").each(function(){
+			if($(this).attr("id") == "induAll"){
+				return true;
+			}else if($(this).hasClass("active")&&$(this).hasClass("parent-node")){
+				$(this).nextUntil(".diver").each(function(){
+					thisText = $(this).attr("data-value");
+					if(selectIndustrys != ""){
+						selectIndustrys += ",";
+          }
+					selectIndustrys += thisText;
+				});
+			}else{
+				thisText = $(this).attr("data-value");
+				if(selectIndustrys != ""){
+					selectIndustrys += ",";
+				}
+				selectIndustrys += thisText;
+			}
+    });
+		$("#zbSeatchT [name='industry']").val(selectIndustrys);
+		//价格
+		if(!$("#priceAll").hasClass("active")){
+			var selectMinPrices = $(".PriceInput [name='minprice']").val();
+			var selectMaxPrices =  $(".PriceInput [name='maxprice']").val();
+			$("#zbSeatchT [name='minprice']").val(selectMinPrices);
+			$("#zbSeatchT [name='maxprice']").val(selectMaxPrices);
+		}else{
+			$("#zbSeatchT [name='minprice']").val("");
+			$("#zbSeatchT [name='maxprice']").val("");
+		}
+		//搜索关键词
+		var searchname = $("#zbSeatchT input[name='keywords']").val();
+    //$("#zbSeatchT input[name='searchvalue']").val($.trim(searchname));
+    // 采购单位类型
+    var buyerTypeArr = ""
+    var buyerText = ""
+    $(".buyclass .active").each(function(){
+      if ($(this).hasClass('buyclass-all')) {
+        return true
+      } else if ($(this).hasClass('buy-list')) {
+        if ($(this).attr("data-value")) {
+          buyerText = $(this).attr("data-value");
+          if(buyerTypeArr != ""){
+            buyerTypeArr += ",";
+          }
+          buyerTypeArr += buyerText;
+        }
+      }
+    })
+    //采购单位类型
+    $("#zbSeatchT [name='buyerclass']").val(buyerTypeArr)
+    // $("#buyerInput").val(buyerTypeArr);
+	//采购单位联系方式有无
+    $("#zbSeatchT [name='buyertel']").val($(".custom-input[name='buyertel']").attr('data-value'));
+    //中标单位联系方式有无
+    $("#zbSeatchT [name='winnertel']").val($(".custom-input[name='winnertel']").attr('data-value'));
+    //排除词
+	$("#zbSeatchT [name='notkey']").val($(".not-key-input-group input").val().slice(0, 10));
+		if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F"){
+			getNewBids(currentPage);
+		}else{
+			if(n!="F"){
+				if(submitflag){
+					if($.trim(searchname)==""){
+						getNewBiddings();
+						nbflag = false;
+					}else{
+						searchvalue = $.trim(searchname);
+						searchOnsubmit();
+						nbflag = true;
+					}
+					submitflag=false;
+				}
+				setTimeout(function(){
+					submitflag=true
+				},200);
+			}else{
+				if($.trim(searchname)!=""){
+					nbflag = true;
+				}
+			}
+		}
+		return true
+	},200)
+}
+var LimitClass = {
+	prevNoLimitFlag: false,
+	limitFlag: false,
+	list: null,
+	result: null,
+	paging: function(cp){
+		if(LimitClass.list != null){
+			var start = (cp-1)*pageSize;
+			var end = start+pageSize;
+			if(end > LimitClass.list.length){
+				end = LimitClass.list.length;
+			}
+			LimitClass.result.list = LimitClass.list.slice(start,end);
+		}
+		pcAjaxReqCallBack(LimitClass.result);
+	}
+};
+//搜索关键词信息
+function searchOnsubmit(clickpaging){
+	var this_selectType = $("#zbSeatchT [name='selectType']").val();
+	if(this_selectType != "all"){
+		LimitClass.limitFlag = false;
+		LimitClass.result = null;
+		LimitClass.list = null;
+	}else{
+		if(clickpaging&&LimitClass.limitFlag){
+			LimitClass.paging(currentPage);
+			return;
+		}
+	}
+	// $("#newsclass").show();
+	// $("#newsnow").hide();
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}
+	var param = {
+    pageNumber: currentPage,
+    pageSize: pageSize,
+    reqType: "bidSearch",
+    searchvalue: $("#zbSeatchT [name='keywords']").val(),
+    area: $("#zbSeatchT [name='area']").val(),
+    subtype: $("#zbSeatchT [name='subtype']").val(),
+    publishtime: $("#zbSeatchT [name='publishtime']").val(),
+    selectType : this_selectType || 'title,content',
+    minprice : $("#zbSeatchT [name='minprice']").val(),
+    maxprice : $("#zbSeatchT [name='maxprice']").val(),
+    industry : $("#zbSeatchT [name='industry']").val(),
+    tabularflag: "Y",
+    buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+    buyertel: $("#zbSeatchT [name='buyertel']").val(),
+    winnertel: $("#zbSeatchT [name='winnertel']").val(),
+    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    fileExists: $("#zbSeatchT [name='fileExists']").val(),
+    city: $("#zbSeatchT [name='city']").val(),
+    bid_field: $("#zbSeatchT [name='bid_field']").val()
+  };
+	$.post("/front/pcAjaxReq",param,function(r){
+		if(r.limitFlag){
+			LimitClass.limitFlag = true;
+			LimitClass.result = r;
+			LimitClass.list = r.list;
+			LimitClass.paging(currentPage);
+      LimitClass.prevNoLimitFlag = false;
+      // 重新分页
+      searchInnerVue.listState.total = r.totalPage
+      searchInnerVue.checkPageNumAdd1()
+		}else{
+			LimitClass.prevNoLimitFlag = true;
+      LimitClass.limitFlag = false;
+      pcAjaxReqCallBack(r);
+    }
+    // getBidIsColl()
+	});
+}
+function showSearchTipForTimeRange (type) {
+	var tempDom = $("#hasNoData_tiptext>font:eq(0)")
+	var tipMap = {
+    'fiveyear': '近5年',
+    'threeyear': '近3年',
+		'thisyear': '近1年',
+		'lately-7': '近7天',
+		'lately-30': '近30天'
+	}
+	var tempStr = ''
+	var defaultRange =  $("#zbSeatchT [name='publishtime']").val() || selectPublishtime
+	if (tipMap[defaultRange]) {
+		tempStr = tipMap[defaultRange]
+	} else {
+		var tempTimeList = defaultRange.split('_')
+		if (tempTimeList[0]) {
+			tempStr = new Date(tempTimeList[0] * 1000).pattern('yyyy/MM/dd')
+		}
+		if (tempTimeList[1]) {
+			if (tempStr.length) {
+				tempStr += '-'
+			}
+			tempStr += new Date(tempTimeList[1] * 1000).pattern('yyyy/MM/dd')
+		}
+	}
+	tempDom.find('span').text(tempStr)
+	if (type !== false) {
+		tempDom.show();
+	}
+}
+$(function () {
+	setTimeout(function(){
+		showSearchTipForTimeRange(false);
+	},500)
+})
+function pcAjaxReqCallBack(r){
+	afterAjaxReq(r);
+  var isAllSearch = $("#zbSeatchT [name='selectType']").val()=="all";
+	if(r.list == null || r.list.length == 0){
+		$("#hasNoData_tiptext>font").hide();
+		if(r.status==-1){
+			$("#hasNoData_tiptext>font:eq(1)").show();
+		}else if (r.status==-2){
+			$("#hasNoData_tiptext>font:eq(2)").show();
+		}else{
+			showSearchTipForTimeRange()
+		}
+		if(isAllSearch){
+			$("#allSearchModel").hide();
+		}else{
+			// $("#allSearchModel").show();
+		}
+		//分页过程中,突然切换控制状态
+		if(r.limitFlag && LimitClass.prevNoLimitFlag){
+			$("#hasNoData_tiptext>font").hide();
+			$("#hasNoData_tiptext>font:eq(1)").show();
+		}else{
+			if(currentPage>1){
+				$(".nbnext").addClass("disabled");
+				if(currentPage==2){
+					$(".nbprev").addClass("disabled");
+				}
+				currentPage = currentPage-1;
+				return false
+			}
+		}
+		$(".tabContainer").hide();
+		$(".pagination").hide();
+		$(".working").hide();
+    $(".hasNoData").show();
+    // 隐藏页码
+    searchInnerVue.showPage = false
+		submitflag=true;
+	}else{
+		//$(".tabContainer").show();
+		$(".hasNoData").hide();
+		appendDatas(r.list,true,false)
+	}
+}
+function afterAjaxReq(r){
+	secondFlag=r.secondFlag;
+	if(r.interceptWord != ""){
+      	$("#intercept .interceptWord").text(r.interceptWord);
+      	$("#intercept .interceptLimit").text(r.interceptLimit);
+		$("#intercept").removeClass("hidden");
+	}else{
+		$("#intercept").addClass("hidden");
+	}
+	if(r.keywords != null && typeof(r.keywords) != "undefined"){
+		$(".searchname").val(r.keywords);
+	}
+	$(".side-bar-bottom-font").text("“"+$.trim($(".searchname").val()).replace(/\s+/," ")+"”");
+	if(secondFlag==""&&typeof(r.searchvalue) != "undefined"){
+		searchvalue = r.searchvalue;
+	}
+	if(r.pcAjaxFlag=="T"){
+		searchvalue = r.searchvalue;
+		totalPage = r.totalPage;
+		list= r.list;
+    secondList= r.secondList;
+    // vue 重置总页数
+    searchInnerVue.listState.total = totalPage
+    searchInnerVue.checkPageNumAdd1()
+	}
+	if(secondFlag==""&&typeof(totalPage) != "undefined" && currentPage == 1){
+		if (r.totalPage==1){
+			totalPage = parseInt(r.count/pageSize)+1;
+			if(totalPage>10){
+				totalPage=10;
+      }
+      // vue 重置总页数
+      searchInnerVue.listState.total = totalPage
+      searchInnerVue.checkPageNumAdd1()
+		}else{
+      totalPage = r.totalPage;
+      searchInnerVue.listState.total = totalPage
+      searchInnerVue.checkPageNumAdd1()
+		}
+	}
+}
+
+function getCheckList() {
+  var getSelectNum = 0 // 获取这一页有多少个选中
+  var $dom = $('.custom-checkbox:not(.check-all)[name="bid-list"]')
+  $.each($dom,function(i, value) {
+    if(selectDataIds.length == 0) return
+    selectDataIds.forEach(function(item,index) {
+      let dataid = $(value).attr('dataid')
+      if (item == dataid) {
+        getSelectNum++
+        $(this).attr('checked', true)
+      }
+    })
+  })
+  if(getSelectNum>=50) {
+    $('.custom-checkbox').prop("checked",true)
+  } else {
+    $('.custom-checkbox').prop("checked",false)
+    $dom.each(function(i, dNode) {
+      if(selectDataIds.length == 0) return
+      selectDataIds.forEach(function(item,index) {
+        let dataid = $(dNode).attr('dataid')
+        if (item == dataid) {
+          getSelectNum++
+          $(dNode).prop('checked', true)
+        }
+      })
+    })
+  }
+}
+
+/*
+  招标信息是否被收藏接口ajax
+  bids: String, // 招标信息id(多个用,号拼接) 必填
+*/
+function getBidIsColl () {
+  collectClick()
+  var bids = ""
+  var dataId = ""
+  // 区分标题搜索和全文搜索收藏
+  var allSearch = selectType.indexOf('content') > -1 && $("#zbSeatchT [name='keywords']").val() !==""
+  // console.log('当前是否显示的是全文',allSearch)
+  var $dom = allSearch ? $('.all-text-checkbox[name="bid-list"]') : $('.title-text-checkbox[name="bid-list"]')
+  $dom.each(function() {
+    if ($(this).attr('dataid')) {
+      dataId = $(this).attr("dataid");
+      if(bids != ""){
+        bids += ",";
+      }
+      bids += dataId;
+    }
+  })
+  $.ajax({
+    type:'post',
+    url:'/publicapply/bidcoll/isColl?t=' + Date.now(),
+    data: {
+      bids: bids
+    },
+    dataType:'json',
+    success: function(r){
+      if (r.data) {
+        var data = r.data
+        $('.icon-collect').removeClass('checked')
+        data.forEach(function(item,index){
+          if (selectType == 'title') {
+            $('.icon-collect[dataid="' + item + '"]').addClass('checked')
+          } else {
+            $('.icon-collect[dataid="' + item + '"]').addClass('checked')
+          }
+        })
+      }
+    }
+  })
+}
+
+// 收藏点击事件
+function collectClick() {
+  // console.log(vipState, '是否是超级订阅用户')
+  // 单个收藏点击事件
+  $('.icon-collect').unbind('click').on('click',function(e) {
+    // 登录判断
+    if (!loginflag) {
+      openLoginDig()
+      return
+    }
+    baiduEvent('列表页标讯收藏-星标') // 百度统计代码
+    e.stopPropagation()
+    var $that = $(this)
+    var checked = $(this).hasClass('checked')
+    var checkedId =  $(this).attr('dataid')
+    var binfo = [{
+      bid: checkedId
+    }]
+    if (checked) {
+      // 单个取消收藏行为
+      collBidAction('R', binfo, function(res) {
+        if (res.data) {
+          if (selectType == 'title') {
+            // 标题搜索下相关样式
+            // $that.removeClass('checked').parents().siblings('input[type="checkbox"]').prop("checked",false).removeAttr('disabled')
+            $that.removeClass('checked')
+          } else {
+            // 全文搜索下相关样式
+            // $that.removeClass('checked').parents('.luce-right').siblings().find('input[type="checkbox"]').prop("checked",false).removeAttr('disabled')
+            $that.removeClass('checked')
+          }
+          toastFn('已取消收藏', 800)
+        } else {
+          toastFn(res.error_msg, 1000)
+        }
+      })
+    } else {
+      // 单个收藏行为
+      vm.dialogTitle = '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务'
+      // 查询是否需要用户留资料 不需要 则执行下一步回调(收藏标讯行为)
+      vm.isNeedSubmit('article_collection',function() {
+        sessionStorage.setItem('$save-tags-binfo', JSON.stringify(binfo)) // 将本次收藏的标讯id缓存起来 用于绑定标签时使用
+        collBidAction('C', binfo, function(res) {
+          if (res.data) {
+            toastFn('收藏成功', 1500)
+            if (selectType == 'title') {
+              $that.addClass('checked')
+            } else {
+              $that.addClass('checked')
+            }
+            var top = (parseInt($that.position().top) + 50 ) + 'px';
+            $('.tags-box').show(function(){
+              activeTags = []
+              $('.tag-labels').empty()
+              $('.clear-input').val('')
+              $('.tags-list').find('.tags-item').removeClass('tags-active')
+              $('.tag-placeholder').show()
+            }).css('top', top)
+            getUserTags()
+          } else {
+            // 是超级订阅用户或者其他付费用户
+            if (vipState || res.error_msg.indexOf('付费') > -1) {
+              toastFn('您的标讯收藏上限为5000条,请联系客服人员。', 1500)
+            } else {
+              updateVipDialog('标讯收藏满100条-去升级')
+            }
+          }
+        })
+      }, $(this))
+    }
+  })
+  // 批量收藏
+  $('#bid-collect').off('click').bind('click',function(e){
+    // 登录判断
+    if (!loginflag) {
+      openLoginDig()
+      return
+    }
+    baiduEvent('列表页标讯收藏-星标') // 百度统计代码
+    e.stopPropagation()
+    var top = (parseInt($(this).position().top) + 60 ) + 'px';
+    var len = $('.custom-checkbox:not(".check-all"):checked').length;
+    var checkedId = [] // 提交后端需要的标讯id数组
+    var leftArr = [] // checkbox选中的数据
+    var rightArr = [] // 当前已收藏过的数据
+    var notSameArr = [] // 选中的数据 与 收藏过的数据相比不同的数组
+    $('.custom-checkbox:not(".check-all"):checked').each(function(){
+      if ($(this).attr('dataid')) {
+        checkedId.push({
+          bid: $(this).attr('dataid')
+        })
+        leftArr.push($(this).attr('dataid'))
+      }
+    })
+    $('.icon-collect.checked').each(function() {
+      if ($(this).attr('dataid')) {
+        rightArr.push($(this).attr('dataid'))
+      }
+    })
+    var $that = $(this)
+    // 判断有无选中的标讯信息
+    if (len > 0 || selectDataIds.length > 0) {
+      selectDataIds.forEach(function(v) {
+        checkedId.push({
+          bid: v
+        })
+      })
+      checkedId = arrUnique(checkedId)
+      if(leftArr.length <= rightArr.length) {
+        for (key in leftArr) {
+          var stra = leftArr[key];
+          var count = 0;
+          for (var j = 0; j < rightArr.length; j++) {
+            var strb = rightArr[j];
+            if (stra == strb) {
+              count++;
+            }
+          }
+          if (count === 0) { //表示数组1的这个值没有重复的,放到notSameArr列表中
+            notSameArr.push(stra);
+          }
+        }
+        // 如果没有不同的值 即为选中的标讯都已收藏过 有不同的值即为有未收藏的标讯
+        // console.log(notSameArr, 'notSameArr')
+        if(notSameArr.length == 0) {
+          toastFn('已收藏', 800)
+          return
+        }
+      }
+      vm.dialogTitle = '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务'
+      // 查询是否需要用户留资料 不需要 则执行下一步回调(批量收藏标讯行为)
+      vm.isNeedSubmit('article_collection', function() {
+        sessionStorage.setItem('$save-tags-binfo', JSON.stringify(checkedId)) // 将本次收藏的标讯id缓存起来 用于绑定标签时使用
+        collBidAction('C', checkedId, function(res) {
+          if (res.data) {
+            toastFn('收藏成功', 1500)
+            if (selectType == 'title') {
+              $('.custom-checkbox:not(".check-all"):checked').siblings().children('.icon-collect').addClass('checked')
+            } else {
+              $('.custom-checkbox:not(".check-all"):checked').parents('.liLuceneList').find('.icon-collect').addClass('checked')
+            }
+            // 收藏成功后再查一次收藏状态,为了区分达到收藏上限点时部分收藏成功,部分收藏失败
+            getBidIsColl()
+            // 弹出标签弹框时 清除上次选择的标签
+            $('.tags-box').show().css('top', top)
+            getUserTags()
+          } else {
+            // 是超级订阅用户或者其他付费用户
+            if (vipState || res.error_msg.indexOf('付费') > -1) {
+              toastFn('您的标讯收藏上限为5000条,请联系客服人员。', 1500)
+            } else {
+              updateVipDialog('标讯收藏满100条-去升级')
+            }
+          }
+        })
+      })
+    } else {
+      toastFn('尚未选择标讯,请选择', 1000)
+    }
+  })
+}
+
+/**
+ * @date 2022/12/15 山川环境嵌入搜索
+ * 山川应用嵌入环境 特殊处理
+ */
+
+var InBIInjectHooks = {
+  // 已添加的标讯信息
+  ids: [],
+  // 获取已添加的标讯信息
+  getInfoIds: function () {
+    $.ajax({
+      url: '/jyapi/biService/getInfoId',
+      type: 'POST',
+      success: function (res) {
+        if (Array.isArray(res.data)) {
+          this.ids = res.data
+          this.upDateView()
+        }
+      }.bind(this)
+    })
+  },
+  // 添加标讯信息
+  setInfoId (ids) {
+    $.ajax({
+      url: '/jyapi/biService/addProject',
+      type: 'POST',
+      contentType: 'application/json',
+      data: JSON.stringify({
+        info_id: ids.join(','),
+        source: 2
+      }),
+      success: function () {
+        this.getInfoIds()
+        if (ids.length > 1) {
+          selectDataIds = []
+          $('.custom-checkbox').prop("checked", false)
+        }
+      }.bind(this)
+    })
+  },
+  // 刷新视图
+  upDateView () {
+    var _this = this
+    $(".liLuceneList").each(function () {
+      var nowId = $(this).find('.custom-checkbox').attr('dataid')
+      var hasNowId = _this.ids.indexOf(nowId) !== -1
+
+      // 刷新 dom 状态
+      $(this).find('.bi-report-inject-button').text(hasNowId ? '已添加' : '添加')
+      $(this).find('.custom-checkbox').prop('disabled', hasNowId)
+    })
+  },
+  getCheckIds () {
+    return selectDataIds || []
+  },
+  checkInBI () {
+    var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
+    return inInjectBI
+  },
+  check () {
+    if (this.checkInBI()) {
+      // 获取数据
+      this.getInfoIds()
+    }
+  },
+  inject () {
+    if (this.checkInBI()) {
+      $("body").addClass('in-iframe in-bi')
+
+      // 仅展示信息-结果类型
+      $(".bi-mark.parent-node").trigger('click')
+
+      var _this = this
+      // 添加按钮点击事件
+      $("body").on('click', '.bi-report-inject-button', function () {
+        var nowStatus = $(this).text() === '已添加'
+        if (nowStatus) {
+          return
+        }
+        var nowId = $(this).attr('data-id')
+        var isAllButton = nowId === 'all'
+        // 批量添加
+        if (isAllButton) {
+          _this.setInfoId(_this.getCheckIds())
+        } else {
+          // 单个添加
+          _this.setInfoId([nowId])
+        }
+      })
+
+      // 获取数据
+      this.getInfoIds()
+    }
+  }
+}
+
+$(function () {
+  InBIInjectHooks.inject()
+})
+
+function arrUnique(arr){
+  let ojb = {};
+  arr = arr.reduce(function(prevArr, currentItem) {
+    //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
+      ojb[currentItem.bid] ? '' : ojb[currentItem.bid] = true && prevArr.push(currentItem);
+      return prevArr
+  }, [])
+  return arr;
+}
+
+function openBigMemberDialog (str, content) {
+  $('.auth-dialog').show()
+  $('.auth-dialog .dialog-title').text('您暂无使用权限')
+  $('.auth-dialog .dialog-content').html(content ||  '开通大会员,查看更多招标项目,畅享商机不受限!')
+  $('.auth-dialog .default-btn').click(function () {
+    $('.auth-dialog').hide(300)
+  })
+  $('.auth-dialog .confirm-btn').text('免费体验')
+  $('.auth-dialog .confirm-btn').off('click').bind('click',function () {
+    var advName = '招标搜索' + str + '-去开通'
+    baiduEvent(advName) // 点击去开通事件 百度统计
+    $('.auth-dialog').hide(300)
+    vm.dialogTitle = '免费用户查看超过500条招标搜索结果'
+    vm.isNeedSubmit('jylab_see500_plus', function () {
+      vm.showSuccess = true
+    })
+  })
+}
+
+// 开通提醒弹框
+function  openVipDialog(str, content) {
+  $('.auth-dialog').show()
+	$('.auth-dialog .dialog-title').text('开通超级订阅')
+  $('.auth-dialog .dialog-content').html(content ||  '立享更多搜索权限,寻找商机更精准')
+  $('.auth-dialog .default-btn').click(function () {
+    $('.auth-dialog').hide(300)
+  })
+	$('.auth-dialog .confirm-btn').text('去开通')
+  $('.auth-dialog .confirm-btn').off('click').bind('click',function () {
+    var advName = '招标搜索' + str + '-去开通'
+    baiduEvent(advName) // 点击去开通事件 百度统计
+    window.open('/swordfish/page_big_pc/free/svip/buy')
+  })
+}
+// 升级提醒弹框
+function  updateVipDialog(str) {
+  $('.update-dialog').show()
+  $('.update-dialog .default-btn').click(function () {
+    $('.update-dialog').hide(300)
+  })
+  $('.update-dialog .confirm-btn').off('click').bind('click',function () {
+    baiduEvent(str) // 点击去升级事件 百度统计
+    window.open('/front/subscribe.html')
+  })
+}
+// 列表页收藏点击事件 百度统计
+function baiduEvent(name) {
+  // console.log(name, 'name')
+  try {
+    _hmt.push(['_trackEvent', '超级订阅-pc', 'click', name]);
+  } catch (e) {
+    console.log('未初始化百度统计')
+  }
+}
+
+// toast上限提示
+function toastFn (text, duration) {
+  if (duration) {
+    duration = 1000
+  }
+  var _html = ""
+  _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
+  _html+='<span>' + text + '</span></div></div>'
+  $('body').append(_html)
+	setTimeout(function(){
+		$(".custom-toast").fadeOut().remove();
+	},duration)
+}
+function gologin (link) {
+    window.location.href=link
+
+}
+
+// 是否有权限
+// isPower()
+function isPower () {
+  $.ajax({
+    type:'post',
+    url:'/publicapply/bidcoll/power?t=' + Date.now(),
+    success: function(r){
+      if (r.data) {
+        var entniche = r.data.entniche
+        var member = r.data.member
+        var vip = r.data.vip
+        if (entniche || member || vip > 0) {
+          return 'true'
+        } else {
+          return 'false'
+        }
+      } else {
+        return 'false'
+      }
+    }
+  })
+}
+

+ 287 - 306
src/web/staticres/js/superSearch.js

@@ -3,6 +3,17 @@ var nbflag = false;//是否显示的是最新招标数据
 var currentPage = 1;//当前页
 var submitflag = true;
 var tabularflag = "Y";
+console.log(vipState, goTemplateData);
+var tParams = goTemplateData.params
+if (!(tParams.isEntniche || tParams.isVip || tParams.isMember)) {
+  localStorage.setItem('login-clear-bidsearch-list-model', 'S')
+}
+var listModel = localStorage.getItem('login-clear-bidsearch-list-model') || 'S' // 列表精简or详细 S:精简 D:详细
+// 采购单位画像中转页
+var buyerLink = '/swordfish/page_big_pc/free/loading/buyer/'
+// 企业画像中转页
+var winnerLink = '/swordfish/page_big_pc/free/loading/ent/'
+
 $(function() {
 	priceTime();
 	$(".Price-content").find("span:first-child").click(function(){
@@ -44,17 +55,7 @@ $(function() {
 		beforeSubmit()
 	})
 	//
-	$(".nbprev").click(function(){
-		$(window).scrollTop(0);
-		$('.custom-checkbox.check-all').prop('checked', false)
-		prev();
-	})
-	$(".nbnext").click(function(){
-    	$(window).scrollTop(0);
-    	$('.custom-checkbox.check-all').prop('checked', false)
-		next();
 
-	})
 	//筛选关闭和打开
 	//根据cookie值设置筛选是否显示 移除该需求操作
 	// var rsw = localStorage.getItem("hideorshow");
@@ -96,7 +97,7 @@ $(function() {
 	})
 	//全文检索和标题检索切换
 	$("#newsclass li:nth-child(2)").click(function(){
-    // searchInnerVue.listState.total = totalPage
+    // searchInnerVue.listState.totalPage = totalPage
     // 重置全选按钮
     $('.custom-checkbox.check-all').prop('checked', false)
 		$(".tabContainer-2 .lucene ul").html("");
@@ -144,100 +145,22 @@ $(function() {
 
   })
 })
-//
-function next(){
-	if($(".nbnext").hasClass("disabled")){
-		return false;
-	}
-	$(".hasNoData").hide();
-	$(".working").show();
-	$(".tabContainer").hide();
-	$("#allnews").hide();
-	$(".pagination").hide();
-	currentPage = parseInt($(".pagination-inner").find("span").text())+parseInt(1)
-	if(currentPage==10){
-		$(".nbnext").addClass("disabled");
-	}else if(currentPage==2){
-		$(".nbprev").removeClass("disabled");
-	}
-	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
-		getNewBids(currentPage);
-	}else{
-		if(!$("#right-table").hasClass("active")){
-			if(secondFlag=="T"){
-				$(".tabContainer").show();
-				$(".hasNoData").hide();
-				$(".nbnext").addClass("disabled");
-				appendDatas(secondList,true,false);
-			}else if(!nbflag&&currentPage<11){
-				getNewBiddings();
-			}else{
-				searchOnsubmit(true);
-			}
-		}else{
-//表格点击下一页
-//			if(secondFlag=="T"){
-//				$(".tabContainer").show();
-//				$(".hasNoData").hide();
-//				$(".nbnext").addClass("disabled");
-//				appendDatas(secondList,true,false);
-//			}else{
-//				getVIPData(true);
-//			}
-		}
-	}
-}
-function prev(){
-	if($(".nbprev").hasClass("disabled")){
-		return false;
-	}
-	$(".hasNoData").hide();
-	$(".working").show();
-	$(".tabContainer").hide();
-	$("#allnews").hide();
-	$(".pagination").hide();
-	currentPage = parseInt($(".pagination-inner").find("span").text())-parseInt(1)
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}else if(currentPage<10){
-		$(".nbnext").removeClass("disabled");
-	}
-	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
-		getNewBids(currentPage);
-	}else{
-		if(!$("#right-table").hasClass("active")){
-			if(secondFlag=="T"){
-				$(".tabContainer").show();
-				$(".hasNoData").hide();
-				//$(".nbnext").addClass("disabled");
-				appendDatas(list,true,false);
-			}else if(!nbflag&&currentPage>0){
-				getNewBiddings();
-			}else{
-				searchOnsubmit(true);
-			}
-		}else{
-//表格点击上一页
-//			getVIPData(true);
-		}
-	}
-}
 
 //取redis里的数据
 function getNewBids(pnum, size){
-	$.post("/jylab/supsearch/getNewBids",{pageNumber:pnum,pageSize: size? size : pageSize, pageType:"", fileExists: $("#zbSeatchT [name='fileExists']").val(),bid_field: $("#zbSeatchT [name='bid_field']").val()},function(r){
+	$.post("/jylab/supsearch/getNewBids",{
+    pageNumber:pnum,
+    pageSize: size? size : pageSize, 
+    pageType:"", 
+    fileExists: $("#zbSeatchT [name='fileExists']").val(),
+    bid_field: $("#zbSeatchT [name='bid_field']").val(),
+    searchGroup: $("#zbSeatchT [name='searchGroup']").val()
+  },function(r){
 		if(r&&r.list!=null&&r.list.length>0){
 			$(".tabContainer").show();
-			//$(".pagination").show();
 			$(".hasNoData").hide();
-			//$(".pagination-inner").find("span").text(currentPage);
-			if(r.list.length<pageSize||currentPage==10){
-				$(".nbnext").addClass("disabled");
-			}else{
-				$(".nbnext").removeClass("disabled");
-      }
-      searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
-      searchInnerVue.checkPageNumAdd1()
+      searchInnerVue.listState.totalPage = Math.ceil(r.count/pageSize)
+      // searchInnerVue.checkPageNumAdd1()
       if (size) {
         appendDatas(r.list,false,true, true);
       } else {
@@ -252,17 +175,14 @@ function getNewBids(pnum, size){
       // 隐藏页码
       searchInnerVue.showPage = false
     }
+    allCount = r.total
+    searchInnerVue.listState.allCount = r.total
     // getBidIsColl()
 	})
 }
 
 ////最新招标信息
 function getNewBiddings(num, size){
-	// $("#newsclass").hide();
-	// $("#newsnow").show();
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}
 	var param = {
     pageNumber: num ? num : currentPage,
     pageSize: size ? size : pageSize,
@@ -279,27 +199,27 @@ function getNewBiddings(num, size){
     buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
     buyertel: $("#zbSeatchT [name='buyertel']").val(),
     winnertel: $("#zbSeatchT [name='winnertel']").val(),
-    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    notkey: $("#zbSeatchT [name='notkey']").val(),
     fileExists: $("#zbSeatchT [name='fileExists']").val(),
     city: $("#zbSeatchT [name='city']").val(),
-    bid_field: $("#zbSeatchT [name='bid_field']").val()
+    bid_field: $("#zbSeatchT [name='bid_field']").val(),
+    searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
+    searchMode: $("#zbSeatchT [name='searchMode']").val(),
+    wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
+    additionalWords: $("#zbSeatchT [name='additionalWords']").val()
   };
 	$.post("/front/pcAjaxReq",param,function(r){
+    heightWords = r.heightWords
 		if(r&&r.list!=null&&r.list.length>0){
       // 计算总页码
       if (currentPage == 1) {
-        searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
-        searchInnerVue.checkPageNumAdd1()
+        searchInnerVue.listState.totalPage = Math.ceil(r.count/pageSize)
+        allCount = r.total
+        searchInnerVue.listState.allCount = r.total
+        // searchInnerVue.checkPageNumAdd1()
       }
 			$(".tabContainer").show();
-			//$(".pagination").show();
 			$(".hasNoData").hide();
-			//$(".pagination-inner").find("span").text(currentPage);
-			if(r.list.length<pageSize||currentPage==10){
-				$(".nbnext").addClass("disabled");
-			}else{
-				$(".nbnext").removeClass("disabled");
-			}
       if (size && num === 1) {
 			  appendDatas(r.list,true,true, true);
       } else {
@@ -307,10 +227,6 @@ function getNewBiddings(num, size){
       }
 		}else{
 			if(currentPage>1){
-				$(".nbnext").addClass("disabled");
-				if(currentPage==2){
-					$(".nbprev").addClass("disabled");
-				}
 				currentPage = currentPage-1;
 				return false
 			}
@@ -321,7 +237,10 @@ function getNewBiddings(num, size){
       $(".hasNoData").show();
       // 隐藏页码
       searchInnerVue.showPage = false
+      allCount = 0
+      searchInnerVue.listState.allCount = 0
     }
+    autoModelFn(r)
 	})
 }
 //
@@ -335,20 +254,16 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 	var tableHtml = '';
 	$(".working").hide();
   $(".pagination").show();
-  // 显示页码
-  searchInnerVue.showPage = true
-	var searchvalueArray = searchvalue.split("+");
+  // 列表模式下显示页码 表格模式下隐藏
+  if (searchInnerVue.dataTab == 'list') {
+    searchInnerVue.showPage = true
+  } else {
+    searchInnerVue.showPage = false
+  }
+	var searchvalueArray = heightWords.split(" ");
+  // console.log('需要高亮的关键词、附加词组:' + searchvalueArray)
 	$(".pagination-inner").find("span").text(currentPage);
-	if(datas.length<pageSize){
-		$(".nbnext").addClass("disabled");
-	}
-	if(!isNew && typeof(totalPage) != "undefined"){
-		if(currentPage == totalPage){
-			$(".nbnext").addClass("disabled");
-		}else{
-			$(".nbnext").removeClass("disabled");
-		}
-	}
+
 	//(数据够20条显示查看更多遮罩层)
 	if (currentPage==1){//第一页得时候需要判断 是否显示遮罩层
 		if(datas.length>=20){
@@ -368,14 +283,16 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 				detail = detail.substring(0,200)+"..."
 			}
 		}
-		if(flag){
+		// if(flag){
 			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
 			title=title.replace(/\<br>/g,"")
-			detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
-		}
-		if(title.length<40){
-				title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
-		}
+      if (detail) {
+			  detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
+      }
+		// }
+		// if(title.length<40){
+		// 		title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
+		// }
 		var type = datas[i].subtype;
 		if(typeof(type) == "undefined" || type == null || type == ""){
 			type = datas[i].toptype;
@@ -395,133 +312,159 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 
 		if (!onlyUpdateTable){ //是否仅更新table
 			listHtml += '<li>'
-			//if(datas.length==(i+1)){
-			//	listHtml +='<div class="liLuceneList">'
-			//}else{
-				listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
-      //}
-      // 标题搜索 选择框
-      if (!selectContext || !flag) {
-        listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
-        listHtml +='<div class="luce-left">'
-		if(datas[i].site == '剑鱼信息发布平台') {
-			listHtml += '<span class="userPublish">用户发布</span>'
-		}
-		listHtml += '<em class="visited-hd">'+index+'.</em>'
-						+'<div class="left-title" style="width:auto;max-width:700px">'
-						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
-        if(fileExists) {
-          listHtml+='<span class="haveFile">'+'有附件'+'</span>'
-        }
-        listHtml+='</div>'
-      }
-      // 全文搜索
-			if(flag && selectContext){
-				listHtml +='<div class="luce-left">'
-				if(datas[i].site == '剑鱼信息发布平台') {
-					listHtml += '<span class="userPublish">用户发布</span>'
-					listHtml += '<em class="visited-hd">'+index+'.</em>'
-						+'<div class="left-title" style="width:auto;max-width:1080px">'
-						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
-				} else {
-					listHtml +='<em class="visited-hd" style="padding-left:30px;">'+index+'.</em>'
-						+'<div class="left-title" style="width:auto;max-width:1080px">'
-						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
-				}
-				if(fileExists) {
-					listHtml+='<span class="haveFile">'+'有附件'+'</span>'
-				}
-				listHtml+='</div>'
-				// 全文搜索选择框
-				listHtml += '<div class="left-content" style="width:100%;padding:0;">'
-					+ '<input class="custom-checkbox all-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
-					+'<a style="float:left;width:calc(100% - 32px)" href="javascript:volid(0);">'+detail+'...</a>'
-					+'</div>'
-			}
-			listHtml += '</div><div class="luce-right">'
-			if($.trim(datas[i].area) != "" && datas[i].area != "A"){
-
-          listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
-			}else{
-				listHtml += '<a href="#" style="display:none;"></a>';
-			}
-			if(typeof(type) != "undefined" && type != null && type != ""){
-				// listHtml += '<a href="/list/stype/'+datas[i].stypeadd+'.html">'+type+'</a>';
-        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
-			}else{
-				listHtml += '<a href="#" style="display:none;"></a>';
-			}
-			//
-			if(typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field){
-				// listHtml += '<a href="/list/industry/'+datas[i].indadd+'.html">'+datas[i].industry+'</a>';
-        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
-			}else{
-				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
-      }
-      // vipState付费用户显示采购单位类型 免费用户不显示
-      // if(typeof(datas[i].buyerclass) != "undefined" && datas[i].buyerclass != null && datas[i].buyerclass != "" && vipState){
-			// 	listHtml += '<a href="javascript:;">'+datas[i].buyerclass+'</a>';
-			// }else{
-			// 	listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
-			// }
-
-			var amount= getacount(datas[i].bidamount,datas[i].budget)
-			if(amount!=""){
-				listHtml += '<a>'+conversionMoeny(amount)+'</a>';
-			}else{
-				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
-			}
-
-			//
-			if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
-				var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
-				if(diff != null){
-					listHtml += '<span class="com-time">'+diff+'</span>';
-				}
-      }
-      // 是否收藏
-      listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
-      // 是否山川应用嵌入环境 添加操作按钮
-      var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
-      if (inInjectBI) {
-        listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
-      }
-      listHtml += '</div>'
-
-
-      //领域化展示 商品&采购单位&中标单位
-      if (is_field && !selectContext){
-        listHtml += '<div class="luce-field">'
-        if (typeof(datas[i].purchasing) != "undefined" && datas[i].purchasing != null && datas[i].purchasing != ""){
-          listHtml += '<div class="nowrap"><span>产品</span><span>'+datas[i].purchasing +'</span></div>'
-        }
-
-        let secondLine=''
-        if (typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
-          secondLine += '<div class="nowrap"><span>采购单位</span><span>'+datas[i].buyer +'</span></div>'
-        }
-
-        if (typeof(datas[i].s_winner) != "undefined" && datas[i].s_winner != null && datas[i].s_winner != ""){
-          secondLine += '<div class="nowrap"><span>中标单位</span><span>'+datas[i].s_winner +'</span></div>'
-        }
-
-        if (secondLine!=='') {
-          listHtml += '<div class="secondLine">'+secondLine+'</div>'
-        }
-
-        listHtml += '</div>'
-      }
-
-      listHtml += '</div></li>';
-
-			if(i == 5) {
+        listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
+          listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+          listHtml +='<div class="list-container">'
+            // 标题、推送时间
+            listHtml += '<div class="bid-list-title">'
+                     + '<div class="list-title-flex  ellipsis"><em class="visited-hd">'+index+'.</em>'
+                     + '<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a></div>'
+                     if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
+                      var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
+                      if(diff != null){
+                        listHtml += '<span class="com-time">'+diff+'</span>';
+                      }
+                    }
+            listHtml += '</div>'
+            // 正文
+            if(selectContext && detail) {
+              listHtml += '<div class="bid-list-content">' + detail + '</div>'
+            }
+            // 分类标签、收藏
+            listHtml += '<div class="bid-list-tags">'
+                +'<div>'
+                if (datas[i].site == '剑鱼信息发布平台') {
+                  listHtml += '<span class="tags-item tags-publish">用户发布</span>'
+                }
+                if ($.trim(datas[i].area) != "" && datas[i].area != "A") {
+                  listHtml += '<a class="tags-item" href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
+                } else {
+                  listHtml += '<a href="#" style="display:none;"></a>';
+                }
+                if (typeof(type) != "undefined" && type != null && type != "") {
+                  listHtml += '<a class="tags-item" href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
+                } else {
+                  listHtml += '<a href="#" style="display:none;"></a>';
+                }
+                if (typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field) {
+                  listHtml += '<a class="tags-item tags-industry" href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
+                } else {
+                  listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+                }
+                var amount= getacount(datas[i].bidamount,datas[i].budget)
+                if (amount!="") {
+                  listHtml += '<a class="tags-item">'+conversionMoeny(amount)+'</a>';
+                } else {
+                  listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+                }
+                // 附件
+                if (fileExists) {
+                  listHtml+='<span class="tags-item tags-file">'+'有附件'+'</span>'
+                }
+                listHtml+='</div>'
+                // // 是否收藏
+                listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
+                // 是否山川应用嵌入环境 添加操作按钮
+                var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
+                if (inInjectBI) {
+                  listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
+                }
+            listHtml += '</div>'
+            // 详细列表内容
+            if (listModel === 'D') {
+              listHtml += '<div class="bid-detail-info" data-subtype='+ datas[i].subtype +'>'
+                if (datas[i].buyer || datas[i].buyertel || datas[i].budget) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].buyer) {
+                      listHtml += '<span><i class="d-i-item-label">采购单位:</i>'
+                      // 可能是多个采购单位(测试环境出现过)
+                      if (datas[i].buyer.indexOf('、') > -1) {
+                        var buyerArr = datas[i].buyer.split('、')
+                        console.log(buyerArr);
+                        for(var j = 0; j< buyerArr.length;j++) {
+                          var dun = j != buyerArr.length - 1 ? '<i class="highlight-text">、</i>' : ''
+                          listHtml += '<a class="highlight-text" href="' + buyerLink + buyerArr[j] +'" target="_blank">'+ buyerArr[j]+ '</a>' + dun
+                        }
+                      } else {
+                        listHtml += '<a class="highlight-text" href="' + buyerLink + datas[i].buyer +'" target="_blank">'+ datas[i].buyer+ '</a>'
+                      }
+                      listHtml += '</span>'
+                    }
+                    if (datas[i].buyertel) {
+                      datas[i].buyerperson = datas[i].buyerperson  ? datas[i].buyerperson +',' : ''
+                      listHtml += '<span><i class="d-i-item-label">采购单位联系方式:</i>'+ datas[i].buyerperson + datas[i].buyertel + '<a class="highlight-text" href="' + buyerLink + datas[i].buyer + '?position=contact" target="_blank"> 获取更多</a></span>'
+                    }
+                    if (datas[i].budget) {
+                      listHtml += '<span><i class="d-i-item-label">预算金额:</i>' + conversionMoeny(datas[i].budget) + '</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                if (datas[i].agency || datas[i].agencytel) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].agency) {
+                      listHtml += '<span><i class="d-i-item-label">代理机构:</i>' + datas[i].agency + '</span>'
+                    }
+                    if (datas[i].agencytel) {
+                      datas[i].agencyperson = datas[i].agencyperson  ? datas[i].agencyperson +',' : ''
+                      listHtml += '<span><i class="d-i-item-label">代理机构联系方式:</i>' + datas[i].agencyperson + datas[i].agencytel + '</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                if (datas[i].winnerInfo || datas[i].winnertel || datas[i].bidamount) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].winnerInfo) {
+                      listHtml += '<span><i class="d-i-item-label">中标单位:</i>'
+                      for(var j=0;j<datas[i].winnerInfo.length;j++) {
+                        var dun = j != datas[i].winnerInfo.length - 1 ? '<i class="highlight-text">、</i>' : ''
+                        listHtml +='<a class="highlight-text" href="' + winnerLink + datas[i].winnerInfo[j].winnerId +'" target="_blank">'+ datas[i].winnerInfo[j].winner+ '</a>'+ dun
+                      }
+                      listHtml +='</span>'
+                    }
+                    if (datas[i].winnertel && datas[i].winnerInfo) {
+                      // 如果有两个中标单位则不显示‘获取更多’,只有一个中标单位显示‘获取更多’并跳到画像通讯录锚点位置
+                      var moreWinnerTel = datas[i].winnerInfo && datas[i].winnerInfo.length > 1 ? '' :'<a class="highlight-text" href="' + winnerLink + datas[i].winnerInfo[0].winnerId + '?position=contact" target="_blank"> 获取更多</a></span>'
+                      datas[i].winnerperson = datas[i].winnerperson  ? datas[i].winnerperson +',' : ''
+                      listHtml += '<span><i class="d-i-item-label">中标单位联系方式:</i>' + datas[i].winnerperson + datas[i].winnertel + moreWinnerTel +'</span>'
+                    }
+                    if (datas[i].bidamount) {
+                      listHtml += '<span><i class="d-i-item-label">中标金额:</i>'+ conversionMoeny(datas[i].bidamount) +'</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                if (datas[i].signendtime || datas[i].bidendtime || datas[i].bidopentime) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].signendtime) {
+                      listHtml += '<span><i class="d-i-item-label">报名截止日期:</i>' + utils.dateFromNow(Number(datas[i].signendtime+"000")) +'</span>'
+                    }
+                    if (datas[i].bidendtime) {
+                      listHtml += '<span><i class="d-i-item-label">投标截止日期:</i>' + utils.dateFromNow(Number(datas[i].bidendtime+"000")) + '</span>'
+                    }
+                    if (datas[i].bidopentime) {
+                      listHtml += '<span><i class="d-i-item-label">开标日期:</i>' + utils.dateFromNow(Number(datas[i].bidopentime+"000")) + '</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                //领域化展示 商品&采购单位&中标单位
+                if (is_field){
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].purchasing) {
+                      listHtml += '<span><i class="d-i-item-label">产品:</i>' + datas[i].purchasing +'</span>'
+                    }
+                  listHtml +='</p>'
+                }
+              listHtml += '</div>'
+            }
+          listHtml += '</div>'
+        listHtml +='</div>'
+      listHtml += '</li>'
+      if(i == 5) {
 				listHtml += '<div data-list-ad class="_t3di2018y5"></div>'
 			}
 			if(i == 26) {
 				listHtml += '<div data-list-ad class="_6omliqck79a"></div>'
 			}
 		}
-
+ 
 		//表格仅显示前20条信息
 		if (i >= 20||currentPage!=1){
 			continue
@@ -636,6 +579,12 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
    * 更新是否已添加状态
    */
   InBIInjectHooks.check()
+  // 信息类型是“采购意向”和“拟建项目”,无采购意向和拟建项目权限的超级订阅用户(老超级订阅用户),即使选择详细列表,也按照精简列表展示
+  // 大会员、商机管理、超级订阅(配置时间之前的老用户)有超前项目权限
+  if (!goTemplateData.params.vipBefore202209 && !goTemplateData.params.isMember && !goTemplateData.params.isEntniche) {
+    $('.bid-detail-info[data-subtype="拟建"]').hide()
+    $('.bid-detail-info[data-subtype="采购意向"]').hide()
+  }
 }
 
 function getacount(bidamount,budget){
@@ -775,9 +724,6 @@ function getVIPData(clickpaging){
 		// $("#newsnow").show();
 		tlflag = false;
 	}
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}
 	var reqType="bidSearch";
 	if($("#zbSeatchT [name='keywords']").val()==""){
 		reqType="lastNews";
@@ -798,10 +744,14 @@ function getVIPData(clickpaging){
         buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
         buyertel: $("#zbSeatchT [name='buyertel']").val(),
         winnertel: $("#zbSeatchT [name='winnertel']").val(),
-		    notkey: $(".not-key-input-group input").val().slice(0, 10),
+		    notkey: $("#zbSeatchT [name='notkey']").val(),
         fileExists: $("#zbSeatchT [name='fileExists']").val(),
         city: $("#zbSeatchT [name='city']").val(),
-        bid_field: $("#zbSeatchT [name='bid_field']").val()
+        bid_field: $("#zbSeatchT [name='bid_field']").val(),
+        searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
+        searchMode: $("#zbSeatchT [name='searchMode']").val(),
+        wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
+        additionalWords: $("#zbSeatchT [name='additionalWords']").val()
       };
 	$.ajax({
        type:'post',
@@ -813,11 +763,6 @@ function getVIPData(clickpaging){
 			afterAjaxReq(r);
 			if(r&&r.list!=null&&r.list.length>0){
 				$(".hasNoData").hide();
-				if(r.list.length<pageSize||currentPage==10){
-					$(".nbnext").addClass("disabled");
-				}else{
-					$(".nbnext").removeClass("disabled");
-				}
 				// appendDatas(r.list,tlflag,true,true);
 				appendDatas(r.list,tlflag,true,false);
 			}else{
@@ -827,6 +772,7 @@ function getVIPData(clickpaging){
         searchInnerVue.showPage = false
 			}
       tabflag = true;
+      autoModelFn(r)
 		}
 	})
 	return tabflag
@@ -851,21 +797,20 @@ function beforeSubmit(n){
 	$(".tabContainer .lucene ul").html("");
 	//$(".tabContainer .lucene-table table tbody").html("");
 	$(".tabContainer").css("min-height","600px");
-	$("#right-list").addClass("active").siblings().removeClass("active");
+	// $("#right-list").addClass("active").siblings().removeClass("active");
 	$(".tabContainer-2 .lucene").show().siblings().hide();
-	$("#right-list").addClass("active").siblings().removeClass("active");
+	// $("#right-list").addClass("active").siblings().removeClass("active");
 	$("#allnews .lucene").show().siblings().hide();
 	$(".tabContainer-2").hide();
 	$("#allnews").hide();
 	$(".pagination").hide();
+  searchInnerVue.dataTab = 'list'
+  searchInnerVue.listModel = localStorage.getItem('login-clear-bidsearch-list-model')
 	setTimeout(function(){
     currentPage=1;
     // 重置element ui页码为1
     searchInnerVue.listState.num = 1
 		//时间
-		if(currentPage==1){
-			$(".nbprev").addClass("disabled");
-		}
 		var publishtime = null;
 		var timeslot = getInputTime().join("_");
 		if($(".timerInput").hasClass("active")){
@@ -993,8 +938,8 @@ function beforeSubmit(n){
     //中标单位联系方式有无
     $("#zbSeatchT [name='winnertel']").val($(".custom-input[name='winnertel']").attr('data-value'));
     //排除词
-	$("#zbSeatchT [name='notkey']").val($(".not-key-input-group input").val().slice(0, 10));
-		if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F"){
+	$("#zbSeatchT [name='notkey']").val($("#zbSeatchT [name='notkey']").val());
+		if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F" && !$("#zbSeatchT [name='additionalWords']").val()){
 			getNewBids(currentPage);
 		}else{
 			if(n!="F"){
@@ -1051,11 +996,7 @@ function searchOnsubmit(clickpaging){
 			return;
 		}
 	}
-	// $("#newsclass").show();
-	// $("#newsnow").hide();
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}
+	
 	var param = {
     pageNumber: currentPage,
     pageSize: pageSize,
@@ -1072,12 +1013,17 @@ function searchOnsubmit(clickpaging){
     buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
     buyertel: $("#zbSeatchT [name='buyertel']").val(),
     winnertel: $("#zbSeatchT [name='winnertel']").val(),
-    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    notkey: $("#zbSeatchT [name='notkey']").val(),
     fileExists: $("#zbSeatchT [name='fileExists']").val(),
     city: $("#zbSeatchT [name='city']").val(),
-    bid_field: $("#zbSeatchT [name='bid_field']").val()
+    bid_field: $("#zbSeatchT [name='bid_field']").val(),
+    searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
+    searchMode: $("#zbSeatchT [name='searchMode']").val(),
+    wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
+    additionalWords: $("#zbSeatchT [name='additionalWords']").val()
   };
 	$.post("/front/pcAjaxReq",param,function(r){
+    heightWords = r.heightWords
 		if(r.limitFlag){
 			LimitClass.limitFlag = true;
 			LimitClass.result = r;
@@ -1085,13 +1031,16 @@ function searchOnsubmit(clickpaging){
 			LimitClass.paging(currentPage);
       LimitClass.prevNoLimitFlag = false;
       // 重新分页
-      searchInnerVue.listState.total = r.totalPage
-      searchInnerVue.checkPageNumAdd1()
+      searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
+      allCount = r.total
+      searchInnerVue.listState.allCount = r.total
+      // searchInnerVue.checkPageNumAdd1()
 		}else{
 			LimitClass.prevNoLimitFlag = true;
       LimitClass.limitFlag = false;
       pcAjaxReqCallBack(r);
     }
+    autoModelFn(r)
     // getBidIsColl()
 	});
 }
@@ -1130,6 +1079,33 @@ $(function () {
 		showSearchTipForTimeRange(false);
 	},500)
 })
+
+function autoModelFn (r) {
+  var keywordFlag = $("#zbSeatchT [name='keywords']").val()
+  var addkeyFlag = $("#zbSeatchT [name='additionalWords']").val()
+  var sModel = $("#zbSeatchT [name='searchMode']").val()
+  // console.log(autoSwitchModel, sModel, (keywordFlag || addkeyFlag), r.list);
+  var jzFlag = !autoSwitchModel && sModel == 0 && (keywordFlag || addkeyFlag) && r.list == null
+  var mhFlag = autoSwitchModel && sModel == 1 && (keywordFlag || addkeyFlag)
+  if (jzFlag) {
+    console.log(jzFlag, '精准flag');
+    $("#zbSeatchT [name='searchMode']").val(1)
+    searchInnerVue.keywordSearchType = 1
+    beforeSubmit()
+    autoSwitchModel = true
+  }
+  if (mhFlag) {
+    console.log(mhFlag, '模糊flag');
+    if (r.list && r.list.length > 0) {
+      toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 5000)
+      autoSwitchModel = false
+    } else {
+      $("#zbSeatchT [name='searchMode']").val(0)
+      searchInnerVue.keywordSearchType = 0
+    }
+  }
+}
+
 function pcAjaxReqCallBack(r){
 	afterAjaxReq(r);
   var isAllSearch = $("#zbSeatchT [name='selectType']").val()=="all";
@@ -1153,10 +1129,6 @@ function pcAjaxReqCallBack(r){
 			$("#hasNoData_tiptext>font:eq(1)").show();
 		}else{
 			if(currentPage>1){
-				$(".nbnext").addClass("disabled");
-				if(currentPage==2){
-					$(".nbprev").addClass("disabled");
-				}
 				currentPage = currentPage-1;
 				return false
 			}
@@ -1171,13 +1143,17 @@ function pcAjaxReqCallBack(r){
 	}else{
 		//$(".tabContainer").show();
 		$(".hasNoData").hide();
+    searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize);
 		appendDatas(r.list,true,false)
+    
 	}
+  allCount = r.total
+  searchInnerVue.listState.allCount = r.total
 }
 function afterAjaxReq(r){
 	secondFlag=r.secondFlag;
-	if(r.interceptWord != ""){
-      	$("#intercept .interceptWord").text(r.interceptWord);
+	if(r.interceptOtherWord){
+      	$("#intercept .interceptWord").text(r.interceptOtherWord);
       	$("#intercept .interceptLimit").text(r.interceptLimit);
 		$("#intercept").removeClass("hidden");
 	}else{
@@ -1187,17 +1163,20 @@ function afterAjaxReq(r){
 		$(".searchname").val(r.keywords);
 	}
 	$(".side-bar-bottom-font").text("“"+$.trim($(".searchname").val()).replace(/\s+/," ")+"”");
-	if(secondFlag==""&&typeof(r.searchvalue) != "undefined"){
-		searchvalue = r.searchvalue;
-	}
+	// if(secondFlag==""&&typeof(r.heightWords) != "undefined"){
+	// 	heightWords = r.heightWords;
+	// }
+  heightWords = r.heightWords;
 	if(r.pcAjaxFlag=="T"){
-		searchvalue = r.searchvalue;
-		totalPage = r.totalPage;
+		// heightWords = r.heightWords;
+    totalPage = Math.ceil(r.count / pageSize)
 		list= r.list;
     secondList= r.secondList;
     // vue 重置总页数
-    searchInnerVue.listState.total = totalPage
-    searchInnerVue.checkPageNumAdd1()
+    searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize);
+    allCount = r.total
+    searchInnerVue.listState.allCount = r.total
+    // searchInnerVue.checkPageNumAdd1()
 	}
 	if(secondFlag==""&&typeof(totalPage) != "undefined" && currentPage == 1){
 		if (r.totalPage==1){
@@ -1206,13 +1185,15 @@ function afterAjaxReq(r){
 				totalPage=10;
       }
       // vue 重置总页数
-      searchInnerVue.listState.total = totalPage
-      searchInnerVue.checkPageNumAdd1()
+      searchInnerVue.listState.totalPage = totalPage
+      // searchInnerVue.checkPageNumAdd1()
 		}else{
-      totalPage = r.totalPage;
-      searchInnerVue.listState.total = totalPage
-      searchInnerVue.checkPageNumAdd1()
+      totalPage = Math.ceil(r.count / pageSize);
+      searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
+      // searchInnerVue.checkPageNumAdd1()
 		}
+    allCount = r.total
+    searchInnerVue.listState.allCount = r.total
 	}
 }
 
@@ -1619,7 +1600,7 @@ function baiduEvent(name) {
 
 // toast上限提示
 function toastFn (text, duration) {
-  if (duration) {
+  if (!duration) {
     duration = 1000
   }
   var _html = ""
@@ -1631,8 +1612,8 @@ function toastFn (text, duration) {
 	},duration)
 }
 function gologin (link) {
-    window.location.href=link
-
+    // window.location.href=link
+    window.open(link)
 }
 
 // 是否有权限

+ 42 - 9
src/web/staticres/pccss/ent-search-index-pc.css

@@ -23,7 +23,7 @@
     min-height: 400px;
 }
 .search-header {
-    padding: 29px 0 15px;
+    /* padding: 29px 0 15px; */
     background-color: #f5f5fb;
 }
 .search-content {
@@ -32,7 +32,8 @@
 }
 
 .search-header-content {
-    padding-left: 125px;
+    /* padding-left: 125px; */
+    padding: 24px 24px 24px 32px;
 }
 .search-header-top {
     display: flex;
@@ -45,7 +46,7 @@
     display: flex;
     align-items: center;
     padding: 0 20px;
-    height: 36px;
+    /* height: 36px; */
     cursor: pointer;
 }
 .input-container {
@@ -56,14 +57,17 @@
     align-items: center;
 }
 
-.el-input__prefix {
+.input-container .el-input__prefix {
     display: flex;
     align-items: center;
     justify-content: center;
-    left: 18px;
+    left: 16px;
 }
-.el-input--prefix .el-input__inner {
-    padding-left: 50px;
+.input-container .el-input--prefix .el-input__inner {
+    padding-left: 44px;
+    height: 36px;
+    line-height: 36px;
+    border-radius: 8px 0 0 8px;
 }
 .input-prefix-icon {
     display: flex;
@@ -74,7 +78,7 @@
     display: block;
 }
 .input-container .el-input-group {
-    width: 640px;
+    width: 528px;
 }
 .input-container .el-input__inner,
 .input-container .el-input-group__append {
@@ -83,9 +87,10 @@
 }
 .input-container .el-input-group__append {
     padding: 0;
-    font-size: 18px;
+    font-size: 16px;
     color: #fff;
     background-color: #2cb7ca;
+    border-radius: 0 8px 8px 0;
 }
 .pre-search-list {
     padding: 20px 0;
@@ -376,3 +381,31 @@
     color: #1d1d1d;
     line-height: 22px;
 }
+.search-header-tab{
+  padding: 0 16px;
+  height: 48px;
+  line-height: 48px;
+  border-bottom: 1px solid #ececec;
+}
+.tab-item{
+  display: inline-block;
+  padding: 0 16px;
+  height: 100%;
+  font-size: 16px;
+  cursor: pointer;
+}
+.tab-item.tab-active{
+  position: relative;
+  color: #2cb7ca;
+}
+.tab-item.tab-active::before{
+  position: absolute;
+  content: '';
+  left: 50%;
+  bottom: 0;
+  width: 64px;
+  height: 2px;
+  background: #2cb7ca;
+  transform: translateX(-50%);
+  z-index: 9;
+}

+ 40 - 7
src/web/staticres/pccss/pur-search-index-pc.css

@@ -23,7 +23,7 @@
     min-height: 400px;
 }
 .search-header {
-    padding: 29px 0 15px;
+    /* padding: 29px 0 15px; */
     background-color: #f5f5fb;
 }
 .search-content {
@@ -31,7 +31,8 @@
 }
 
 .search-header-content {
-    padding-left: 125px;
+    /* padding-left: 125px; */
+    padding: 24px 24px 24px 32px;
 }
 .search-header-top {
     display: flex;
@@ -44,7 +45,7 @@
     display: flex;
     align-items: center;
     padding: 0 20px;
-    height: 36px;
+    /* height: 36px; */
     cursor: pointer;
 }
 .input-container {
@@ -62,10 +63,13 @@
     display: flex;
     align-items: center;
     justify-content: center;
-    left: 18px;
+    left: 16px;
 }
 .el-input--prefix .el-input__inner {
-    padding-left: 50px;
+    padding-left: 44px;
+    height: 36px;
+    line-height: 36px;
+    border-radius: 8px 0 0 8px;
 }
 .input-prefix-icon {
     display: flex;
@@ -76,7 +80,7 @@
     display: block;
 }
 .input-container .el-input-group {
-    width: 640px;
+    width: 528px;
 }
 .input-container .el-input__inner,
 .input-container .el-input-group__append {
@@ -85,9 +89,10 @@
 }
 .input-container .el-input-group__append {
     padding: 0;
-    font-size: 18px;
+    font-size: 16px;
     color: #fff;
     background-color: #2cb7ca;
+    border-radius: 0 8px 8px 0;
 }
 .pre-search-list {
     padding: 20px 0;
@@ -985,3 +990,31 @@
     color: #fff;
     background: #2CB7CA;
 }
+.search-header-tab{
+  padding: 0 16px;
+  height: 48px;
+  line-height: 48px;
+  border-bottom: 1px solid #ececec;
+}
+.tab-item{
+  display: inline-block;
+  padding: 0 16px;
+  height: 100%;
+  font-size: 16px;
+  cursor: pointer;
+}
+.tab-item.tab-active{
+  position: relative;
+  color: #2cb7ca;
+}
+.tab-item.tab-active::before{
+  position: absolute;
+  content: '';
+  left: 50%;
+  bottom: 0;
+  width: 64px;
+  height: 2px;
+  background: #2cb7ca;
+  transform: translateX(-50%);
+  z-index: 9;
+}

+ 1 - 0
src/web/staticres/public-pc/css/sub-page.css

@@ -37,6 +37,7 @@ body.in-iframe {
 
 /* 标讯搜索 页面 */
 .in-iframe[data-page-name=supsearch] #searchInner .searchHeader {
+  margin-top: 0;
   border-top: unset;
 }
 .in-iframe[data-page-name=supsearch] #searchInner .searchHeader .searchHeader-container {

+ 7 - 6
src/web/staticres/serviceSystem/css/serviceSystem.css

@@ -143,7 +143,7 @@
     height: 56px;
     display: block;
     margin-top: -12px;
-    
+
 }
 
 .auto-w-1200 {
@@ -1248,6 +1248,7 @@
 .table_content_r_item {
     display: flex;
     /* box-sizing: border-box; */
+    border: 1px solid transparent;
     border-top: 1px solid #ECECEC;
 }
 
@@ -1385,7 +1386,7 @@
     padding-left: 350px;
 }
 .all_border_warn{
-        border-top: 1px solid #ECECEC;      
+        border-top: 1px solid #ECECEC;
 }
 .table_header_112 {
     height: 112px !important;
@@ -1534,8 +1535,8 @@ i.free::before {
     left: 0;
     position:absolute;
     top: 14px
-    
-    
+
+
 }
 .text_box .lh_30_img{
     width: 8px;
@@ -1637,7 +1638,7 @@ i.free::before {
     margin-top: 42px !important;
 }
 .position{
-    
+
 }
 
 clearfix:after {
@@ -2391,4 +2392,4 @@ clearfix:after {
 .CfadeInUp {
     opacity: 0;
     animation: 1s ease forwards alternate;
-}
+}

+ 61 - 61
src/web/templates/frontRouter/pc/serviceSystem/free/index.html

@@ -56,7 +56,7 @@
                     </div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            商务服务  
+                            商务服务
                         </p>
                         <p class="service_text">供应商招募</p>
                         <p class="service_text">供应商资格预审</p>
@@ -67,7 +67,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/xin.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            推荐服务  
+                            推荐服务
                         </p>
                         <p class="service_text">优秀供应商推荐</p>
                         <p class="service_text">供应商名录</p>
@@ -79,7 +79,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/bing.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            数据分析  
+                            数据分析
                         </p>
                         <p class="service_text">通讯录</p>
                         <p class="service_text">各类招标方式占比</p>
@@ -91,7 +91,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/dingwei.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            信息发布  
+                            信息发布
                         </p>
                         <p class="service_text">招标信息发布</p>
                         <p class="service_text">采购信息发布</p>
@@ -128,7 +128,7 @@
                         <div class="line"></div>
                         <div class="blue_btn_long" @click="consultation('1')">立即咨询</div>
                     </div>
-                    
+
                     <div class="item bg_bule mr-40">
                         <p class="tit">高级会员</p>
                         <p class="price">¥<span class="fz-24">19,999</span>/年</p>
@@ -437,7 +437,7 @@
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                </div>              
+                                </div>
                             </div>
                         </div>
                         <div class="table_headline">
@@ -500,7 +500,7 @@
                                     </div>
                                     <div class="table_content_textcell"><span class="tit">即将上线,敬请期待</span></div>
                                 </div>
-                                
+
                             </div>
                         </div>
                         <div class="table_headline">
@@ -523,11 +523,11 @@
                                         <p class="text">
                                             搜索范围支持项目名称/标的物、采购单位、中标企业、招标代理机构,项目地区支持地市级,发布时间支持自定义,支持采购单位类型、有无联系方式、排除词等高级筛选。支持查看拟建项目、采购意向标讯详情,提前获取商机。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                   
+
                                 </div>
                                 <div class="table_content_r_item ">
                                     <div class="table_content_longcell">
@@ -568,7 +568,7 @@
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
-                                
+
                             </div>
                          </div>
                          <div class="table_headline">
@@ -591,7 +591,7 @@
                                         <p class="text">
                                             可将业务范围、产品名称、甲方单位名称、业务需求等设置为订阅关键词,及时获取精准项目信息。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -601,9 +601,9 @@
                          <div class="warn_text clearfix">
                             <p>注:以上仅为部分服务项目,请联系客户经理查看全部内容!</p>
                             <div class="btn_" @click="consultation('1')">立即咨询</div>
-                         </div>       
+                         </div>
                 </div>
-            </div>    
+            </div>
         </div>
         <!-- 招标代理机构服务 -->
         <div class="content" v-if="tabs==2">
@@ -627,7 +627,7 @@
                     </div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            商务服务  
+                            商务服务
                         </p>
                         <p class="service_text">供应商招募</p>
                         <p class="service_text">供应商资格预审</p>
@@ -638,7 +638,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/xin.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            推荐服务  
+                            推荐服务
                         </p>
                         <p class="service_text">采购单位推荐</p>
                         <p class="service_text">优秀供应商推荐</p>
@@ -649,7 +649,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/bing.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            数据分析  
+                            数据分析
                         </p>
                         <p class="service_text">招标方式占比</p>
                         <p class="service_text">代理项目规模分布</p>
@@ -661,7 +661,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/dingwei.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            信息发布  
+                            信息发布
                         </p>
                         <p class="service_text">招标信息发布</p>
                         <p class="service_text">采购信息发布</p>
@@ -699,7 +699,7 @@
                         <div class="line"></div>
                         <div class="blue_btn_long" @click="consultation('2')">立即咨询</div>
                     </div>
-                    
+
                     <div class="item bg_bule mr-40">
                         <p class="tit">高级会员</p>
                         <p class="price">¥<span class="fz-24">19,999</span>/年</p>
@@ -882,7 +882,7 @@
                                     </div>
                                     <div class="table_content_textcell"><span>即将上线,敬请期待</span></div>
                                 </div>
-                                
+
                             </div>
                          </div>
                          <div class="table_headline">
@@ -1048,7 +1048,7 @@
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                </div>              
+                                </div>
                             </div>
                         </div>
                         <div class="table_headline">
@@ -1111,7 +1111,7 @@
                                     </div>
                                     <div class="table_content_textcell"><span class="tit">即将上线,敬请期待</span></div>
                                 </div>
-                                
+
                             </div>
                         </div>
                         <div class="table_headline">
@@ -1134,11 +1134,11 @@
                                         <p class="text">
                                             搜索范围支持项目名称/标的物、采购单位、中标企业、招标代理机构,项目地区支持地市级,发布时间支持自定义,支持采购单位类型、有无联系方式、排除词等高级筛选。支持查看拟建项目、采购意向标讯详情,提前获取商机。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                   
+
                                 </div>
                                 <div class="table_content_r_item ">
                                     <div class="table_content_longcell">
@@ -1179,7 +1179,7 @@
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
-                                
+
                             </div>
                          </div>
                          <div class="table_headline">
@@ -1202,7 +1202,7 @@
                                         <p class="text">
                                             可将业务范围、产品名称、甲方单位名称、业务需求等设置为订阅关键词,及时获取精准项目信息。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1212,9 +1212,9 @@
                          <div class="warn_text clearfix">
                             <p>注:以上仅为部分服务项目,请联系客户经理查看全部内容!</p>
                             <div class="btn_" @click="consultation('2')">立即咨询</div>
-                         </div>       
+                         </div>
                 </div>
-            </div>    
+            </div>
         </div>
         <!-- 供应商开始 -->
         <div class="content" v-if="tabs==0">
@@ -1256,7 +1256,7 @@
                               <p class="text"><img src="/serviceSystem/img/ic_v.png" alt="">客户线索实时记录、动态跟踪</p>
                               <p class="text"><img src="/serviceSystem/img/ic_v.png" alt="">招投标项目进度可视化报表展示</p>
                         </div>
-                        
+
                     </div>
                     <div class="item lr">
                       <img src="/serviceSystem/img/gysMine2@2x.png" alt="" class="item_img w-475">
@@ -1351,7 +1351,7 @@
                             <div class="sort_cell_block serve_bg_blue he-110">
                                 <span class="table_serve_head_text">超级订阅</span>
                                 <div class="cell_blue_btn" v-if="loginFlag&&isbuy_vip" @click="goplay('vip')">立即使用</div>
-                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>  
+                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>
                             </div>
                             <div class="sort_cell_block_nob  serve_bg_yellow he-110">
                                 <span class="table_serve_head_text2">大会员</span>
@@ -1381,7 +1381,7 @@
                             <div class="sort_cell_block serve_bg_blue he-110">
                                 <span class="table_serve_head_text">超级订阅</span>
                                 <div class="cell_blue_btn" v-if="loginFlag&&isbuy_vip" @click="goplay('vip')">立即使用</div>
-                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>  
+                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>
                             </div>
                             <div class="sort_cell_block_nob  serve_bg_yellow he-110">
                                 <span class="table_serve_head_text2">大会员</span>
@@ -1620,11 +1620,11 @@
                                             监控招标大数据,一旦关注企业中标,及时推送企业的中标项目、时间等公告信息。
                                         </p>
                                     </div>
-                                    <div class="table_content_sortcell"><span class="tit">10个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">10个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">100个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">10个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">10个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">100个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
                                 </div>
                                 <div class="table_content_r_item cell_wite">
                                     <div class="table_content_longcell">
@@ -1637,9 +1637,9 @@
                                     </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
-                                    <div class="table_content_sortcell"><span class="tit">100个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">100个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
                                 </div>
                             </div>
                         </div>
@@ -1759,7 +1759,7 @@
                                         <p class="text">
                                             大数据预测企业中标概率、企业排名,帮助分析潜在投标企业、辅助投标决策。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1780,7 +1780,7 @@
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">200次</span></div>
                                     <div class="table_content_sortcell"><span class="tit">200次</span></div>
-                                </div> 
+                                </div>
                             </div>
                          </div>
                          <div class="table_content">
@@ -1798,7 +1798,7 @@
                                         <p class="text">
                                             通过大数据分析统计,提供类似项目评标专家的频次排名、类似项目的热点中标企业、项目区域分布、采购单位类型分布、项目标书编制周期、类型项目折扣率分析等,帮助投标人员编制标书,判断是否参与投标。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1822,12 +1822,12 @@
                                         <p class="text">
                                             提供汇总后的采购单位历史招标项目负责人及其联系方式。
                                         </p>
-                                    </div> 
-                                    <div class="table_content_sortcell"><i class="free"></i></div>
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
+                                    <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
                                 <div class="table_content_r_item cell_wite">
                                     <div class="table_content_longcell">
@@ -1837,7 +1837,7 @@
                                         <p class="text">
                                             提供采购单位的采购项目动态、近5年招标采购项目数量及项目金额统计、采购预算区间、招标方式占比、采购领域平均节支率、重点合作的企业分析、重点合作代理机构明细等多维度分析。洞察采购单位采购需求,用于开发新客户、客户维护。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">每购买1个省份,每月可查看5个采购单位画像,上限80个</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1861,7 +1861,7 @@
                                         <p class="text">
                                             提供汇总后的企业历史中标项目负责人及其联系方式。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1876,7 +1876,7 @@
                                         <p class="text">
                                             掌控企业董监高、股东及投资比例、注册资本、企业地址、经营范围、公司注销/吊销、新公司设立变动信息。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1891,7 +1891,7 @@
                                         <p class="text">
                                             提供企业年度历史中标项目清单、项目数量及项目金额统计、市场区域分布情况统计图、各业务线折扣率、合作客户类型分布图、各行业的重点合作客户等多维度数据。帮助快速了解企业竞争力。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">每购买1个省份,每月可查看50个企业画像,上限800个</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1920,7 +1920,7 @@
                                         <p class="text">
                                             月新增招标和开标的项目数量、项目预算、项目规模统计,以及关注企业中标项目明细,开标项目提醒、规模TOP10采购行业;中标企业区域、资本分布统计;采购单位、中标企业排行等。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1935,7 +1935,7 @@
                                         <p class="text">
                                             自定义分析范围(分析内容、区域、行业、采购单位类型、时间),对市场规模、采购单位、中标单位进行分析,包含细分业务市场的项目数量、金额分布情况、以及各细分业务市场的重点中标单位中标数量明细等。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1959,7 +1959,7 @@
                                         <p class="text">
                                             本周/字段明细:省份、城市、公告标题、公告类别、公告内容、发布时间、公告地址、剑鱼标讯地址、项目名称、项目范围、预算金额、中标金额、开标日期、采购单位、采购单位信息(采购单位联系人、采购单位联系电话、招标代理机构)、中标单位信息(中标单位、中标单位联系人、中标单位联系电话)(来源:招标公告网站)、中标单位信息(中标单位联系人、中标单位联系电话、电子邮箱)(来源:国家企业公示网站)。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">每日导出量
@@ -1985,14 +1985,14 @@
                                         <p class="text">
                                             采购单位/招标代理机构会将部分项目通过剑鱼标讯进行公开或邀请招标,剑鱼标讯为客户提供项目的采购单位/招标代理机构联系方式,方便客户联系。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
-                          
+
                                 <div class="table_content_r_item ">
                                     <div class="table_content_longcell">
                                         <p class="tit">
@@ -2001,7 +2001,7 @@
                                         <p class="text">
                                             剑鱼标讯与众多采购单位/招标代理机构都有良好的合作关系,部分优质项目在剑鱼标讯进行公开或邀请招标,可以根据客户的企业资质、综合实力、成功案例等,直接推荐给采购单位。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -2016,7 +2016,7 @@
                                         <p class="text">
                                             剑鱼标讯与众多采购单位/招标代理机构拥有良好的合作关系,部分优质项目在剑鱼标讯进行公开或邀请招标。剑鱼标讯将根据客户企业资质、综合实力、成功案例,向采购单位方推荐。客户在使用唯一推荐权益后,剑鱼标讯将不再向采购单位方推荐其他供应商。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -2040,21 +2040,21 @@
                                         <p class="text">
                                             提供专业的售后客服服务,定期电话回访,及时解决服务中的任何问题,例如:帮助客户优化订阅关键词、培训系统操作等。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                    <div class="table_content_sortcell"><i class="right"></i></div> 
+                                    <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
                             </div>
                          </div>
                          <div class="all_border_warn warn_text clearfix">
                             <p>注:以上仅为部分服务项目,请联系客户经理查看全部内容!</p>
                             <div class="btn_" @click="consultation('0')">立即咨询</div>
-                         </div>       
+                         </div>
                 </div>
-            </div>  
+            </div>
         </div>
         <div class="model_" v-show="isshow"  @click.self="close('isshow')">
             <div class="pop-up">
@@ -2064,7 +2064,7 @@
                     <img :src="url" alt="">
                 </div>
                 <p class="text">{text}</p>
-            </div> 
+            </div>
         </div>
         <div class="model_" v-show="vipshow"  @click.self="close('vipshow')">
             <div class="modal-dialog modal-dialog-subvip modal-sm" role="document">
@@ -2094,10 +2094,10 @@
     </script>
     <script src='{{Msg "seo" "cdn"}}/serviceSystem/js/serviceSystem.js?v={{Msg "seo" "version"}}'></script>
     <!--S-百度统计-->
-    
+
     {{include "/common/pcbottom.html"}}
     {{include "/common/baiducc.html"}}
     <!--E-百度统计-->
 </body>
 
-</html>
+</html>

+ 9 - 3
src/web/templates/pc/entsearchindex.html

@@ -131,6 +131,9 @@
             .tab-cgdw {
                 display: none;
             }
+            .in-iframe[data-page-name=entSearch] .search-header .search-header-content {
+              padding-right: 24px;
+            }
         </style>
 	</head>
 
@@ -139,6 +142,9 @@
 	<section class="search-container">
         <div class="vue-search-container" v-cloak>
             <div class="search-header">
+                <div class="search-header-tab">
+                  <span class="tab-item tab-active">企业搜索</span>
+                </div>
                 <div class="search-header-content w">
                     <div class="search-header-top">
                         <div class="input-container flex">
@@ -152,7 +158,7 @@
                                 @keyup.enter.native="doSearch">
                                 <template slot="prefix">
                                     <div class="input-prefix-icon">
-                                        <img src="/images/biddingSearch/search-icon1.png">
+                                        <img src="/images/biddingSearch/bidding-search.png">
                                     </div>
                                 </template>
                                 <template slot="append">
@@ -183,14 +189,14 @@
                             </div>
                         </div>
                     </div>
-                    <div class="search-header-bottom">
+                    <!-- <div class="search-header-bottom">
                         <el-tabs v-model="tabActive">
                             <el-tab-pane label="招标采购搜索" name="zb"></el-tab-pane>
                             <el-tab-pane label="企业搜索" name="qy"></el-tab-pane>
                             <el-tab-pane label="采购单位搜索" name="cgdw"></el-tab-pane>
                             <el-tab-pane label="供应搜索" name="gy"></el-tab-pane>
                         </el-tabs>
-                    </div>
+                    </div> -->
                 </div>
             </div>
             <div class="search-content w">

+ 12 - 8
src/web/templates/pc/index.html

@@ -47,8 +47,15 @@
         <!-- 搜索框区域 -->
         <div class="jy-index-search">
           <div class="search">
+            <div class="tips">
+              <span class="active spa1" data-id="zb">招标采购搜索</span>
+              <span class="spa1" data-id="qy">企业搜索</span>
+              <span id="buyUnits" class="spa1 cai-gou" data-id="cg">采购单位搜索</span>
+              <span class="spa1" data-id="gy">供应搜索</span>
+              <i></i>
+            </div>
             <form method="post" action="/jylab/supsearch/index.html" class="form-search" id="zbIndex" name="zbIndex" target="stop" onsubmit="return false">
-              <input class="ser" onkeydown="onkeydownSearch()" autocomplete="off"  type="text" name="keywords" placeholder="请输入您想要查询的招标信息,多个关键词用空格隔开" id="keywords" value="" />
+              <input class="ser" onkeydown="onkeydownSearch()" autocomplete="off"  type="text" name="keywords" placeholder="请输入项目名称等关键词,例如:医疗设备" id="keywords" value="" />
               <input type="hidden" name="searchvalue">
               <input type="hidden" name="selectType" value="title">
               <input type="hidden">
@@ -59,13 +66,6 @@
               <ul>
               </ul>
             </div>
-            <div class="tips">
-              <span class="active spa1" data-id="zb">招标采购搜索</span>
-              <span class="spa1" data-id="qy">企业搜索</span>
-              <span id="buyUnits" class="spa1 cai-gou" data-id="cg">采购单位搜索</span>
-              <span class="spa1" data-id="gy">供应搜索</span>
-              <i></i>
-            </div>
             <div class="pre-search-list" style="display: none;"></div>
           </div>
         </div>
@@ -511,12 +511,16 @@
                 if (theme === 'light') {
                   setTimeout(function(){
                     $('.public-nav').addClass('light-bg-dark-color').removeClass('light-bg-light-color')
+                    $('.swiper-pagination').addClass('light-swiper-bg-dark-color').removeClass('light-swiper-bg-light-color')
                     $('.loginBtn').css('color', '#1d1d1d')
                   }, 100)
                 } else {
                   setTimeout(function(){
                     $('.public-nav').addClass('light-bg-light-color').removeClass('light-bg-dark-color')
                     $('.loginBtn').css('color', '#fff')
+                    var a = $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet-active')
+                    // $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet').css('background', 'rgba(255, 255, 255, 0.32)')
+                    $('.swiper-pagination').addClass('light-swiper-bg-light-color').removeClass('light-swiper-bg-dark-color')
                   }, 100)
                 }
               }

+ 11 - 5
src/web/templates/pc/pursearchindex.html

@@ -33,8 +33,8 @@
             }
 
             .in-iframe .search-header-content {
-              padding-left: 86px;
-              padding-right: 86px;
+              /* padding-left: 86px;
+              padding-right: 86px; */
             }
             .in-iframe .search-header,
             .in-iframe .search-pur-container,
@@ -46,6 +46,9 @@
               border: none;
               border-bottom: 1px solid #EBEBEB;
             }
+            .in-iframe[data-page-name=entSearch] .search-header .search-header-content {
+              padding-right: 24px;
+            }
         </style>
 	</head>
 
@@ -54,6 +57,9 @@
 	<section class="search-container">
         <div class="vue-search-container" id="pur-search-container" v-cloak>
             <div class="search-header">
+                <div class="search-header-tab">
+                  <span class="tab-item tab-active">采购单位搜索</span>
+                </div>
                 <div class="search-header-content w">
                     <div class="search-header-top">
                         <div class="input-container flex">
@@ -67,7 +73,7 @@
                                 @keyup.enter.native="doSearch">
                                 <template slot="prefix">
                                     <div class="input-prefix-icon">
-                                        <img src="/images/biddingSearch/search-icon1.png">
+                                        <img src="/images/biddingSearch/bidding-search.png">
                                     </div>
                                 </template>
                                 <template slot="append">
@@ -98,14 +104,14 @@
                             </div>
                         </div>
                     </div>
-                    <div class="search-header-bottom">
+                    <!-- <div class="search-header-bottom">
                         <el-tabs v-model="tabActive">
                             <el-tab-pane label="招标采购搜索" name="zb"></el-tab-pane>
                             <el-tab-pane label="企业搜索" name="qy"></el-tab-pane>
                             <el-tab-pane label="采购单位搜索" name="cgdw"></el-tab-pane>
                             <el-tab-pane label="供应搜索" name="gy"></el-tab-pane>
                         </el-tabs>
-                    </div>
+                    </div> -->
                 </div>
             </div>
             <div class="search-content w">

文件差异内容过多而无法显示
+ 457 - 174
src/web/templates/pc/supsearch.html


部分文件因为文件数量过多而无法显示