|
@@ -2786,33 +2786,31 @@ func (this *ActivityCoAntroller) ActivityListNew() {
|
|
|
var activityList []*models.ActivityDetail
|
|
|
mapDingActivityId := make(map[int]int)
|
|
|
//进行中的活动拍在最上面
|
|
|
- //if keyWord != "" {
|
|
|
- // conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, strconv.Itoa(2), label, 0, source, keyWord)
|
|
|
- // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- // br.Msg = "获取失败"
|
|
|
- // br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if source == 1 {
|
|
|
- // condition += ` AND art.yidong_activity_id = '' `
|
|
|
- // }
|
|
|
- // condition += ` AND art.is_limit_people = 1 AND art.publish_status = 1 ` + conditionActivity
|
|
|
- // condition += ` ORDER BY art.activity_time ASC `
|
|
|
- // listDing, err := models.GetActivityListAll(condition, pars, uid, startSize, pageSize, playBack)
|
|
|
- // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- // br.Msg = "获取失败"
|
|
|
- // br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if len(listDing) > 0 {
|
|
|
- // for _, v := range listDing {
|
|
|
- // activityList = append(activityList, v)
|
|
|
- // mapDingActivityId[v.ActivityId] = v.ActivityId
|
|
|
- // }
|
|
|
- // }
|
|
|
- // return
|
|
|
- // fmt.Println("len", len(listDing))
|
|
|
- //}
|
|
|
+ if keyWord != "" {
|
|
|
+ conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, strconv.Itoa(2), label, 0, source, keyWord)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if source == 1 {
|
|
|
+ condition += ` AND art.yidong_activity_id = '' `
|
|
|
+ }
|
|
|
+ condition += ` AND art.is_limit_people = 1 AND art.publish_status = 1 ` + conditionActivity
|
|
|
+ condition += ` ORDER BY art.activity_time ASC `
|
|
|
+ listDing, err := models.GetActivityListAll(condition, pars, uid, startSize, pageSize, playBack)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(listDing) > 0 {
|
|
|
+ for _, v := range listDing {
|
|
|
+ activityList = append(activityList, v)
|
|
|
+ mapDingActivityId[v.ActivityId] = v.ActivityId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
condition = ""
|
|
|
//活动可见限制
|
|
|
conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source, keyWord)
|