Procházet zdrojové kódy

fix:筛选展示中标企业区分新老用户

duxin před 3 roky
rodič
revize
c25f600e37

+ 1 - 0
jyBXBase/rpc/etc/bxbase.yaml

@@ -5,3 +5,4 @@ Etcd:
   - 127.0.0.1:2379
   Key: bxbase.rpc
 Webrpcport: 8015
+BidSearchOldUserLimit: 1626105600

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

@@ -7,7 +7,8 @@ import (
 
 type Config struct {
 	zrpc.RpcServerConf
-	Webrpcport int64
+	Webrpcport            int64
+	BidSearchOldUserLimit int64
 }
 
 type Db struct {

+ 19 - 4
jyBXBase/rpc/internal/logic/showsearchlogic.go

@@ -29,7 +29,8 @@ func NewShowSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowSe
 func (l *ShowSearchLogic) ShowSearch(in *bxbase.ShowSearchReq) (res *bxbase.ShowSearchRes, err error) {
 	// todo: add your logic here and delete this line
 	var (
-		data []*bxbase.ListSearchRes
+		data  []*bxbase.ListSearchRes
+		isOld bool
 	)
 	log.Println("获取搜索列表:", in)
 	res = new(bxbase.ShowSearchRes)
@@ -48,6 +49,15 @@ func (l *ShowSearchLogic) ShowSearch(in *bxbase.ShowSearchReq) (res *bxbase.Show
 		res.ErrMsg = "用户搜索信息查询失败"
 		return res, nil
 	}
+	//需判断新老用户
+	user, _b := IC.Mgo.FindById("user", in.UserId, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1,"l_registedate":1`)
+	if !_b {
+		res.ErrCode = 1
+		res.ErrMsg = "用户信息查询失败"
+		return res, nil
+	}
+	registedate, _ := (*user)["registedate"].(int64)
+	isOld = registedate != 0 && registedate < IC.C.BidSearchOldUserLimit
 	if allSearch != nil {
 		for _, vlu := range *allSearch {
 			var listSearch bxbase.ListSearchRes
@@ -68,7 +78,7 @@ func (l *ShowSearchLogic) ShowSearch(in *bxbase.ShowSearchReq) (res *bxbase.Show
 			listSearch.Notkey = common.InterfaceToStr(vlu["not_key"])
 			listSearch.Tabularflag = common.InterfaceToStr(vlu["tabular_flag"])
 			//ppa,buyer,winner,agency
-			if SelectCheck(listSearch.SelectType) || listSearch.City != "" || listSearch.Notkey != "" ||
+			if SelectCheck(listSearch.SelectType, isOld) || listSearch.City != "" || listSearch.Notkey != "" ||
 				(listSearch.Publishtime != "lately-7" && listSearch.Publishtime != "lately-30" && listSearch.Publishtime != "thisyear") ||
 				listSearch.Winnertel != "" || listSearch.Buyertel != "" || listSearch.Buyerclass != "" {
 				listSearch.IsPay = true
@@ -80,11 +90,16 @@ func (l *ShowSearchLogic) ShowSearch(in *bxbase.ShowSearchReq) (res *bxbase.Show
 	return res, nil
 }
 
-func SelectCheck(v string) bool {
+func SelectCheck(v string, isOld bool) bool {
 	vs := strings.Split(v, ",")
 	for _, v1 := range vs {
 		if v1 != "content" && v1 != "file" && v1 != "title" {
-			return true
+			//老用户可以选用中标企业
+			if isOld && v1 == "winner" {
+				continue
+			} else {
+				return true
+			}
 		}
 	}
 	return false