Browse Source

wip:用户角色区分开关

wangshan 9 tháng trước cách đây
mục cha
commit
c24e782b87

+ 2 - 2
jyBXCore/api/bxcore.api

@@ -298,7 +298,7 @@ type (
 		FileExists       int64  `json:"fileExists,optional"`               //附件
 		Publisher        int64  `json:"publisher,optional"`                //发布者:可选:全部、用户发布:1、平台发布:2。
 		KeyWords         string `json:"keyWords,optional"`                 //关键词
-		AdditionalWords  string `json:"additionalWords,optional"`          // 附加词
+		AdditionalWords  string `json:"additionalWords,optional"`          //附加词
 		SearchMode       int64  `json:"searchMode,optional"`               //搜索模式:0:精准搜索;1:模糊搜索
 		WordsMode        int64  `json:"wordsMode,optional"`                //搜索关键词模式;默认0:包含所有,1:包含任意
 	}
@@ -312,4 +312,4 @@ type (
 service bxcore-api {
 	@handler purchaseSearch
 	post /core/purchaseSearch (purSearchReq) returns (commonResp)
-}
+}

+ 1 - 0
jyBXCore/rpc/etc/bxcore.yaml

@@ -82,3 +82,4 @@ SearchWinner:
   Switch: true
   RegWinner: ".+[司院厂所心处普行]$"
 PurchaseCode: ygzc_cgxx
+PurchaseDiffSwitch: true

+ 2 - 1
jyBXCore/rpc/internal/config/config.go

@@ -68,7 +68,8 @@ type Config struct {
 		Switch    bool
 		RegWinner string
 	}
-	PurchaseCode string
+	PurchaseCode       string
+	PurchaseDiffSwitch bool //付费和免费查询区分开关
 }
 type Db struct {
 	Mysql     entity.Mysql      `json:"mysql"`

+ 5 - 4
jyBXCore/rpc/model/es/es.go

@@ -42,10 +42,11 @@ const (
 	LoginTypeFree    = 2            // 免费用户
 	LoginTypeNoLogin = 3            // 未登录用户
 	//直采-采购信息
-	PurchaseIndex, PurchaseType = "bidding_yg", "bidding_yg"
-	PurchaseBaseField           = `"_id","title","area","city","district","buyerclass","publishtime","isValidFile","budget","bidamount","signendtime","deliver_area","deliver_city","deliver_district","buyer","buyertel","s_subscopeclass","public_type","purchasing","spidercode","subtype"` //"purchasinglist","projectname",
-	PurchaseSearchSort          = `{"dataweight":-1,"publishtime":-1}`
-	PurchaseBaseFieldForPayer   = PurchaseBaseField + `,"buyerperson","agency","agencytel","agencyperson","s_winner","winnertel","winnerperson","signendtime","bidendtime","projectinfo","entidlist"`
+	PurchaseType              = "bidding_yg"
+	PurchaseIndex             = "bidding_yg"
+	PurchaseBaseField         = `"_id","title","area","city","district","buyerclass","publishtime","isValidFile","budget","bidamount","signendtime","deliver_area","deliver_city","deliver_district","buyer","buyertel","s_subscopeclass","public_type","purchasing","spidercode","subtype"` //"purchasinglist","projectname",
+	PurchaseSearchSort        = `{"publishtime":-1}`
+	PurchaseBaseFieldForPayer = PurchaseBaseField + `,"buyerperson","agency","agencytel","agencyperson","s_winner","winnertel","winnerperson","signendtime","bidendtime","projectinfo","entidlist"`
 )
 
 var (

+ 5 - 0
jyBXCore/rpc/service/purchase.go

@@ -432,6 +432,11 @@ func (p *Purchase) FindDataFromES() (int64, []map[string]interface{}, error) {
 		err    error
 		fields = es.PurchaseBaseFieldForPayer
 	)
+	if IC.C.PurchaseDiffSwitch {
+		if !p.IsPay {
+			fields = es.PurchaseBaseField
+		}
+	}
 	biddingSearch := es.SearchByES{
 		Index:      es.PurchaseIndex,
 		IType:      es.PurchaseType,