浏览代码

Merge branch 'cygx_8.7' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 2 年之前
父节点
当前提交
ce31a701f4
共有 5 个文件被更改,包括 16 次插入17 次删除
  1. 4 7
      controllers/activity.go
  2. 3 3
      models/activity.go
  3. 1 1
      models/db.go
  4. 6 4
      services/activity.go
  5. 2 2
      utils/common.go

+ 4 - 7
controllers/activity.go

@@ -2577,8 +2577,6 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 		return
 	}
 
-
-
 	var conditionOrder string
 	if activeState == "2" || activeState == "3" {
 		conditionOrder = ` ORDER BY art.activity_time DESC  `
@@ -4692,7 +4690,7 @@ func (this *ActivityCoAntroller) OverActivityList() {
 	isPower, _ := this.GetInt("IsPower")
 	chartPermissionIds := this.GetString("ChartPermissionIds")
 	whichDay := this.GetString("WhichDay")
-	fmt.Println("whichDay:",whichDay)
+	fmt.Println("whichDay:", whichDay)
 	typeName := this.GetString("TypeName")
 
 	//入参为 undefined 时的处理
@@ -4703,7 +4701,6 @@ func (this *ActivityCoAntroller) OverActivityList() {
 		whichDay = ""
 	}
 
-
 	userType, permissionStr, err := services.GetUserType(user.CompanyId)
 	if err != nil {
 		br.Msg = "获取失败"
@@ -4811,7 +4808,7 @@ func (this *ActivityCoAntroller) OverActivityList() {
 		} else if whichDay == "4" {
 			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
 			endDate = utils.GetLastWeekSunday().Format(utils.FormatDate)
-		}  else if whichDay == "5" {
+		} else if whichDay == "5" {
 			startDate = utils.GetNowMonthFirstDay().Format(utils.FormatDate)
 			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
 		} else if whichDay == "6" {
@@ -4833,11 +4830,11 @@ func (this *ActivityCoAntroller) OverActivityList() {
 	if len(chartPermissionIds) > 0 {
 		condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
 	}
-	if typeName != ""{
+	if typeName != "" {
 		typeSlice := strings.Split(typeName, ",")
 		tempCondition := ""
 		for _, s := range typeSlice {
-			if s == "1"{
+			if s == "1" {
 				tempCondition += "'专家电话会',"
 			} else if s == "2" {
 				tempCondition += "'分析师电话会',"

+ 3 - 3
models/activity.go

@@ -1040,11 +1040,11 @@ func GetActivityListNew(condition string, pars []interface{}, uid, startSize, pa
 	}
 	sql += ` LIMIT ?,?`
 
-	if typeName != ""{
+	if typeName != "" {
 		typeSlice := strings.Split(typeName, ",")
 		tempCondition := ""
 		for _, s := range typeSlice {
-			if s == "1"{
+			if s == "1" {
 				tempCondition += "'专家电话会',"
 			} else if s == "2" {
 				tempCondition += "'分析师电话会',"
@@ -1071,4 +1071,4 @@ func GetActivityLabelListAllNoLimit(condition, sortTime string, pars []interface
 
 	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
-}
+}

+ 1 - 1
models/db.go

@@ -126,8 +126,8 @@ func init() {
 		new(MicroRoadshowVideo),
 		new(CygxActivityVideoHistory),
 		new(CygxActivitySpecialTrip),
-		new(CygxArticleComment),
 		new(CygxArticleData),
+		new(CygxArticleComment),
 	)
 	// 记录ORM查询日志
 	orm.Debug = true

+ 6 - 4
services/activity.go

@@ -1503,10 +1503,12 @@ func ActivityButtonShow(item *models.ActivityDetail) (articleDetail *models.Acti
 	//专家电话会 1
 	if articleDetail.ActivityTypeId == 1 {
 		articleDetail.IsShowOutboundCall = true
-		if articleDetail.LimitPeopleNum == 0 {
-			articleDetail.IsShowMeetingReminder = true
-			articleDetail.IsShowHelpSsk = true
-		}
+		//if articleDetail.LimitPeopleNum == 0 {
+		//	articleDetail.IsShowMeetingReminder = true
+		//	articleDetail.IsShowHelpSsk = true
+		//}
+		articleDetail.IsShowMeetingReminder = true
+		articleDetail.IsShowHelpSsk = true
 	}
 
 	//分析师电话会 2

+ 2 - 2
utils/common.go

@@ -802,13 +802,13 @@ func GetNowMonthLastDay() time.Time {
 
 // GetNowMonthFirstDay 获取上月第一天的时间
 func GetLastMonthFirstDay() time.Time {
-	nowMonthFirstDay := time.Date(time.Now().Year(), time.Now().AddDate(0,-1,0).Month(), 1, 0, 0, 0, 0, time.Now().Location())
+	nowMonthFirstDay := time.Date(time.Now().Year(), time.Now().AddDate(0, -1, 0).Month(), 1, 0, 0, 0, 0, time.Now().Location())
 	return nowMonthFirstDay
 }
 
 // GetNowMonthLastDay 获取上月最后一天的时间
 func GetLastMonthLastDay() time.Time {
-	nowMonthLastDay := time.Date(time.Now().Year(), time.Now().AddDate(0,-1,0).Month(), 1, 0, 0, 0, 0, time.Now().Location()).AddDate(0, 1, -1)
+	nowMonthLastDay := time.Date(time.Now().Year(), time.Now().AddDate(0, -1, 0).Month(), 1, 0, 0, 0, 0, time.Now().Location()).AddDate(0, 1, -1)
 	nowMonthLastDay = time.Date(nowMonthLastDay.Year(), nowMonthLastDay.Month(), nowMonthLastDay.Day(), 23, 59, 59, 0, nowMonthLastDay.Location())
 	return nowMonthLastDay
 }