|
@@ -50,7 +50,7 @@ type ResearchReportViewersDetail struct {
|
|
|
ReportCreateDate string
|
|
|
}
|
|
|
|
|
|
-func GetResearchReportViewersDetail(startTime, reportType string) (items []*ResearchReportViewersDetail, err error) {
|
|
|
+func GetResearchReportViewersDetail(startTime,endTime, reportType string) (items []*ResearchReportViewersDetail, err error) {
|
|
|
sql := `
|
|
|
select u.real_name,c.company_name,uvh.created_time,rr.research_report_name,ifnull(rct.report_chapter_type_name,rr.report_variety) as report_variety,rr.type as research_report_type
|
|
|
from user_view_history uvh
|
|
@@ -60,15 +60,16 @@ func GetResearchReportViewersDetail(startTime, reportType string) (items []*Rese
|
|
|
left join research_report_type rrt on rrt.research_report_type_id = uvh.research_report_type_id
|
|
|
left join report_chapter_type rct on rct.report_chapter_type_id = rrt.type_id
|
|
|
where uvh.created_time > ?
|
|
|
+ and uvh.created_time <= ?
|
|
|
and rr.type =?
|
|
|
and c.company_id not in (1,16)
|
|
|
`
|
|
|
o := orm.NewOrm()
|
|
|
- _, err = o.Raw(sql, startTime, reportType).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, startTime,endTime, reportType).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetRddpReportViewersDetail(startTime string) (items []*ResearchReportViewersDetail, err error) {
|
|
|
+func GetRddpReportViewersDetail(startTime,endTime string) (items []*ResearchReportViewersDetail, err error) {
|
|
|
sql := `
|
|
|
SELECT u.real_name,c.company_name,uvh.create_time as created_time,REPLACE(SUBSTRING(r.create_time,6,5),'-','') AS report_create_date,r.title as research_report_name,r.classify_name_second as research_report_type
|
|
|
FROM hongze_rddp.report_view_record AS uvh
|
|
@@ -76,10 +77,11 @@ func GetRddpReportViewersDetail(startTime string) (items []*ResearchReportViewer
|
|
|
INNER JOIN wx_user u ON u.user_id = uvh.user_id
|
|
|
INNER JOIN company c ON c.company_id = u.company_id
|
|
|
WHERE uvh.create_time >?
|
|
|
+ AND uvh.create_time <=?
|
|
|
AND c.company_id NOT IN (1,16)
|
|
|
ORDER BY uvh.create_time DESC
|
|
|
`
|
|
|
o := orm.NewOrm()
|
|
|
- _, err = o.Raw(sql, startTime).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, startTime,endTime).QueryRows(&items)
|
|
|
return
|
|
|
}
|