فهرست منبع

新增是否是老用户

wangkaiyue 4 سال پیش
والد
کامیت
29c6649075

+ 1 - 0
src/config.json

@@ -286,6 +286,7 @@
     "uploadPath": "./web/staticres/upload/res/",
     "redisSessionLockSize":20,
     "accountMergeOnline":"2055-03-30 00:00:00",
+    "bidSearchOldUserLimit": 1626105600,
     "firstBindPop":3,
     "maxBindPop":111111111111115,
     "nsq":"192.168.3.240:4260",

+ 1 - 0
src/jfw/modules/app/src/config.json

@@ -154,6 +154,7 @@
     "redisSessionLockSize":20,
     "nsq":"192.168.3.240:4260",
     "accountMergeOnline":"3333-03-30 00:00:00",
+	"bidSearchOldUserLimit": 1626105600,
     "firstBindPop":3,
     "maxBindPop":8,
     "bindPopRedis":"merge",

+ 33 - 27
src/jfw/modules/common/src/qfw/util/jy/payUser.go

@@ -4,6 +4,7 @@ import (
 	"mongodb"
 	qu "qfw/util"
 	"qfw/util/mysql"
+	"strings"
 )
 
 //是否是付费用户
@@ -57,39 +58,44 @@ func (vs *VipState) IsPayedUser() bool {
 //付费用户 全部(all)、标题(title)  正文(content)  会员: 采购单位(buyer) 中标企业(winner) 招标代理机构(agency) 附件(file)
 func (vs *VipState) GetQueryItems(selectType string, limitOldTime int64) (items []string) {
 	if vs.IsPayedUser() {
-		switch selectType {
-		case "content":
-			items = append(items, "detail")
-			break
-		case "buyer":
-			items = append(items, "mbuyer")
-			break
-		case "winner":
-			items = append(items, "mwinner")
-			break
-		case "agency":
-			items = append(items, "magency")
-			break
-		case "file":
-			items = append(items, "filetext")
-			break
-		case "all":
+		if selectType == "all" {
 			items = append(items, "title", "detail", "mbuyer", "mwinner", "magency", "filetext")
-			break
+		} else {
+			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 == "file" {
+					items = append(items, "filetext")
+				} else if t == "title" {
+					items = append(items, "title")
+				}
+			}
 		}
 		return
 	}
-	if selectType == "winner" || selectType == "all" {
-		isOldUser := vs.registerData < limitOldTime
-		if selectType == "all" {
-			if isOldUser {
-				items = append(items, "title", "detail", "mwinner")
+	isOldUser := vs.registerData != 0 && vs.registerData < limitOldTime
+	if selectType == "all" {
+		if isOldUser {
+			items = append(items, "title", "detail", "mwinner")
+		}
+	} else { //查询中标企业且是老用户
+		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 isOldUser { //查询中标企业且是老用户
-			items = append(items, "mwinner")
 		}
-	} else if selectType == "content" {
-		items = append(items, "detail")
 	}
 	return
 }

+ 7 - 4
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -432,7 +432,8 @@ func Power(userid string) (bool, map[string]interface{}) {
 	isVip, isMember, isEnt := false, false, false
 	vipstatus := 0
 	phone := ""
-	data, ok := db.Mgo.FindById("user", userid, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1`)
+	var registedate int64
+	data, ok := db.Mgo.FindById("user", userid, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1,"l_registedate":1`)
 	if data != nil && len(*data) > 0 && ok {
 		i_vip_status := qu.IntAll((*data)["i_vip_status"])
 		if i_vip_status > 1 {
@@ -468,11 +469,13 @@ func Power(userid string) (bool, map[string]interface{}) {
 			// 	isEnt = true
 			// }
 		}
+		registedate, _ = (*data)["l_registedate"].(int64)
 	}
 	return isVip || isEnt || isMember, map[string]interface{}{
-		"vip":      vipstatus,
-		"member":   isMember,
-		"entniche": isEnt,
+		"vip":         vipstatus,
+		"member":      isMember,
+		"entniche":    isEnt,
+		"registedate": registedate,
 	}
 }
 

+ 4 - 0
src/jfw/modules/publicapply/src/bidcollection/service/service.go

@@ -3,6 +3,7 @@ package service
 import (
 	. "api"
 	"bidcollection/entity"
+	"config"
 	"encoding/json"
 	"log"
 	qu "qfw/util"
@@ -135,6 +136,9 @@ func (this *ServiceStruct) Power() {
 		m, msg := map[string]interface{}{}, ""
 		if userId != "" {
 			_, m = entity.Power(userId)
+			registedate, _ := m["registedate"].(int64)
+			m["isOld"] = registedate != 0 && registedate < config.Config.BidSearchOldUserLimit
+			delete(m, "registedate")
 			//log.Println(entity.UpdateRedis("a", userId, []string{"a", "d"}))
 		}
 		return Result{Data: m, Error_msg: msg}

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

@@ -38,5 +38,6 @@
         "4c9a591604f1a3eb74857fc9de35e9ff",
         "3613232bc702d011232ed57f0027af1c"
 
-    ]
+    ],
+    "bidSearchOldUserLimit": 1626105600
 }

+ 3 - 2
src/jfw/modules/publicapply/src/config/config.go

@@ -12,8 +12,9 @@ type config struct {
 		Pwd  string
 		User string
 	}
-	Industry       string
-	DefaultEntList []string //企业查询默认展示企业
+	Industry              string
+	DefaultEntList        []string //企业查询默认展示企业
+	BidSearchOldUserLimit int64
 }
 type BidColl struct {
 	PayUserCollLimit      int    //付费用户收藏数量最大限制