|
@@ -1064,14 +1064,14 @@ const (
|
|
|
|
|
|
// 首次访问推送页面 默认生成推送数据
|
|
// 首次访问推送页面 默认生成推送数据
|
|
// 默认匹配es 7天内数据
|
|
// 默认匹配es 7天内数据
|
|
-func (s *subscribePush) DefaultDatas(spqp *SubPushQueryParam) (hasNextPage bool, total int64, result []*bxsubscribe.SubscribeInfo) {
|
|
|
|
|
|
+func (s *subscribePush) DefaultDatas(spqp *SubPushQueryParam, bsp *ViewCondition) (hasNextPage bool, total int64, result []*bxsubscribe.SubscribeInfo) {
|
|
if spqp.UserId == "" {
|
|
if spqp.UserId == "" {
|
|
return false, 0, nil
|
|
return false, 0, nil
|
|
}
|
|
}
|
|
t1 := time.Now()
|
|
t1 := time.Now()
|
|
logx.Info("userId:", spqp.UserId, "newUserId:", spqp.NewUserId)
|
|
logx.Info("userId:", spqp.UserId, "newUserId:", spqp.NewUserId)
|
|
//用户信息
|
|
//用户信息
|
|
- bsp := s.getUserInfo(spqp)
|
|
|
|
|
|
+ //bsp := s.GetUserInfo(spqp)
|
|
logx.Info("获取用户信息耗时:", time.Since(t1))
|
|
logx.Info("获取用户信息耗时:", time.Since(t1))
|
|
t2 := time.Now()
|
|
t2 := time.Now()
|
|
if len(bsp.Keyword) > 0 {
|
|
if len(bsp.Keyword) > 0 {
|
|
@@ -1205,7 +1205,7 @@ func getKeys(title string, keywords []ViewKeyWord) (str []string) {
|
|
|
|
|
|
// 获取查询语句
|
|
// 获取查询语句
|
|
func (s *subscribePush) getDefaultDatasSQL(bsp *ViewCondition) (str string) {
|
|
func (s *subscribePush) getDefaultDatasSQL(bsp *ViewCondition) (str string) {
|
|
- query := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": %d}}}`
|
|
|
|
|
|
+ query := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": %d}}, "size": 500}`
|
|
query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
|
|
query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
|
|
multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
|
|
multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
|
|
query_bool_must_and := `{"bool":{"must":[%s]%s}}`
|
|
query_bool_must_and := `{"bool":{"must":[%s]%s}}`
|
|
@@ -1214,7 +1214,7 @@ func (s *subscribePush) getDefaultDatasSQL(bsp *ViewCondition) (str string) {
|
|
bools := []string{}
|
|
bools := []string{}
|
|
musts := []string{}
|
|
musts := []string{}
|
|
//发布时间最新7天(正式环境需要修改)
|
|
//发布时间最新7天(正式环境需要修改)
|
|
- musts = append(musts, fmt.Sprintf(bidTime, time.Now().AddDate(0, 0, -7).Unix()))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(bidTime, time.Now().AddDate(0, 0, -15).Unix()))
|
|
//省份
|
|
//省份
|
|
areaCity := []string{}
|
|
areaCity := []string{}
|
|
if len(bsp.Area) > 0 {
|
|
if len(bsp.Area) > 0 {
|
|
@@ -1349,7 +1349,7 @@ type ViewCondition struct {
|
|
}
|
|
}
|
|
|
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
-func (s *subscribePush) getUserInfo(spqp *SubPushQueryParam) (vc *ViewCondition) {
|
|
|
|
|
|
+func (s *subscribePush) GetUserInfo(spqp *SubPushQueryParam) (vc *ViewCondition) {
|
|
var isPayBool = false
|
|
var isPayBool = false
|
|
var tmpInfo = struct {
|
|
var tmpInfo = struct {
|
|
Items []interface{}
|
|
Items []interface{}
|