Browse Source

pc端 搜索排除词 数据导出

wangshan 3 years ago
parent
commit
a7e4fc2865

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

@@ -348,8 +348,8 @@ func (d *DataExport) SuperSearchExport() error {
 		Hasbuyertel:  d.GetString("buyertel"),                     //是否有采购电话
 		Haswinnertel: d.GetString("winnertel"),                    //是否有中标电话
 		SelectIds:    strings.TrimSpace(d.GetString("selectIds")), //选择信息id
+		Notkey:       d.GetString("notkey"),                       //排除词
 	}
-
 	//数据回显
 	d.SetSession("Echo_timeslot", d.GetString("timeslot"))
 	d.SetSession("Echo_keywords", reqData.Keywords)
@@ -363,6 +363,7 @@ func (d *DataExport) SuperSearchExport() error {
 	d.SetSession("Echo_buyerclass", reqData.Buyerclass)
 	d.SetSession("Echo_hasBuyertel", reqData.Hasbuyertel)
 	d.SetSession("Echo_hasWinnertel", reqData.Haswinnertel)
+	d.SetSession("Echo_notkey", reqData.Notkey)
 
 	saveData := reqData.PassBidSearchExport()
 	saveData["selectType"] = strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId).

+ 14 - 14
src/jfw/front/supsearch.go

@@ -254,7 +254,19 @@ func (p *Pcsearch) PcSearchIndex() error {
 	if selectType == "" {
 		selectType = "title,content"
 	}
-
+	vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId)
+	isPayedUser := vipStatus.IsPayedUser()
+	queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
+	if isPayedUser {
+		buyerclass = p.GetString("buyerclass")
+		hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
+		notkey = p.GetString("notkey")
+	} else {
+		//时间自定义选择默认是vip 大会员 等权限
+		if len(strings.Split(publishtime, "_")) == 2 {
+			publishtime = ""
+		}
+	}
 	//历史导出数据回显
 	if strings.Contains(p.Url(), "?goback") {
 		keywords = util.ObjToString(p.GetSession("Echo_keywords"))
@@ -269,19 +281,7 @@ func (p *Pcsearch) PcSearchIndex() error {
 		hasBuyerTel = util.ObjToString(p.GetSession("Echo_hasBuyertel"))
 		hasWinnerTel = util.ObjToString(p.GetSession("Echo_hasWinnertel"))
 		industry = util.ObjToString(p.GetSession("Echo_industry"))
-	}
-	vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId)
-	isPayedUser := vipStatus.IsPayedUser()
-	queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
-	if isPayedUser {
-		buyerclass = p.GetString("buyerclass")
-		hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
-		notkey = p.GetString("notkey")
-	} else {
-		//时间自定义选择默认是vip 大会员 等权限
-		if len(strings.Split(publishtime, "_")) == 2 {
-			publishtime = ""
-		}
+		notkey = util.ObjToString(p.GetSession("Echo_notkey"))
 	}
 
 	b_word, s_word := "", ""

+ 2 - 1
src/jfw/public/dataexport.go

@@ -107,6 +107,7 @@ type BidSearchExport struct {
 	Hasbuyertel  string //是否有采购电话
 	Haswinnertel string //是否有中标电话
 	SelectIds    string //选择单条信息id
+	Notkey       string //排除词
 }
 
 func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interface{}) {
@@ -136,7 +137,7 @@ func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interf
 		}
 		_, _, keywords := jy.InterceptSearchKW(this.Keywords, isIntercept, len(this.Industry) == 0)
 		keywords = strings.Replace(keywords, "+", " ", -1)
-		KeyWordSave = append(KeyWordSave, dataexport.KeyWord{Keyword: keywords})
+		KeyWordSave = append(KeyWordSave, dataexport.KeyWord{Keyword: keywords, Exclude: strings.Split(this.Notkey, " ")})
 	}
 
 	//时间

+ 8 - 2
src/web/staticres/js/superSearch.js

@@ -849,10 +849,16 @@ function beforeSubmit(n){
         }
       }
     })
+    //采购单位类型
     $("#zbSeatchT [name='buyerclass']").val(buyerTypeArr)
     // $("#buyerInput").val(buyerTypeArr);
-
-		if($("#zbSeatchT [name='keywords']").val()==""&&$("#zbSeatchT [name='industry']").val()==""){//$("#zbSeatchT [name='area']").val()==""&&$("#zbSeatchT [name='publishtime']").val()==""&&$("#zbSeatchT [name='subtype']").val()==""&&$("#zbSeatchT [name='minprice']").val()==""&&$("#zbSeatchT [name='maxprice']").val()==""){
+	//采购单位联系方式有无
+    $("#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()==""){
 			getNewBids(currentPage);
 		}else{
 			if(n!="F"){

+ 1 - 2
src/web/templates/pc/supsearch.html

@@ -981,6 +981,7 @@ var IframeOnClick = {
           <input type="hidden" name="buyertel" value="{{.T.buyertel}}">
           <input type="hidden" name="winnertel" value="{{.T.winnertel}}">
           <input type="hidden" name="selectType" value="{{.T.selectType}}">
+          <input type="hidden" name="notkey" value="{{.T.notkey}}">
 				</form>
 				<!--筛选-->
 				<div id="screenBtn" class="screen down">
@@ -1705,8 +1706,6 @@ $(function(){
       var text = $(this).text()
       $(this).parent().siblings().children('.custom-input').val(text).attr('data-value', val)
       beforeSubmit();
-      $("#zbSeatchT [name='buyertel']").val($(".custom-input[name='buyertel']").attr('data-value'));
-      $("#zbSeatchT [name='winnertel']").val($(".custom-input[name='winnertel']").attr('data-value'));
     })
   })
   // 点击其他区域 隐藏其他筛选条件下拉框