rdluck 4 years ago
parent
commit
f61262bb35
3 changed files with 6 additions and 4 deletions
  1. 1 1
      models/seller.go
  2. 3 2
      models/tactics.go
  3. 2 1
      services/elastic.go

+ 1 - 1
models/seller.go

@@ -22,7 +22,7 @@ type AdminItem struct {
 
 func GetSellerByCompanyId(companyId int) (item *AdminItem, err error) {
 	o := orm.NewOrm()
-	sql := ` SELECT b.*,c.open_id,c.user_id FROM company_product AS a
+	sql := ` SELECT b.*,c.open_id,c.user_id,a.company_name FROM company_product AS a
 			INNER JOIN admin AS b ON a.seller_id=b.admin_id
 			LEFT JOIN wx_user AS c ON b.mobile=c.mobile
 			WHERE a.company_id=? AND a.product_id=2 `

+ 3 - 2
models/tactics.go

@@ -34,7 +34,7 @@ func GetTacticsList(endDate string) (list []*Tactics, err error) {
 				INNER JOIN article_content AS b ON a.id=b.article_id
 				INNER JOIN article_category AS c ON a.id=c.article_id
 				INNER JOIN article_categoryinfo AS d ON c.category_id=d.id
-				WHERE a.publish_status=1 AND a.publish_date>=? AND d.id IN (28,32,45,50,57,62,71,72,74,79,80,84,85,86,88,89,90) `
+				WHERE a.publish_status=1 AND a.publish_date>=? AND d.id IN (28,32,45,50,57,62,72,74,79,80,84,86,88,89,90) `
 	_, err = o.Raw(sql, endDate).QueryRows(&list)
 	return
 }
@@ -47,7 +47,8 @@ func GetTacticsListAll() (list []*Tactics, err error) {
 			INNER JOIN article_content AS b ON a.id=b.article_id
 			INNER JOIN article_category AS c ON a.id=c.article_id
 			INNER JOIN article_categoryinfo AS d ON c.category_id=d.id
-			WHERE a.publish_status=1 AND d.id IN (28,32,45,50,57,62,71,72,74,79,80,84,85,86,88,89,90) `
+			WHERE a.publish_status=1 AND d.id IN (28,32,45,50,57,62,72,74,79,80,84,86,88,89,90) `
+	//IN(85,71)
 	_, err = o.Raw(sql).QueryRows(&list)
 	return
 }

+ 2 - 1
services/elastic.go

@@ -420,6 +420,7 @@ func EsMultiMatchFunctionScoreQuery(indexName, keyWord string, startSize, pageSi
 		if searchByMatch.Hits != nil {
 			for _, v := range searchByMatch.Hits.Hits {
 				articleJson, err := v.Source.MarshalJSON()
+				utils.FileLog.Info("%s", string(articleJson))
 				if err != nil {
 					return nil, 0, err
 				}
@@ -453,8 +454,8 @@ func EsMultiMatchFunctionScoreQuery(indexName, keyWord string, startSize, pageSi
 				result = append(result, searchItem)
 			}
 		}
+		total = searchByMatch.Hits.TotalHits.Value
 	}
-	total = searchByMatch.Hits.TotalHits.Value
 	return
 }