Эх сурвалжийг харах

feat:企业免费用户初始化订阅数据

wangchuanjin 2 жил өмнө
parent
commit
7ac82a1d7f

+ 16 - 5
jyBXSubscribe/rpc/model/push.go

@@ -1341,13 +1341,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)
-			if common.IntAll(entInfo["i_type"]) != 2 {
+			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{})
 			}
-			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}`)