|
@@ -857,10 +857,18 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
}
|
|
}
|
|
|
|
|
|
func SqlComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*SearchComprehensiveItem, total int, err error) {
|
|
func SqlComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*SearchComprehensiveItem, total int, err error) {
|
|
|
|
+ listListNoEnd, e := models.GetActivityIdListNoEnd()
|
|
|
|
+ var activityIds []string
|
|
|
|
+ for _, v := range listListNoEnd {
|
|
|
|
+ activityIds = append(activityIds, strconv.Itoa(v.ActivityId))
|
|
|
|
+ }
|
|
|
|
+ activityIds = append(activityIds, "0")
|
|
|
|
+
|
|
|
|
+ conditionActivity := " AND IF ( source IN('activity') , source_id IN (" + strings.Join(activityIds, ",") + ") != 31 ,1=1 )"
|
|
keyWord = "%" + keyWord + "%"
|
|
keyWord = "%" + keyWord + "%"
|
|
var conditionTitle string
|
|
var conditionTitle string
|
|
var parsTitle []interface{}
|
|
var parsTitle []interface{}
|
|
- conditionTitle = " AND is_hide = 0 AND search_title LIKE ? AND IF ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) "
|
|
|
|
|
|
+ conditionTitle = " AND is_hide = 0 AND search_title LIKE ? AND IF ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) " + conditionActivity
|
|
parsTitle = append(parsTitle, keyWord)
|
|
parsTitle = append(parsTitle, keyWord)
|
|
totalTitle, e := models.GetResourceDataCount(conditionTitle, parsTitle)
|
|
totalTitle, e := models.GetResourceDataCount(conditionTitle, parsTitle)
|
|
if e != nil {
|
|
if e != nil {
|
|
@@ -871,7 +879,7 @@ func SqlComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*
|
|
var conditionContent string
|
|
var conditionContent string
|
|
var parsContent []interface{}
|
|
var parsContent []interface{}
|
|
|
|
|
|
- conditionContent = " AND is_hide = 0 AND search_content LIKE ? AND search_title NOT LIKE ? AND IF ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) "
|
|
|
|
|
|
+ conditionContent = " AND is_hide = 0 AND search_content LIKE ? AND search_title NOT LIKE ? AND IF ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) " + conditionActivity
|
|
parsContent = append(parsContent, keyWord, keyWord)
|
|
parsContent = append(parsContent, keyWord, keyWord)
|
|
totalContent, e := models.GetResourceDataCount(conditionContent, parsContent)
|
|
totalContent, e := models.GetResourceDataCount(conditionContent, parsContent)
|
|
if e != nil {
|
|
if e != nil {
|