Browse Source

Merge branch 'need/cygx_990' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 6 months ago
parent
commit
ab8bc94e18
5 changed files with 17 additions and 17 deletions
  1. 1 1
      controllers/home.go
  2. 1 1
      models/activity_video.go
  3. 1 1
      models/activity_voice.go
  4. 2 2
      services/micro_roadshow.go
  5. 12 12
      utils/email.go

+ 1 - 1
controllers/home.go

@@ -320,7 +320,7 @@ func (this *MobileHomeController) NewList() {
 	//	startSize = 0
 	//	pageSize = utils.PageSize5
 	//} else {
-	condition += ` AND source NOT IN ('activity','activityspecial','newchart','industrialsourceHz','industrialsourceYx')  AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) ` + conditionInit
+	condition += `  AND is_hide = 0  AND source NOT IN ('activity','activityspecial','newchart','industrialsourceHz','industrialsourceYx')  AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) ` + conditionInit
 	//conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)
 	conditionActivity, err := services.ActivityConditioninitSql(user, "", 0)
 	if err != nil && err.Error() != utils.ErrNoRow() {

+ 1 - 1
models/activity_video.go

@@ -52,7 +52,7 @@ type CygxActivityVideoListRep struct {
 // 列表
 func GetActivityVideoListAll(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxActivityVideoListResp, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT art.*,v.video_id,v.video_name,v.video_url,video_duration FROM cygx_activity as art  INNER JOIN cygx_activity_video AS v ON v.activity_id = art.activity_id   WHERE 1= 1  `
+	sql := `SELECT art.*,v.video_id,v.video_name,v.video_url,video_duration FROM cygx_activity as art  INNER JOIN cygx_activity_video AS v ON v.activity_id = art.activity_id   WHERE 1= 1  AND  AND  v.is_hide = 0  `
 	if condition != "" {
 		sql += condition
 	}

+ 1 - 1
models/activity_voice.go

@@ -58,7 +58,7 @@ func GetCygxActivityVoiceReqList(activityIds []int) (items []*CygxActivityVoiceR
 			cygx_activity_voice AS v
 			INNER JOIN cygx_activity AS a ON a.activity_id = v.activity_id 
 		WHERE
-			1 = 1 	 AND  v.activity_id IN (` + utils.GetOrmInReplace(lenactivityIds) + `)  `
+			1 = 1 	AND  v.is_hide = 0 AND  v.activity_id IN (` + utils.GetOrmInReplace(lenactivityIds) + `)  `
 	o := orm.NewOrm()
 	_, err = o.Raw(sql, activityIds).QueryRows(&items)
 	return

+ 2 - 2
services/micro_roadshow.go

@@ -410,8 +410,8 @@ func GetMicroRoadShowPageListV12(pageSize, currentIndex, sourceId, tableType int
 		conditionAskserie += ` AND a.chart_permission_id IN (` + chartPermissionIds + `)`
 	}
 	//发布状态
-	audioAct += ` AND  b.publish_status = 1 AND  b.chart_permission_id  != 31 `
-	videoAct += ` AND  b.publish_status = 1  AND  b.chart_permission_id  != 31 `
+	audioAct += ` AND  b.publish_status = 1 AND  b.chart_permission_id  != 31  AND a.is_hide = 0 `
+	videoAct += ` AND  b.publish_status = 1  AND  b.chart_permission_id  != 31 AND a.is_hide = 0 `
 	videoMico += ` AND  a.publish_status = 1 AND  a.chart_permission_id  != 31 `
 	conditionAskserie += ` AND  a.publish_status = 1  AND  a.chart_permission_id  != 31 `
 

+ 12 - 12
utils/email.go

@@ -9,7 +9,7 @@ import (
 	"strings"
 )
 
-//发送邮件
+// 发送邮件
 func SendEmail(title, content string, touser string) bool {
 	if RunMode == "debug" {
 		return false
@@ -36,7 +36,7 @@ func SendEmail(title, content string, touser string) bool {
 	return true
 }
 
-//发送邮件
+// 发送邮件
 func SendEmailByHz(title, content string, touser string) (result bool, err error) {
 	//if RunMode == "debug" {
 	//	result = false
@@ -53,11 +53,11 @@ func SendEmailByHz(title, content string, touser string) (result bool, err error
 		arr = append(arr, touser)
 	}
 	m := gomail.NewMessage()
-	m.SetHeader("From", "public@hzinsights.com")
+	m.SetHeader("From", "hzcygx@hzinsights.com")
 	m.SetHeader("To", arr...)
 	m.SetHeader("Subject", title)
 	m.SetBody("text/html", content)
-	d := gomail.NewDialer("smtp.mxhichina.com", 465, "public@hzinsights.com", "Hzinsights2018")
+	d := gomail.NewDialer("smtp.mxhichina.com", 465, "hzcygx@hzinsights.com", "Hzinsights2024")
 	if err := d.DialAndSend(m); err != nil {
 		result = false
 		return result, err
@@ -66,7 +66,7 @@ func SendEmailByHz(title, content string, touser string) (result bool, err error
 	return
 }
 
-//发送带有文件的邮件
+// 发送带有文件的邮件
 func SendEmailHaveFile(title, content string, fileName, touser string) bool {
 	var arr []string
 	sub := strings.Index(touser, ";")
@@ -91,7 +91,7 @@ func SendEmailHaveFile(title, content string, fileName, touser string) bool {
 	return true
 }
 
-//发送邮件
+// 发送邮件
 func SendEmailByHongze(title, content string, touser, attachPath, attachName string) bool {
 	var arr []string
 	sub := strings.Index(touser, ";")
@@ -105,7 +105,7 @@ func SendEmailByHongze(title, content string, touser, attachPath, attachName str
 	}
 	m := gomail.NewMessage()
 
-	m.SetHeader("From", "public@hzinsights.com")
+	m.SetHeader("From", "hzcygx@hzinsights.com")
 	m.SetHeader("To", arr...)
 	m.SetHeader("Subject", title)
 	m.SetBody("text/html", content)
@@ -120,7 +120,7 @@ func SendEmailByHongze(title, content string, touser, attachPath, attachName str
 				},
 			}))
 	}
-	d := gomail.NewDialer("smtp.mxhichina.com", 465, "public@hzinsights.com", "Hzinsights2018")
+	d := gomail.NewDialer("smtp.mxhichina.com", 465, "hzcygx@hzinsights.com", "Hzinsights2024")
 	if err := d.DialAndSend(m); err != nil {
 		fmt.Println("send err:", err.Error())
 		return false
@@ -132,10 +132,10 @@ var (
 	AlarmMsgUrl = "http://127.0.0.1:8606/api/alarm/send"
 )
 
-//projectName-项目名称
-//runMode-运行模式
-//msgBody-消息内容
-//level:消息基本,1:提示消息,2:警告消息,3:严重错误信息,默认为1 提示消息
+// projectName-项目名称
+// runMode-运行模式
+// msgBody-消息内容
+// level:消息基本,1:提示消息,2:警告消息,3:严重错误信息,默认为1 提示消息
 func SendAlarmMsg(msgBody string, level int) {
 	params := make(map[string]interface{})
 	params["ProjectName"] = APPNAME