|
@@ -154,15 +154,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
|
|
}
|
|
}
|
|
unix := time.Now().Unix()
|
|
unix := time.Now().Unix()
|
|
length := len(*matchInfos)
|
|
length := len(*matchInfos)
|
|
- fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city"}
|
|
|
|
- if isVipUser {
|
|
|
|
- fields = append(fields, "buyerclass")
|
|
|
|
- if isProjectInfo {
|
|
|
|
- fields = append(fields, "type")
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- fields = append(fields, "subscopeclass")
|
|
|
|
- }
|
|
|
|
|
|
+ fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip"}
|
|
var savecount int64
|
|
var savecount int64
|
|
i := length
|
|
i := length
|
|
for {
|
|
for {
|
|
@@ -171,14 +163,36 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
|
|
for i > 0 {
|
|
for i > 0 {
|
|
i--
|
|
i--
|
|
matchInfo := (*matchInfos)[i]
|
|
matchInfo := (*matchInfos)[i]
|
|
- values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix, strings.Join(matchInfo.Keys, " "), util.ObjToString((*matchInfo.Info)["area"]), util.ObjToString((*matchInfo.Info)["city"]))
|
|
|
|
|
|
+ values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix)
|
|
|
|
+ if len(matchInfo.Keys) > 0 {
|
|
|
|
+ values = append(values, strings.Join(matchInfo.Keys, " "))
|
|
|
|
+ } else {
|
|
|
|
+ values = append(values, nil)
|
|
|
|
+ }
|
|
|
|
+ if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
|
|
|
|
+ values = append(values, area)
|
|
|
|
+ } else {
|
|
|
|
+ values = append(values, nil)
|
|
|
|
+ }
|
|
|
|
+ if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
|
|
|
|
+ values = append(values, city)
|
|
|
|
+ } else {
|
|
|
|
+ values = append(values, nil)
|
|
|
|
+ }
|
|
|
|
+ if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
|
|
|
|
+ values = append(values, buyerclass)
|
|
|
|
+ } else {
|
|
|
|
+ values = append(values, nil)
|
|
|
|
+ }
|
|
|
|
+ if isProjectInfo {
|
|
|
|
+ values = append(values, 1)
|
|
|
|
+ } else {
|
|
|
|
+ values = append(values, nil)
|
|
|
|
+ }
|
|
if isVipUser {
|
|
if isVipUser {
|
|
- values = append(values, util.ObjToString((*matchInfo.Info)["buyerclass"]))
|
|
|
|
- if isProjectInfo {
|
|
|
|
- values = append(values, 1)
|
|
|
|
- }
|
|
|
|
|
|
+ values = append(values, 1)
|
|
} else {
|
|
} else {
|
|
- values = append(values, GetSubScopeClass((*matchInfo.Info)["s_subscopeclass"]))
|
|
|
|
|
|
+ values = append(values, nil)
|
|
}
|
|
}
|
|
batchSize++
|
|
batchSize++
|
|
if batchSize == BigBulkSize {
|
|
if batchSize == BigBulkSize {
|