|
@@ -119,7 +119,7 @@ func KeysetViewDatasCount(userId, key, notkey string, matchway int, positionType
|
|
|
return elastic.Count(INDEX, TYPE, qstr)
|
|
|
}
|
|
|
|
|
|
-//获取vip订阅预览的查询语句
|
|
|
+// 获取vip订阅预览的查询语句
|
|
|
func GetVIPViewSql(userId string, scd *ViewCondition) string {
|
|
|
query := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": %d}}}`
|
|
|
query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
|
|
@@ -245,7 +245,6 @@ func GetVIPViewSql(userId string, scd *ViewCondition) string {
|
|
|
return qstr
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func GetSqlObjFromId(_id, item string, index int, positionType, entId, entUserId int64) *ViewCondition {
|
|
|
query := Compatible.Select(_id, `{"o_vipjy":1}`)
|
|
|
o_vipjy, _ := (*query)["o_vipjy"].(map[string]interface{})
|
|
@@ -266,7 +265,6 @@ func GetSqlObjFromId(_id, item string, index int, positionType, entId, entUserId
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func getStringArrFromDbResult(area map[string]interface{}, i int) (arr []string) {
|
|
|
if area == nil {
|
|
|
return
|
|
@@ -288,7 +286,7 @@ func getStringArrFromDbResult(area map[string]interface{}, i int) (arr []string)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//关键词 附加词 排除词
|
|
|
+// 关键词 附加词 排除词
|
|
|
func getKeyWordArrFromDbResult(a_items []interface{}, item string, index int) (arr []ViewKeyWord) {
|
|
|
if a_items == nil {
|
|
|
return
|
|
@@ -330,7 +328,7 @@ func getKeyWordArrFromDbResult(a_items []interface{}, item string, index int) (a
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//初始化vip订阅关键词
|
|
|
+// 初始化vip订阅关键词
|
|
|
func MergeKws(userId string, positionType, entId, entUserId int64) {
|
|
|
defer qutil.Catch()
|
|
|
if userId == "" { //11-11 取消此操作
|
|
@@ -364,7 +362,8 @@ func GetDATE(val int, m int, endTime int64) (tt time.Time) {
|
|
|
if val == 3 {
|
|
|
//结束日期 按照 自然日 算 (例:11.11开通 11.17 23.59.59结束)
|
|
|
endTime = endTime + int64(m*24*60*60) - 1
|
|
|
- tt = time.Unix(endTime, 0)
|
|
|
+ tmp := time.Unix(endTime, 0)
|
|
|
+ tt = time.Date(tmp.Year(), tmp.Month(), tmp.Day(), 23, 59, 59, 0, time.Local)
|
|
|
return
|
|
|
}
|
|
|
//一年12个月
|