|
@@ -16,6 +16,10 @@ type ActivityCoAntroller struct {
|
|
|
BaseAuthController
|
|
|
}
|
|
|
|
|
|
+type ActivityABaseController struct {
|
|
|
+ BaseCommonController
|
|
|
+}
|
|
|
+
|
|
|
// @Title 活动类型列表
|
|
|
// @Description活动类型列表接口
|
|
|
// @Success 200 {object} models.ActivityTypeListResp
|
|
@@ -53,8 +57,9 @@ func (this *ActivityCoAntroller) List() {
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Param ChartPermissionIds query string false "行业id 多个用 , 隔开"
|
|
|
// @Param ActivityTypeIds query string false "活动类型id 多个用 , 隔开"
|
|
|
-// @Param KeyWord query string false "搜索关键词"
|
|
|
+// @Param KeyWord query string false "搜索关键词 多个用 , 隔开"
|
|
|
// @Param ActiveState query string false "活动进行状态 未开始:1、进行中2、已结束3"
|
|
|
+// @Param WhichDay query string false "哪一天 今天:1、明天:2,多个用 , 隔开"
|
|
|
// @Param IsShowJurisdiction query int false "是否仅展示有权限的,1是,2否 默认为零"
|
|
|
// @Success 200 {object} models.GetCygxActivityListRep
|
|
|
// @router /list [get]
|
|
@@ -77,6 +82,7 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
chartPermissionIds := this.GetString("ChartPermissionIds")
|
|
|
activityTypeIds := this.GetString("ActivityTypeIds")
|
|
|
+ whichDay := this.GetString("WhichDay")
|
|
|
isShowJurisdiction, _ := this.GetInt("IsShowJurisdiction")
|
|
|
|
|
|
keyWord := this.GetString("KeyWord")
|
|
@@ -145,7 +151,6 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
if isShowJurisdiction == 1 && chartPermissionIds == "" && userType == 4 {
|
|
|
activityTypeIds = "1,3"
|
|
|
}
|
|
|
-
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
@@ -157,14 +162,22 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
//活动可见限制
|
|
|
-
|
|
|
var sqlExport string
|
|
|
if userType == 3 && strings.Contains(permissionStr, "专家") {
|
|
|
sqlExport = ` OR ( is_limit_people = 1 OR customer_type_ids LIKE '%4%' ) `
|
|
|
}
|
|
|
condition += ` AND (is_limit_people = 0 OR(is_limit_people = 1 AND customer_type_ids LIKE'%` + strconv.Itoa(userType) + `%') ` + sqlExport + `) `
|
|
|
if keyWord != "" {
|
|
|
- condition += ` AND (art.activity_name LIKE '%` + keyWord + `%' )`
|
|
|
+ slicekeyWord := strings.Split(keyWord, ",")
|
|
|
+ var sqlOr string
|
|
|
+ if len(slicekeyWord) >= 2 {
|
|
|
+ for _, v := range slicekeyWord {
|
|
|
+ sqlOr += ` OR art.activity_name LIKE '%` + v + `%' `
|
|
|
+ }
|
|
|
+ condition += ` AND (art.activity_name LIKE '%` + keyWord + `%' ` + sqlOr + ` )`
|
|
|
+ } else {
|
|
|
+ condition += ` AND (art.activity_name LIKE '%` + keyWord + `%' )`
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//行业名称
|
|
@@ -174,6 +187,22 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
if activityTypeIds != "" {
|
|
|
condition += ` AND art.activity_type_id IN (` + activityTypeIds + `)`
|
|
|
}
|
|
|
+ if whichDay != "" {
|
|
|
+ var startDate string
|
|
|
+ var endDate string
|
|
|
+ if whichDay == "1" {
|
|
|
+ startDate = time.Now().Format(utils.FormatDate)
|
|
|
+ endDate = startDate
|
|
|
+ } else if whichDay == "2" {
|
|
|
+ startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
|
|
|
+ endDate = startDate
|
|
|
+ } else {
|
|
|
+ startDate = time.Now().Format(utils.FormatDate)
|
|
|
+ endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
|
|
|
+ }
|
|
|
+ condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
|
|
|
+ condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
|
|
|
+ }
|
|
|
|
|
|
condition += ` AND art.publish_status = 1 `
|
|
|
if activeState != "" {
|
|
@@ -1351,3 +1380,28 @@ func (this *ActivityCoAntroller) MeetingReminderCancel() {
|
|
|
br.Msg = "会议提醒已取消"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// @Title 敏捷搜索关键词的列表
|
|
|
+// @Description 获取敏捷搜索关键词的列表接口
|
|
|
+// @Success 200 {object} models.ActivityFastsearchKeywordsListResp
|
|
|
+// @router /fastSearchKeWord [get]
|
|
|
+func (this *ActivityABaseController) FastSearch() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+
|
|
|
+ resp := new(models.ActivityFastsearchKeywordsListResp)
|
|
|
+ list, err := models.GetActivityFastsearchKeywordsList()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.List = list
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|