Browse Source

Merge branch 'master' into feature/v4.8.59

lianbingjie 1 year ago
parent
commit
2a06d82175

+ 7 - 0
src/db.json

@@ -37,6 +37,13 @@
       "version": "v7",
       "userName": "",
       "password": ""
+    },
+    "other": {
+      "address": "http://192.168.3.241:9205,http://192.168.3.149:9200",
+      "size": 30,
+      "version": "v7",
+      "userName": "",
+      "password": ""
     }
   },
   "redis": {

+ 1 - 1
src/go.mod

@@ -6,7 +6,7 @@ require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230308011651-df591d32df88
 	app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25
+	app.yhyue.com/moapp/jypkg v0.0.0-20230926094058-438d017d0f81
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/bwmarrin/snowflake v0.3.0

+ 2 - 2
src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40 h1:/FcBvpf/KW8g6GB
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25 h1:2q7b1auPihIJD3Ewsd7Zi8ESeLkxuP57avWL8UoBr9U=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25/go.mod h1:gPCOY8bVXdY5bD7nry7th+YNkKC/viG8Dc9+z4fUaRo=
+app.yhyue.com/moapp/jypkg v0.0.0-20230926094058-438d017d0f81 h1:YrT86U95eMPFf7mdum3FtYpr4CwvTVXC4ZzXWXvW+R0=
+app.yhyue.com/moapp/jypkg v0.0.0-20230926094058-438d017d0f81/go.mod h1:gPCOY8bVXdY5bD7nry7th+YNkKC/viG8Dc9+z4fUaRo=
 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/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=

+ 26 - 12
src/jfw/front/searchOptimize.go

@@ -284,9 +284,11 @@ func (so *SearchOptimize) GetBidSearchList(isCache bool) (count, total int64, li
 	if start >= 0 {
 		t := time.Now()
 		fields := util.If(so.IsPay, BidSearchFieldOfVip, BidSearchFieldBase).(string)
+		esIndex := util.If(so.UserId == "", INDEXOther, INDEX).(string)
+		esType := util.If(so.UserId == "", TYPEOther, TYPE).(string)
 		biddingSearch := SearchByES{
-			Index:      INDEX,
-			IType:      TYPE,
+			Index:      esIndex,
+			IType:      esType,
 			Query:      so.GetSearchQuery(so.GetBidSearchQuery()),
 			FindFields: util.If(isCache, "title", "detail").(string),
 			Order:      BidSearchSort,
@@ -295,6 +297,7 @@ func (so *SearchOptimize) GetBidSearchList(isCache bool) (count, total int64, li
 			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),                                                            //是否高亮正文
+			IsLogin:    so.UserId != "",
 		}
 		var repl *[]map[string]interface{}
 		total, repl = biddingSearch.GetAllByNgramWithCount()
@@ -366,6 +369,7 @@ func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
 		//搜索范围只选择附件,是否有附件条件无效;
 		isFileSearch  = so.SelectType == "filetext"
 		selectTypeArr = strings.Split(so.SelectType, ",")
+		isLogin       = so.UserId == ""
 	)
 	if mustQuery != "" {
 		musts = append(musts, mustQuery)
@@ -477,11 +481,11 @@ func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
 		mustNot = append(mustNot, fmt.Sprintf(queryBoolShould, strings.Join(notKeyMustNot, ",")))
 	}
 	//行业
-	if so.Industry != "" {
+	if so.Industry != "" && isLogin {
 		musts = append(musts, fmt.Sprintf(queryBoolMust, `"`+strings.ReplaceAll(so.Industry, ",", `","`)+`"`))
 	}
 	//价格
-	if so.Price != "" && len(strings.Split(so.Price, "-")) > 1 {
+	if so.Price != "" && len(strings.Split(so.Price, "-")) > 1 && isLogin {
 		minPrice, maxPrice := strings.Split(so.Price, "-")[0], strings.Split(so.Price, "-")[1]
 		if minPrice != "" || maxPrice != "" {
 			sq := ``
@@ -515,7 +519,7 @@ func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
 	}
 	//采购单位联系方式
 	hasBuyerTel := so.BuyerTel
-	if hasBuyerTel != "" {
+	if hasBuyerTel != "" && isLogin {
 		if hasBuyerTel == "y" {
 			musts = append(musts, fmt.Sprintf(queryExists, "buyertel"))
 		} else {
@@ -524,7 +528,7 @@ func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
 	}
 	//中标企业联系方式
 	hasWinnerTel := so.WinnerTel
-	if hasWinnerTel != "" {
+	if hasWinnerTel != "" && isLogin {
 		if hasWinnerTel == "y" {
 			musts = append(musts, fmt.Sprintf(queryExists, "winnertel"))
 		} else {
@@ -533,7 +537,7 @@ func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
 	}
 	//附件
 	fileExists := so.FileExists
-	if !isFileSearch && fileExists != "" {
+	if !isFileSearch && fileExists != "" && isLogin {
 		if fileExists == "1" { //有附件
 			musts = append(musts, fmt.Sprintf(queryBoolMustTerm, true))
 		} else if fileExists == "-1" { //无附件
@@ -554,7 +558,8 @@ func (so *SearchOptimize) GetBidSearchQuery() string {
 	query := ``
 	//省份
 	area := so.Province
-	if area != "" {
+	isLogin := so.UserId != ""
+	if area != "" && isLogin {
 		query += `{"terms":{"area":[`
 		for k, v := range strings.Split(area, ",") {
 			if k > 0 {
@@ -566,7 +571,7 @@ func (so *SearchOptimize) GetBidSearchQuery() string {
 	}
 	//
 	city := so.City
-	if city != "" {
+	if city != "" && isLogin {
 		if len(query) > 0 {
 			query += ","
 		}
@@ -645,6 +650,10 @@ func (so *SearchOptimize) GetBidSearchQuery() string {
 			allType += `"` + v + `"`
 		}
 		allType += `]}}`
+		//subtype里都是一级信息类型
+		if typeInt == len(strings.Split(subtype, ",")) {
+			allType = ``
+		}
 	}
 	//信息类型  一级分类
 	log.Println("topType:", topType)
@@ -669,7 +678,7 @@ func (so *SearchOptimize) GetBidSearchQuery() string {
 		query += fmt.Sprintf(queryBoolShould, allType)
 	}
 	//采购单位类型
-	if so.BuyerClass != "" {
+	if so.BuyerClass != "" && isLogin {
 		if len(query) > 0 {
 			query += ","
 		}
@@ -749,6 +758,7 @@ type SearchByES struct {
 	Limit      int
 	Count      int
 	HighLight  bool
+	IsLogin    bool
 }
 
 // GetAllByNgramWithCount  获取es查询结果及总数量
@@ -772,7 +782,11 @@ func (e *SearchByES) GetAllByNgramWithCount() (int64, *[]map[string]interface{})
 			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, e.Query, queryStr)
+		if e.IsLogin {
+			return elastic.GetWithCount(e.Index, e.IType, e.Query, queryStr)
+		} else {
+			return pc.Other.GetWithCount(e.Index, e.IType, e.Query, queryStr)
+		}
 	} else {
 		return 0, nil
 	}
@@ -806,7 +820,7 @@ func SearchListFormat(industry string, repl []map[string]interface{}, b bool) (l
 			v["fileExists"] = true
 		}
 		//地区链接、
-		area := v["area"].(string)
+		area := util.ObjToString(v["area"])
 		//信息类型链接
 		finalType, _ := v["subtype"].(string)
 		if finalType == "" {

+ 19 - 4
src/jfw/front/supsearch.go

@@ -344,6 +344,10 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	//--end--
 	userId, _ := p.GetSession("userId").(string)
 	phone, _ := p.GetSession("phone").(string)
+	selectType := p.GetString("selectType") //搜索范围
+	if selectType == "" {
+		selectType = "title,content"
+	}
 	//p353包含采购意向与拟建
 	noLoginBl := false
 	if userId == "" {
@@ -362,6 +366,21 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 			subtype = "招标预告,招标公告,招标结果,招标信用信息"
 			noLoginBl = true
 		}
+		//未登录用户搜索范围 标题和 正文
+		var selectTypeArr []string
+		selectTypeSplit := strings.Split(selectType, ",")
+		// 未登录用户只能搜标题和正文
+		for i := 0; i < len(selectTypeSplit); i++ {
+			if selectTypeSplit[i] == "title" || selectTypeSplit[i] == "content" {
+				selectTypeArr = append(selectTypeArr, selectTypeSplit[i])
+			}
+		}
+		if len(selectTypeArr) > 0 {
+			selectType = strings.Join(selectTypeArr, ",")
+		}
+		if publishtime != "" {
+			publishtime = ""
+		}
 	}
 	//高级筛选 仅vip用户可查询
 	var (
@@ -380,10 +399,6 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	default:
 		territorialization = ""
 	}
-	selectType := p.GetString("selectType")
-	if selectType == "" {
-		selectType = "title,content"
-	}
 	userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
 	queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
 	isPayedUser := userInfo.IsPayedUser()

+ 20 - 3
src/jfw/front/swordfish.go

@@ -129,6 +129,21 @@ func (m *Front) PcAjaxReq() {
 			subtype = "招标预告,招标公告,招标结果,招标信用信息"
 		}
 
+		//未登录用户搜索范围 标题和 正文
+		var selectTypeArr []string
+		selectTypeSplit := strings.Split(selectType, ",")
+		// 未登录用户只能搜标题和正文
+		for i := 0; i < len(selectTypeSplit); i++ {
+			if selectTypeSplit[i] == "title" || selectTypeSplit[i] == "content" {
+				selectTypeArr = append(selectTypeArr, selectTypeSplit[i])
+			}
+		}
+		if len(selectTypeArr) > 0 {
+			selectType = strings.Join(selectTypeArr, ",")
+		}
+		if publishtime != "" {
+			publishtime = ""
+		}
 	}
 	industry := strings.TrimSpace(m.GetString("industry"))
 	minprice := m.GetString("minprice")               //最低价格
@@ -1180,9 +1195,11 @@ func (m *Front) AjaxReq() error {
 }
 
 const (
-	INDEX = "bidding"
-	TYPE  = "bidding"
-	FINDF = `"title"`
+	INDEX      = "bidding"
+	TYPE       = "bidding"
+	INDEXOther = "bidding_year"
+	TYPEOther  = "bidding_year"
+	FINDF      = `"title"`
 )
 
 // 预览结果

+ 11 - 3
src/web/staticres/css/dev2/superSearch.css

@@ -515,13 +515,13 @@
   display: flex;
   align-items: center;
   box-sizing: border-box;
-  
+
 }
 .release-time .vip_box .active{
   color: #fff !important;
   background-color:#C98F37 !important;
   border-radius: 2px;
-  
+
 }
 .release-time.flex-auto{
   display: flex;
@@ -578,7 +578,7 @@
   display: flex;
   align-items: center;
   box-sizing: border-box;
- 
+
 }
 .searchSpace .search-content{
   display: flex;
@@ -686,3 +686,11 @@ left: 252px;
   font-weight: bold;
     color: #1d1d1d;
 }
+.no-login-mask {
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  cursor: pointer;
+}

+ 5 - 0
src/web/staticres/js/biddingSearch.js

@@ -253,6 +253,11 @@ $(function() {
 	function silbingsTabClass(children) {
 		var $childrenLi = children;
 		$childrenLi.on("click", function(e) {
+      // @2023/9/26 未登录限制搜索条件
+      if (!loginflag) {
+        return openLoginDig()
+      }
+
       if (window.vipStatus || window.memberStatus > 0 || window.entniche) {
         // 如果是付费用户 可正常切换
         $(this).addClass("active").siblings().removeClass("active");

+ 22 - 11
src/web/staticres/js/superSearch.js

@@ -169,7 +169,6 @@ $(function() {
       }
     })
   })
-
 })
 
 //取redis里的数据
@@ -933,6 +932,14 @@ function beforeSubmit(from){
   // from=='tab-*'表示tab切换查询事件
   // from=='page-init-recovery'回显搜索
   from = from || ''
+
+  // @2023/9/26 未登录限制搜索条件
+  if (!loginflag) {
+    if (from.indexOf('filter-') !== -1 && from !== 'filter-selectType') {
+      return openLoginDig()
+    }
+  }
+
   var searchKeywords = $.trim($("#zbSeatchT input[name='keywords']").val())
   // 如果在反爬白名单,则空搜索刷新搜索结果(即允许空搜索)
   // 不在,则不允许空搜索(此处空搜索指的是主搜索框是否为空)
@@ -1200,27 +1207,31 @@ function searchOnsubmit(clickpaging){
     wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
     additionalWords: $("#zbSeatchT [name='additionalWords']").val()
   };
-	$.post("/front/pcAjaxReq",param,function(r){
+
+  // function queryBack (r) {
+  $.post("/front/pcAjaxReq",param,function(r){
     heightWords = r.heightWords
-		if(r.limitFlag){
-			LimitClass.limitFlag = true;
-			LimitClass.result = r;
-			LimitClass.list = r.list;
-			LimitClass.paging(currentPage);
+    if(r.limitFlag){
+      LimitClass.limitFlag = true;
+      LimitClass.result = r;
+      LimitClass.list = r.list;
+      LimitClass.paging(currentPage);
       LimitClass.prevNoLimitFlag = false;
       // 重新分页
       searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
       allCount = r.total
       searchInnerVue.listState.allCount = r.total
       // searchInnerVue.checkPageNumAdd1()
-		}else{
-			LimitClass.prevNoLimitFlag = true;
+    }else{
+      LimitClass.prevNoLimitFlag = true;
       LimitClass.limitFlag = false;
       pcAjaxReqCallBack(r);
     }
-    autoModelFn(r)
+    if (loginflag) {
+      autoModelFn(r)
+    }
+  });
     // getBidIsColl()
-	});
 }
 function showSearchTipForTimeRange (type) {
 	var tempDom = $("#hasNoData_tiptext>font:eq(0)")

+ 7 - 5
src/web/templates/pc/classifylist.html

@@ -477,7 +477,7 @@ function priceCss(){
 					<input type="hidden" name="selectType" value="all">
 				</form>
 				<!--筛选-->
-				<div id="screenBtn" class="screen">
+				<div id="screenBtn" class="screen" style="display: none;">
 					筛选
 				</div>
 				<!--二维码-->
@@ -499,7 +499,7 @@ function priceCss(){
 			</div>
 
 			<!--整体页面切换tab-->
-			<div class="control-tabBtn">
+			<div class="control-tabBtn" style="display: none;">
 				<span class="bidbutdir"></span>
 				<a href="/jylab/supsearch/index.html" left="8" class="on">
           <!-- <i></i> -->
@@ -699,8 +699,8 @@ function priceCss(){
 					</li>
 				</ul>
 				<div class="right-tabBtn">
-					<button id="right-list" class="active">列表</button>
-					<button id="right-table">表格</button>
+					<button id="right-list" class="active" style="display: none;">列表</button>
+					<button id="right-table" style="display: none;">表格</button>
 				</div>
 			</div>
 			<!--tab切换内容-->
@@ -805,10 +805,12 @@ $(function(){
 	})
 	//筛选关闭和打开
 	//根据cookie值设置筛选是否显示
+  //20230927-隐藏搜索条件
 	var sod = localStorage.getItem("classify");
 	if(sod=="U"){
 		$("#screenBtn").addClass("down");
-		$(".searchTender").show();
+    $(".searchTender").hide();
+		// $(".searchTender").show();
 	}else if(sod=="D"){
 		$("#screenBtn").removeClass("down");
 		$(".searchTender").hide();

+ 26 - 3
src/web/templates/pc/supsearch.html

@@ -1217,7 +1217,7 @@
             <div class="leftTitle">
               信息类型:
             </div>
-            <div class="info-content bi-change-group">
+            <div class="info-content bi-change-group" style="position: relative;">
               <span id="infoBtn" class="active">全部</span>
               <i v-show="showCQ" class="diver"></i>
               <font v-show="showCQ" class="parent-node nologin-hide">拟建项目</font>
@@ -1254,6 +1254,8 @@
               <font v-show="hideCQ" class="bi-mark" data-value="合同">合同</font>
               <font v-show="hideCQ" class="bi-mark" data-value="验收">验收</font>
               <font v-show="hideCQ" class="bi-mark" data-value="违规">违规</font>
+              <!-- 未登录用户 -->
+              <div class="no-login-mask" onclick="openLoginDig()"></div>
             </div>
             <span class="remind tips_" style="display:none;">
               <span class="remindone"></span>
@@ -1295,7 +1297,7 @@
           <!-- 更多筛选条件 -->
           <div class="other-filter clearfix" style="display: none;">
             <div class="leftTitle lh-22">更多筛选:</div>
-            <div class="other-content">
+            <div class="other-content" style="position: relative;">
                 <div class="one-filter clearfix">
                   <!-- 地区下拉筛选 -->
                    <div class="select-area mr-16">
@@ -1457,6 +1459,8 @@
                   </div>
                   <img class="icon-vip" src="{{Msg "seo" "cdn"}}/images/biddingSearch/VIP.png?v={{Msg "seo" "version"}}" alt="">
                 </div>
+                <!-- 未登录用户 -->
+                <div class="no-login-mask" onclick="openLoginDig()"></div>
             </div>
           </div>
           <!-- 其他筛选条件 -->
@@ -1646,7 +1650,7 @@
           </div>
         </div>
         <div class="tabContainer" id="fix-tab" style="margin: 0">
-          <div class="lucene-table fixed-table-header-container" id="fixed-table-header-container" style="padding: 0"></div>
+          <div v-show="tableFixedTop" class="lucene-table fixed-table-header-container" id="fixed-table-header-container" style="padding: 0"></div>
         </div>
       </div>
       <!--tab切换内容-->
@@ -2000,6 +2004,9 @@
       $('.tab-item-buyer-search').show()
     }
     window.loginCallback = function () {//登录成功回调
+      // @2023/9/26 未登录限制搜索条件
+      $(".no-login-mask").remove()
+
       $('#go-customer-4').removeClass('hide')
       $('.nologin-hide').removeClass('hide')
       $('.city-list-divide').removeClass('hide')
@@ -2470,6 +2477,16 @@
     })
     // 搜索范围点击事件
     $('.search-content .search-list .search-list-checkbox').on('click',function(){
+
+      // @2023/9/26 未登录限制搜索条件
+      if (!loginflag) {
+        var nowSelectType = $(this).attr('data-name')
+        var allowTypes = ['content', 'title']
+        if (allowTypes.indexOf(nowSelectType) === -1) {
+          return openLoginDig()
+        }
+      }
+
       // 最少选中一项
       var nowSelectTypes = $("#zbSeatchT [name='selectType']").val()
       if (nowSelectTypes !== '') {
@@ -4884,12 +4901,18 @@ function checkTagDisabled () {
       },
       // 精准、模糊搜索切换
       selectedSearchItem: function(item) {
+        if (!this.islogin) {
+          return openLoginDig()
+        }
         this.keywordSearchType = item
         this.searchTypeDialog = false
         $("#zbSeatchT [name='searchMode']").val(item)
         beforeSubmit('filter-mode')
       },
       onKeywordCheckbox: function () {
+        if (!this.islogin) {
+          return openLoginDig()
+        }
         this.keywordMult = !this.keywordMult
         this.showAddKeyword = this.keywordMult
       },