|
@@ -541,3 +541,40 @@ func GetRsMattersList(startDate, endDate string, researcherId int) (list []*RsMa
|
|
|
_, err = o.Raw(sql, startDate, endDate, researcherId).QueryRows(&list)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+func GetCalendarTypeList(condition string, pars []interface{}, startSize, pageSize int) (list []*CalendarListView, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := ` SELECT a.rs_calendar_id,a.activity_type,a.roadshow_type,a.activity_category,a.roadshow_platform,b.create_time,
|
|
|
+ b.modify_time,GROUP_CONCAT(b.researcher_id ORDER BY researcher_sort ASC) AS researcher_id,GROUP_CONCAT(b.researcher_name ORDER BY researcher_sort ASC) AS researcher_name,
|
|
|
+ b.rs_calendar_researcher_id,b.start_date,
|
|
|
+ b.end_date,b.start_time,b.end_time,b.start_week,b.end_week,b.status,b.refuse_reason,b.refuse_time,
|
|
|
+ b.delete_reason,a.sys_user_real_name,a.city,a.province,a.company_name,a.company_id,
|
|
|
+ a.cooperation_name,a.theme,a.activity_category
|
|
|
+ FROM rs_calendar AS a
|
|
|
+ INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
|
|
|
+ WHERE 1=1
|
|
|
+ `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ sql += ` GROUP BY a.rs_calendar_id
|
|
|
+ ORDER BY b.create_time DESC LIMIT ?,? `
|
|
|
+ _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func GetCalendarTypeListCount(condition string, pars []interface{}) (count int, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT COUNT(1) AS count FROM(SELECT COUNT(1) AS count
|
|
|
+ FROM rs_calendar AS a
|
|
|
+ INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
|
|
|
+ WHERE 1=1 `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ sql += ` GROUP BY a.rs_calendar_id ) AS t `
|
|
|
+ err = o.Raw(sql, pars).QueryRow(&count)
|
|
|
+ return
|
|
|
+}
|