|
@@ -331,7 +331,7 @@ func GetCygxArticleCollectByCompanyWeekly(startSize, pageSize int, condition str
|
|
|
func GetCygxIndustryFllowCountByCompany(condition string) (count int, err error) {
|
|
|
o := orm.NewOrmUsingDB("hz_cygx")
|
|
|
sqlCount := ` SELECT COUNT(1) AS count FROM cygx_industry_fllow AS r
|
|
|
- INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = r.industrial_management_id WHERE type = 1 ` + condition
|
|
|
+ INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = r.industrial_management_id WHERE type = 1 AND r.source IN (0,1,2) ` + condition
|
|
|
err = o.Raw(sqlCount).QueryRow(&count)
|
|
|
return
|
|
|
}
|
|
@@ -342,7 +342,7 @@ func GetCygxIndustryFllowCountByCompanyWeekly(condition string) (count int, err
|
|
|
databaseName := utils.GetWeeklyDatabase()
|
|
|
sqlCount := ` SELECT COUNT(1) AS count FROM cygx_industry_fllow AS r
|
|
|
INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = r.industrial_management_id
|
|
|
- INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2 WHERE type = 1 `
|
|
|
+ INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2 WHERE type = 1 AND r.source IN (0,1,2) `
|
|
|
sqlCount = fmt.Sprintf(sqlCount, databaseName)
|
|
|
if condition != "" {
|
|
|
sqlCount += condition
|
|
@@ -363,7 +363,7 @@ func GetCygxIndustryFllowByCompany(condition string, startSize, pageSize int) (i
|
|
|
FROM
|
|
|
cygx_industry_fllow AS r
|
|
|
INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = r.industrial_management_id
|
|
|
- WHERE type = 1 ` + condition + ` ORDER BY r.id DESC LIMIT ?,? `
|
|
|
+ WHERE type = 1 AND r.source IN (0,1,2) ` + condition + ` ORDER BY r.id DESC LIMIT ?,? `
|
|
|
_, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
@@ -384,7 +384,7 @@ func GetCygxIndustryFllowByCompanyWeekly(condition string, startSize, pageSize i
|
|
|
cygx_industry_fllow AS r
|
|
|
INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = r.industrial_management_id
|
|
|
INNER JOIN %s.user_seller_relation AS us ON us.user_id = r.user_id AND us.product_id = 2
|
|
|
- WHERE type = 1 `
|
|
|
+ WHERE type = 1 AND r.source IN (0,1,2) `
|
|
|
sql = fmt.Sprintf(sql, databaseName)
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
@@ -1022,7 +1022,7 @@ func GetCygxIndustryFllowByCompanyList(condition string, startSize, pageSize int
|
|
|
LEFT JOIN cygx_company_interaction_num AS ci ON ci.company_id = r.company_id
|
|
|
LEFT JOIN cygx_user_interaction_num as ui ON ui.user_id = r.user_id
|
|
|
|
|
|
- WHERE type = 1 ` + condition + ` ORDER BY r.create_time DESC LIMIT ?,? `
|
|
|
+ WHERE type = 1 AND r.source IN (0,1,2) ` + condition + ` ORDER BY r.create_time DESC LIMIT ?,? `
|
|
|
_, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|