|
@@ -390,6 +390,7 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
// @Description 我的日程列表接口
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
+// @Param Source query int false "来源 0:手机 ,1:Pc 默认0"
|
|
|
// @Success 200 {object} models.GetCygxActivityListRep
|
|
|
// @router /scheduleList [get]
|
|
|
func (this *ActivityCoAntroller) ScheduleList() {
|
|
@@ -407,6 +408,7 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
uid := user.UserId
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+ source, _ := this.GetInt("Source")
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
@@ -419,6 +421,10 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
var conditionCount string
|
|
|
var pars []interface{}
|
|
|
condition += ` AND art.publish_status = 1 `
|
|
|
+ if source == 1 {
|
|
|
+ condition += ` AND art.yidong_activity_id = '' `
|
|
|
+ conditionCount += ` AND art.yidong_activity_id = '' `
|
|
|
+ }
|
|
|
total, err := models.GetScheduleCount(conditionCount, uid)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
if err != nil {
|
|
@@ -437,6 +443,9 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
//全部都是进行中的活动
|
|
|
if totalCount > currentIndex*pageSize {
|
|
|
condition += ` AND art.active_state IN(2) `
|
|
|
+ if source == 1 {
|
|
|
+ condition += ` AND art.yidong_activity_id = '' `
|
|
|
+ }
|
|
|
listHave, errList := models.GetScheduleList(condition, pars, uid, startSize, pageSize)
|
|
|
list = listHave
|
|
|
if errList != nil {
|
|
@@ -446,6 +455,9 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
}
|
|
|
} else if totalCount > currentIndex-1*pageSize && totalCount < currentIndex*pageSize { //部分是进行中的活动
|
|
|
condition = ` AND art.publish_status = 1 AND art.active_state IN(2) `
|
|
|
+ if source == 1 {
|
|
|
+ condition += ` AND art.yidong_activity_id = '' `
|
|
|
+ }
|
|
|
listHave, errList := models.GetScheduleList(condition, pars, uid, startSize, pageSize)
|
|
|
list = listHave
|
|
|
if errList != nil {
|
|
@@ -455,6 +467,9 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
}
|
|
|
pageSize = pageSize - len(listHave)
|
|
|
condition = ` AND art.publish_status = 1 AND art.active_state IN(1,3) `
|
|
|
+ if source == 1 {
|
|
|
+ condition += ` AND art.yidong_activity_id = '' `
|
|
|
+ }
|
|
|
listOther, errList := models.GetScheduleList(condition, pars, uid, startSize, pageSize)
|
|
|
if errList != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -2658,6 +2673,7 @@ func (this *ActivityCoAntroller) LabelMoreList() {
|
|
|
// @Param WhichDay query string false "哪一天 今天:1、明天:2,多个用 , 隔开"
|
|
|
// @Param ActiveState query string false "活动进行状态 未开始:1、进行中2、已结束3"
|
|
|
// @Param ActivityTypeId query string false "活动类型id 多个用 , 隔开"
|
|
|
+// @Param Source query int false "来源 0手机 ,1Pc 默认0"
|
|
|
// @Success 200 {object} models.GetCygxActivityListRep
|
|
|
// @router /listNew [get]
|
|
|
func (this *ActivityCoAntroller) ActivityListNew() {
|
|
@@ -2675,6 +2691,7 @@ func (this *ActivityCoAntroller) ActivityListNew() {
|
|
|
uid := user.UserId
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+ source, _ := this.GetInt("Source")
|
|
|
label := this.GetString("Label")
|
|
|
chartPermissionIds := this.GetString("ChartPermissionIds")
|
|
|
whichDay := this.GetString("WhichDay")
|
|
@@ -2707,12 +2724,15 @@ func (this *ActivityCoAntroller) ActivityListNew() {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
//活动可见限制
|
|
|
- conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0)
|
|
|
+ conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source)
|
|
|
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 ` + conditionActivity
|
|
|
total, err := models.GetActivityCount(condition, pars)
|
|
|
if err != nil {
|
|
@@ -3301,7 +3321,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
|
|
|
continue
|
|
|
}
|
|
|
var condition string
|
|
|
- conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower)
|
|
|
+ conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower, 0)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
@@ -3582,10 +3602,6 @@ func (this *ActivityCoAntroller) SpecialList() {
|
|
|
mapChart[chartName] = imgUrlChart
|
|
|
}
|
|
|
for k, v := range list {
|
|
|
- //if v.ChartPermissionName == "研选" {
|
|
|
- // list[k].ActivityTypeName = "研选电话会"
|
|
|
- // list[k].ImgUrlText = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211221/bIdfv8t86xrFRpDOeGGHXOmKEuKl.png"
|
|
|
- //}
|
|
|
list[k].ImgUrlText = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211221/bIdfv8t86xrFRpDOeGGHXOmKEuKl.png"
|
|
|
if mapChart[v.ChartPermissionName] != "" {
|
|
|
list[k].ImgUrl = mapChart[v.ChartPermissionName]
|
|
@@ -4288,14 +4304,14 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
|
|
|
}
|
|
|
var condition string
|
|
|
|
|
|
- conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower)
|
|
|
+ conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower, 1)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
//condition += `AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
|
|
|
- condition += `AND art.is_limit_people = 1 ` + conditionActivity
|
|
|
+ condition += `AND art.is_limit_people = 1 AND art.yidong_activity_id = '' ` + conditionActivity
|
|
|
sortTime = ` mintimesort ASC `
|
|
|
labelList, err := models.GetActivityLabelListAll(condition, sortTime, pars, startSize, pageSize)
|
|
|
if err != nil {
|