Jianghan 1 year ago
parent
commit
3956534d78
1 changed files with 4 additions and 2 deletions
  1. 4 2
      clueSync/sendMail.go

+ 4 - 2
clueSync/sendMail.go

@@ -120,14 +120,16 @@ func WarningDm() {
 		}
 	}
 	if send {
+		sql := `UPDATE jianyu_subjectdb_test.dwd_f_crm_personnel_management SET send_mail = (%s) where position_id IN (SELECT a.position_id FROM dwd_d_crm_department_level_succbi a INNER JOIN dwd_f_crm_personnel_management b ON a.position_id = b.position_id WHERE b.role_id = 5 AND b.resign = 0)`
 		info3 := TiDb.SelectBySql(xgFlag)
 		if info3 != nil && len(*info3) > 0 {
 			sendFlag := common.IntAll((*info3)[0]["flag_1"])
 			if sendFlag == 0 {
 				WillWarningByAll()
+				TiDb.ExecBySql(fmt.Sprintf(sql, "send_mail & ~(1 << 4)"))
 			} else {
-				sql := `UPDATE jianyu_subjectdb_test.dwd_f_crm_personnel_management SET send_mail = (send_mail | (1 << 4)) where position_id IN (SELECT a.position_id FROM dwd_d_crm_department_level_succbi a INNER JOIN dwd_f_crm_personnel_management b ON a.position_id = b.position_id WHERE b.role_id = 5 AND b.resign = 0)`
-				TiDb.ExecBySql(sql) // 修改销管 发送邮件标志 0
+
+				TiDb.ExecBySql(fmt.Sprintf(sql, "send_mail | (1 << 4)")) // 修改销管 发送邮件标志 0
 			}
 		}
 	}