Browse Source

列表活动名称判断是否有 中括号

xingzai 3 years ago
parent
commit
a34f7482f6
3 changed files with 16 additions and 2 deletions
  1. 11 0
      controllers/activity.go
  2. 3 0
      models/activity.go
  3. 2 2
      models/activity_signup.go

+ 11 - 0
controllers/activity.go

@@ -7,6 +7,7 @@ import (
 	"hongze/hongze_cygx/utils"
 	"rdluck_tools/paging"
 	"strconv"
+	"strings"
 	"time"
 )
 
@@ -145,6 +146,11 @@ func (this *ActivityCoAntroller) ActivityList() {
 		br.ErrMsg = "获取失败,Err:" + errList.Error()
 		return
 	}
+	for k, v := range list {
+		if strings.Contains(v.ActivityName, "【") {
+			list[k].IsBrackets = 1
+		}
+	}
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp := new(models.GetCygxActivityListRep)
 	resp.List = list
@@ -199,6 +205,11 @@ func (this *ActivityCoAntroller) ScheduleList() {
 		br.ErrMsg = "获取失败,Err:" + errList.Error()
 		return
 	}
+	for k, v := range list {
+		if strings.Contains(v.ActivityName, "【") {
+			list[k].IsBrackets = 1
+		}
+	}
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp := new(models.GetCygxActivityListRep)
 	resp.List = list

+ 3 - 0
models/activity.go

@@ -66,6 +66,7 @@ type ActivityDetail struct {
 	ActivityTimeText        string `description:"活动时间带文字"`
 	DistinguishedGuest      string `description:"嘉宾"`
 	Host                    string `description:"主持人"`
+	Speaker                 string `description:"主讲人"`
 	MainlandTell            string `description:"大陆拨入号"`
 	HongKongTell            string `description:"香港拨入号"`
 	TaiwanTell              string `description:"台湾拨入号"`
@@ -113,6 +114,7 @@ type CygxActivityList struct {
 	ActivityTypeId          int    `description:"活动类型id"`
 	ActivityName            string `description:"活动名称"`
 	ActivityTypeName        string `description:"活动类型名称"`
+	Speaker                 string `description:"主讲人"`
 	SignupType              int    `description:"报名方式,1预约外呼,2我要报名"`
 	ChartPermissionId       int    `description:"行业id"`
 	ChartPermissionName     string `description:"行业名称"`
@@ -127,6 +129,7 @@ type CygxActivityList struct {
 	SignupNum               int    `description:"已报名人数"`
 	ActiveState             string `description:"活动进行状态 未开始:1、进行中2、已结束3"`
 	IsCancelMeetingReminder int    `description:"是否取消会议提醒 1展示取消会议提醒 ,0展示会议提醒"`
+	IsBrackets              int    `description:"是否有方括号 1是 ,0 否"`
 }
 
 type GetCygxActivityListRep struct {

+ 2 - 2
models/activity_signup.go

@@ -58,8 +58,8 @@ func AddActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 		return
 	}
 	if count > 0 {
-		sql := `UPDATE cygx_activity_signup SET is_cancel = 0  WHERE user_id=?  AND activity_id=? `
-		_, err = o.Raw(sql, item.UserId, item.ActivityId).Exec()
+		sql := `UPDATE cygx_activity_signup SET is_cancel = 0 , signup_type=? WHERE user_id=?  AND activity_id=? `
+		_, err = o.Raw(sql, item.SignupType, item.UserId, item.ActivityId).Exec()
 	} else {
 		lastId, err = o.Insert(item)
 	}