浏览代码

Merge branch 'master' into feature/v1.1.28

lianbingjie 2 年之前
父节点
当前提交
0df1e19a4c
共有 2 个文件被更改,包括 28 次插入12 次删除
  1. 23 10
      jyBXSubscribe/rpc/model/push.go
  2. 5 2
      jyBXSubscribe/rpc/model/service/matchjob.go

+ 23 - 10
jyBXSubscribe/rpc/model/push.go

@@ -1024,7 +1024,7 @@ func GetKeySet(t string, u *map[string]interface{}, data []string) (bool, []stri
 const (
 	INDEX      = "bidding"
 	TYPE       = "bidding"
-	bidField   = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount","filetext","spidercode","site","buyer","bidopentime","buyertel","buyerperson","agency","agencyperson","agencytel","s_winner",winnerperson","winnertel","signendtime","bidendtime","entidlist"`
+	bidField   = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount","filetext","spidercode","site","buyer","bidopentime","buyertel","buyerperson","agency","agencyperson","agencytel","s_winner","winnerperson","winnertel","signendtime","bidendtime","entidlist"`
 	bidTime    = `{"range":{"publishtime":{"gt":%d}}}`
 	bidSort    = `{"publishtime":"desc"}`
 	findfields = `"title"`
@@ -1067,11 +1067,11 @@ func (s *subscribePush) listManager(spqp *SubPushQueryParam, list []map[string]i
 	length := len(list)
 	resultList = make([]*bxsubscribe.SubscribeInfo, length)
 	pushInsert := []interface{}{}
-	product := ""
+	var product interface{}
 	if spqp.UserType == SubVipFlag {
-		product = "1"
+		product = 1
 	} else if spqp.UserType == MemberFlag {
-		product = "2"
+		product = 2
 	}
 	for i := length - 1; i >= 0; i-- {
 		v := list[i]
@@ -1111,7 +1111,7 @@ func (s *subscribePush) listManager(spqp *SubPushQueryParam, list []map[string]i
 		pushInsert = append(pushInsert, common.InterfaceToStr(infoid), matchkey, now, area, city, buyerclass, toptype, subtype, subscopeclassStr, budget, bidamount, attachment_count)
 		switch s.ModuleFlag {
 		case EntnicheFlag:
-			pushInsert = append(pushInsert, entid, deptid, entUserId, 1, product)
+			pushInsert = append(pushInsert, entUserId, entid, deptid, 1, product)
 		case MemberFlag:
 			pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId))
 		case SubVipFlag:
@@ -1345,11 +1345,24 @@ func (s *subscribePush) getUserInfo(spqp *SubPushQueryParam) (vc *ViewCondition)
 		entInfo, deptId := (&ms.MatchJob{}).Start(entId, entUserId)
 		if entInfo != nil && len(entInfo) > 0 {
 			spqp.DeptId = strconv.Itoa(deptId)
-			isPayBool = true
-			tmpInfo.Items, _ = entInfo["a_items"].([]interface{})
-			tmpInfo.BuyerClass, _ = entInfo["a_buyerclass"].([]interface{})
-			tmpInfo.SubType, _ = entInfo["a_infotype"].([]interface{})
-			tmpInfo.Area, _ = entInfo["o_area"].(map[string]interface{})
+			if common.IntAll(entInfo["i_type"]) == 2 {
+				if entInfo["a_key"] != nil {
+					tmpInfo.Items, _ = entInfo["a_key"].([]interface{})
+					//信息类型
+					tmpInfo.SubType, _ = entInfo["a_infotype"].([]interface{})
+					//省份
+					tmpInfo.Area, _ = entInfo["o_area"].(map[string]interface{})
+					if common.IntAllDef(entInfo["i_ppstatus"], 0) == 1 && entInfo["o_area_p"] != nil {
+						tmpInfo.Area, _ = entInfo["o_area_p"].(map[string]interface{})
+					}
+				}
+			} else {
+				isPayBool = true
+				tmpInfo.Items, _ = entInfo["a_items"].([]interface{})
+				tmpInfo.BuyerClass, _ = entInfo["a_buyerclass"].([]interface{})
+				tmpInfo.SubType, _ = entInfo["a_infotype"].([]interface{})
+				tmpInfo.Area, _ = entInfo["o_area"].(map[string]interface{})
+			}
 		}
 	default:
 		userMap, ok := IC.Mgo.FindById("user", spqp.UserId, `{"o_jy":1}`)

+ 5 - 2
jyBXSubscribe/rpc/model/service/matchjob.go

@@ -1,11 +1,12 @@
 package service
 
 import (
-	util "app.yhyue.com/moapp/jybase/common"
 	"fmt"
-	"github.com/zeromicro/go-zero/core/logx"
 	IC "jyBXSubscribe/rpc/init"
 	"log"
+
+	util "app.yhyue.com/moapp/jybase/common"
+	"github.com/zeromicro/go-zero/core/logx"
 )
 
 //用户基本信息
@@ -46,6 +47,7 @@ func (m *MatchJob) LoadSubSet(entId int) map[*UserInfo]bool {
 		"i_deptid":   1,
 		"i_userid":   1,
 		"o_entniche": 1,
+		"i_type":     1,
 	}).Iter()
 	log.Println("it", it)
 	for _temp := make(map[string]interface{}); it.Next(&_temp); {
@@ -71,6 +73,7 @@ func (m *MatchJob) LoadSubSet(entId int) map[*UserInfo]bool {
 				logx.Info("订阅设置为空,过滤掉", entName, entId, deptName, deptId, userId)
 				return
 			}
+			subSet["i_type"] = temp["i_type"]
 			//
 			if deptId > 0 { //部门订阅
 				if EntDepts[deptId].Subdis == 0 {