Bladeren bron

Merge branch 'crm/crm_16.6' into debug

317699326@qq.com 1 maand geleden
bovenliggende
commit
27ec18891a
1 gewijzigde bestanden met toevoegingen van 32 en 0 verwijderingen
  1. 32 0
      controllers/roadshow/calendar.go

+ 32 - 0
controllers/roadshow/calendar.go

@@ -1158,6 +1158,10 @@ func (this *CalendarController) ResearcherList() {
 // @Param   PageSize   query   int  true       "每页数据条数"
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Param   CalendarType   query   int  true       "1:待处理申请,2:已处理申请,3:内部会议,4:报告电话会"
+// @Param   Status   query   int  true       "1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束"
+// @Param   StartDate   query   string  true       "开始日期"
+// @Param   EndDate   query   string  true       "结束日期"
+// @Param   Keyword			query	string	false	"关键词: 客户名称/社会信用码"
 // @Success 200 {object} roadshow.CalendarListResp
 // @router /calendar/list [get]
 func (this *CalendarController) CalendarList() {
@@ -1180,6 +1184,11 @@ func (this *CalendarController) CalendarList() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 
+	status, _ := this.GetInt("Status")
+	startDate := this.GetString("StartDate")
+	endDate := this.GetString("EndDate")
+	keyword := this.GetString("Keyword")
+
 	var total int
 	page := paging.GetPaging(currentIndex, pageSize, total)
 
@@ -1256,6 +1265,29 @@ func (this *CalendarController) CalendarList() {
 		br.ErrMsg = "参数错误,calendarType:" + strconv.Itoa(calendarType)
 		return
 	}
+
+	if status > 0 {
+		condition += ` AND b.status = ?`
+		pars = append(pars, status)
+	}
+
+	if startDate != "" {
+		condition += ` AND b.start_date >= ?`
+		pars = append(pars, startDate)
+	}
+
+	if endDate != "" {
+		condition += ` AND b.start_date <= ?`
+		pars = append(pars, endDate)
+	}
+
+	keyword = strings.TrimSpace(keyword)
+	if keyword != "" {
+		kw := fmt.Sprint("%", keyword, "%")
+		condition += ` AND a.company_name LIKE ? `
+		pars = append(pars, kw)
+	}
+
 	fmt.Println(condition)
 	resp := new(roadshow.CalendarListResp)
 	total, err := roadshow.GetCalendarListCount(condition, pars, calendarType)