浏览代码

给专家定时发送邮件附件样式修改

xingzai 3 年之前
父节点
当前提交
ceef916f64
共有 2 个文件被更改,包括 15 次插入8 次删除
  1. 9 6
      models/activity.go
  2. 6 2
      services/activity.go

+ 9 - 6
models/activity.go

@@ -388,20 +388,23 @@ WHERE
 }
 }
 
 
 type SignupExportRep struct {
 type SignupExportRep struct {
-	Mobile      string `description:"手机号"`
-	CompanyName string `description:"公司名称"`
-	RealName    string `description:"姓名"`
-	CountryCode string `description:"区号"`
+	Mobile         string `description:"手机号"`
+	CompanyName    string `description:"公司名称"`
+	RealName       string `description:"姓名"`
+	CountryCode    string `description:"区号"`
+	OutboundMobile string `description:"外呼手机号"`
+	SellerName     string `description:"销售姓名"`
 }
 }
 
 
 func GetSignupExport(activityId int) (item []*SignupExportRep, err error) {
 func GetSignupExport(activityId int) (item []*SignupExportRep, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
-	sql := `SELECT s.*  ,a.is_limit_people,u.real_name ,u.country_code
+	sql := `SELECT s.*  ,a.is_limit_people,u.real_name,p.seller_name
 			FROM
 			FROM
 			cygx_activity_signup AS s
 			cygx_activity_signup AS s
 			LEFT JOIN wx_user AS u ON u.user_id = s.user_id
 			LEFT JOIN wx_user AS u ON u.user_id = s.user_id
 			LEFT JOIN cygx_activity AS a ON a.activity_id = s.activity_id
 			LEFT JOIN cygx_activity AS a ON a.activity_id = s.activity_id
-			WHERE a.activity_id = ?  AND s.fail_type = 0`
+			LEFT JOIN company_product AS p ON p.company_id = u.company_id 
+			WHERE a.activity_id = ?  AND s.fail_type = 0  AND p.product_id = 2`
 	_, err = o.Raw(sql, activityId).QueryRows(&item)
 	_, err = o.Raw(sql, activityId).QueryRows(&item)
 	return
 	return
 }
 }

+ 6 - 2
services/activity.go

@@ -196,18 +196,20 @@ func SendEmailFileToExpert(cont context.Context) (err error) {
 		cellA := rowTitle.AddCell()
 		cellA := rowTitle.AddCell()
 		cellA.Value = "姓名"
 		cellA.Value = "姓名"
 		cellB := rowTitle.AddCell()
 		cellB := rowTitle.AddCell()
-		cellB.Value = "手机号"
+		cellB.Value = "外呼号码"
 		cellC := rowTitle.AddCell()
 		cellC := rowTitle.AddCell()
 		cellC.Value = "国际代码"
 		cellC.Value = "国际代码"
 		cellD := rowTitle.AddCell()
 		cellD := rowTitle.AddCell()
 		cellD.Value = "公司名称"
 		cellD.Value = "公司名称"
+		cellE := rowTitle.AddCell()
+		cellE.Value = "所属销售"
 
 
 		for _, item := range list {
 		for _, item := range list {
 			row := sheet.AddRow()
 			row := sheet.AddRow()
 			cellA := row.AddCell()
 			cellA := row.AddCell()
 			cellA.Value = item.RealName
 			cellA.Value = item.RealName
 			cellB := row.AddCell()
 			cellB := row.AddCell()
-			cellB.Value = item.Mobile
+			cellB.Value = item.OutboundMobile
 			cellC := row.AddCell()
 			cellC := row.AddCell()
 			if item.CountryCode == "" {
 			if item.CountryCode == "" {
 				cellC.Value = "86"
 				cellC.Value = "86"
@@ -216,6 +218,8 @@ func SendEmailFileToExpert(cont context.Context) (err error) {
 			}
 			}
 			cellD := row.AddCell()
 			cellD := row.AddCell()
 			cellD.Value = item.CompanyName
 			cellD.Value = item.CompanyName
+			cellE := row.AddCell()
+			cellE.Value = item.SellerName
 		}
 		}
 		errFile = xlsxFile.Save(downLoadnFilePath)
 		errFile = xlsxFile.Save(downLoadnFilePath)
 		if errFile != nil {
 		if errFile != nil {