|
@@ -65,7 +65,7 @@ type CompanyViewTotalSlice struct {
|
|
|
func GetCompanyViewMobileTotalList(date string) (items []*CompanyViewTotalSlice, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT sum(a.view_num) total,a.date,b.company_id FROM user_view_statistics a join wx_user b on a.mobile=b.mobile
|
|
|
-WHERE a.mobile != "" and a.date = ? group by company_id`
|
|
|
+WHERE a.mobile != "" and b.mobile != "" and a.date = ? group by company_id`
|
|
|
_, err = o.Raw(sql, date).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
@@ -74,7 +74,7 @@ WHERE a.mobile != "" and a.date = ? group by company_id`
|
|
|
func GetCompanyViewEmailTotalList(date string) (items []*CompanyViewTotalSlice, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT sum(a.view_num) total,a.date,b.company_id FROM user_view_statistics a join wx_user b on a.email=b.email
|
|
|
-WHERE a.email != "" and a.date = ? group by company_id`
|
|
|
+WHERE a.email != "" and b.email != "" and a.date = ? group by company_id`
|
|
|
_, err = o.Raw(sql, date).QueryRows(&items)
|
|
|
return
|
|
|
}
|