|
@@ -0,0 +1,39 @@
|
|
|
+package roadshow
|
|
|
+
|
|
|
+import (
|
|
|
+ "time"
|
|
|
+ "github.com/rdlucklib/rdluck_tools/orm"
|
|
|
+)
|
|
|
+
|
|
|
+type RsCalendarResearcher struct {
|
|
|
+ RsCalendarResearcherId int `orm:"column(rs_calendar_researcher_id);pk"`
|
|
|
+ RsCalendarId int `description:"日历活动id"`
|
|
|
+ ResearcherId int `description:"研究员id"`
|
|
|
+ ResearcherName string `description:"研究员名称"`
|
|
|
+ StartDate string `description:"开始日期"`
|
|
|
+ EndDate string `description:"结束日期"`
|
|
|
+ StartTime string `description:"开始时间"`
|
|
|
+ EndTime string `description:"结束时间"`
|
|
|
+ StartWeek string `description:"开始日期对应周"`
|
|
|
+ EndWeek string `description:"结束日期对应周"`
|
|
|
+ CreateTime time.Time
|
|
|
+ ModifyTime time.Time
|
|
|
+ Status int `description:"状态:1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束"`
|
|
|
+ RefuseReason string `description:"拒绝理由"`
|
|
|
+ RefuseTime time.Time `description:"拒绝时间"`
|
|
|
+ DeleteReason string `description:"删除理由"`
|
|
|
+}
|
|
|
+
|
|
|
+func GetRsCalendarResearcher(endDate, endTime string) (list []*RsCalendarResearcher, err error) {
|
|
|
+ sql := `SELECT * FROM rs_calendar_researcher WHERE status<>6 AND end_date=? AND end_time<=? `
|
|
|
+ o := orm.NewOrm()
|
|
|
+ _, err = o.Raw(sql, endDate, endTime).QueryRows(&list)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func ModifyRsCalendarResearcherStatus(rsCalendarResearcherId int) (err error) {
|
|
|
+ sql := ` UPDATE rs_calendar_researcher SET status=6,modify_time=NOW() WHERE rs_calendar_researcher_id=? `
|
|
|
+ o := orm.NewOrm()
|
|
|
+ _, err = o.Raw(sql, rsCalendarResearcherId).Exec()
|
|
|
+ return
|
|
|
+}
|