|
@@ -105,6 +105,9 @@ func WinningAnalysis(thisWinnerRow BuyerWinnerRow, rMap *sync.Map, entArrMap map
|
|
|
} else {
|
|
|
_d.Data = ss
|
|
|
}
|
|
|
+ if len(countMap) >= Top30 {
|
|
|
+ break
|
|
|
+ }
|
|
|
countMap = append(countMap, _d)
|
|
|
}
|
|
|
|
|
@@ -152,6 +155,9 @@ func WinningAnalysis(thisWinnerRow BuyerWinnerRow, rMap *sync.Map, entArrMap map
|
|
|
} else {
|
|
|
_d.Data = ss
|
|
|
}
|
|
|
+ if len(amountMap) >= Top30 {
|
|
|
+ break
|
|
|
+ }
|
|
|
amountMap = append(amountMap, _d)
|
|
|
}
|
|
|
rMap.Store("winner_time_distribution", buyerMap)
|
|
@@ -292,6 +298,9 @@ func BuyerAnalysis(thisBuyerRow BuyerWinnerRow, rMap *sync.Map, winnerName map[s
|
|
|
} else {
|
|
|
_d.Data = ss
|
|
|
}
|
|
|
+ if len(countMap) >= Top30 {
|
|
|
+ break
|
|
|
+ }
|
|
|
countMap = append(countMap, _d)
|
|
|
}
|
|
|
|
|
@@ -341,6 +350,9 @@ func BuyerAnalysis(thisBuyerRow BuyerWinnerRow, rMap *sync.Map, winnerName map[s
|
|
|
} else {
|
|
|
_d.Data = ss
|
|
|
}
|
|
|
+ if len(amountMap) >= Top30 {
|
|
|
+ break
|
|
|
+ }
|
|
|
amountMap = append(amountMap, _d)
|
|
|
}
|
|
|
rMap.Store("buyer_time_distribution", buyerMap)
|
|
@@ -820,12 +832,14 @@ func GetEntNameByIds(ids []string) (returnMap map[string]string) {
|
|
|
|
|
|
// GetMsgOpen 获取用户服务通知开关是否开启
|
|
|
func GetMsgOpen(mgo *mongodb.MongodbSim, mgoUserId string, positionType int, entId, entUserId int) bool {
|
|
|
- pushSetMap := &map[string]interface{}{}
|
|
|
- if positionType == 1 {
|
|
|
- pushSetMap, _ = mgo.FindOne("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": entUserId})
|
|
|
- } else {
|
|
|
- pushSetMap, _ = mgo.FindById("user", mgoUserId, `{"o_pushset":1,"s_m_openid":1}`)
|
|
|
- }
|
|
|
+ //-- 服务通知不区分身份,只存在user表中
|
|
|
+ //pushSetMap := &map[string]interface{}{}
|
|
|
+ //if positionType == 1 {
|
|
|
+ // pushSetMap, _ = mgo.FindOne("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": entUserId})
|
|
|
+ //} else {
|
|
|
+ // pushSetMap, _ = mgo.FindById("user", mgoUserId, `{"o_pushset":1,"s_m_openid":1}`)
|
|
|
+ //}
|
|
|
+ pushSetMap, _ := mgo.FindById("user", mgoUserId, `{"o_pushset":1,"s_m_openid":1}`)
|
|
|
//log.Println(mgoUserId, pushSetMap)
|
|
|
if pushSetMap != nil && len(*pushSetMap) > 0 {
|
|
|
pushset := common.ObjToMap((*pushSetMap)["o_pushset"])
|