|
@@ -16,6 +16,7 @@ type ActivityTypeCoAntroller struct {
|
|
// @Title 活动类型列表
|
|
// @Title 活动类型列表
|
|
// @Description活动类型列表接口
|
|
// @Description活动类型列表接口
|
|
// @Param IsResearch query bool true "是否为研选"
|
|
// @Param IsResearch query bool true "是否为研选"
|
|
|
|
+// @Param IsGetAll query bool true "是否获取所有"
|
|
// @Success 200 {object} cygx.ActivityTypeListResp
|
|
// @Success 200 {object} cygx.ActivityTypeListResp
|
|
// @router /activityType/list [get]
|
|
// @router /activityType/list [get]
|
|
func (this *ActivityTypeCoAntroller) List() {
|
|
func (this *ActivityTypeCoAntroller) List() {
|
|
@@ -32,13 +33,17 @@ func (this *ActivityTypeCoAntroller) List() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
isResearch, _ := this.GetBool("IsResearch", false)
|
|
isResearch, _ := this.GetBool("IsResearch", false)
|
|
|
|
+ isGetAll, _ := this.GetBool("IsGetAll", false)
|
|
var condition string
|
|
var condition string
|
|
resp := new(cygx.ActivityTypeListResp)
|
|
resp := new(cygx.ActivityTypeListResp)
|
|
- if isResearch {
|
|
|
|
- condition = " source_type IN (0,2) "
|
|
|
|
- } else {
|
|
|
|
- condition = " source_type IN (0,1) "
|
|
|
|
|
|
+ if !isGetAll {
|
|
|
|
+ if isResearch {
|
|
|
|
+ condition = " AND source_type IN (0,2) "
|
|
|
|
+ } else {
|
|
|
|
+ condition = " AND source_type IN (0,1) "
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
list, err := cygx.GetActivityTypeSearchList(condition)
|
|
list, err := cygx.GetActivityTypeSearchList(condition)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取失败"
|
|
br.Msg = "获取失败"
|
|
@@ -122,13 +127,13 @@ func (this *ActivityTypeCoAntroller) ListSearch() {
|
|
resp := new(cygx.ActivityTypeListResp)
|
|
resp := new(cygx.ActivityTypeListResp)
|
|
var condition string
|
|
var condition string
|
|
if searchType == 1 {
|
|
if searchType == 1 {
|
|
- condition += ` activity_type_id IN (1,2)`
|
|
|
|
|
|
+ condition += ` AND activity_type_id IN (1,2)`
|
|
} else if searchType == 2 {
|
|
} else if searchType == 2 {
|
|
- condition += ` activity_type_id IN (5,6)`
|
|
|
|
|
|
+ condition += ` AND activity_type_id IN (5,6)`
|
|
} else if searchType == 3 {
|
|
} else if searchType == 3 {
|
|
- condition += ` activity_type_id IN (3,4)`
|
|
|
|
|
|
+ condition += ` AND activity_type_id IN (3,4)`
|
|
} else {
|
|
} else {
|
|
- condition += ` activity_type_id IN (7)`
|
|
|
|
|
|
+ condition += ` AND activity_type_id IN (7)`
|
|
}
|
|
}
|
|
list, err := cygx.GetActivityTypeSearchList(condition)
|
|
list, err := cygx.GetActivityTypeSearchList(condition)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -167,9 +172,9 @@ func (this *ActivityTypeCoAntroller) MeetType() {
|
|
resp := new(cygx.ActivityTypeListResp)
|
|
resp := new(cygx.ActivityTypeListResp)
|
|
var condition string
|
|
var condition string
|
|
if meetType == 1 {
|
|
if meetType == 1 {
|
|
- condition += ` activity_type =1 `
|
|
|
|
|
|
+ condition += ` AND activity_type =1 `
|
|
} else {
|
|
} else {
|
|
- condition += ` activity_type = 0 `
|
|
|
|
|
|
+ condition += ` AND activity_type = 0 `
|
|
}
|
|
}
|
|
if isResearch {
|
|
if isResearch {
|
|
condition += " AND source_type IN (0,2) "
|
|
condition += " AND source_type IN (0,2) "
|