zhangxinlei1996 1 anno fa
parent
commit
66356344ea
3 ha cambiato i file con 35 aggiunte e 9 eliminazioni
  1. 31 5
      api/timetask/timetask.go
  2. 2 2
      service/custom.go
  3. 2 2
      service/sale_chance.go

+ 31 - 5
api/timetask/timetask.go

@@ -51,17 +51,41 @@ func sendMess() {
 				sourceId := gconv.Int(v["source_id"])
 				title := cm.Push.SaleClue.Due.Title
 				content := cm.Push.SaleClue.Due.Content
-				pcHref := cm.Push.SaleClue.Due.PcHref
+				pcHref := ""
 				mobileHref := cm.Push.SaleClue.Due.MobileHref
+				responsible_id := gconv.Int64(v["responsible_id"])
+				//判断是自办还是转办
+				if responsible_id > 0 {
+					//转办
+					if source == 1 {
+						pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.TransferPcHref, responsible_id)
+
+					} else if source == 2 {
+						pcHref = fmt.Sprintf(cm.Push.SaleChance.Create.TransferPcHref, responsible_id)
+
+					} else if source == 3 {
+						pcHref = fmt.Sprintf(cm.Push.Custom.Create.TransferPcHref, responsible_id)
+					}
+
+				} else {
+					//自办
+					if source == 1 {
+						pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, sourceId)
+
+					} else if source == 2 {
+						pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, sourceId)
+
+					} else if source == 3 {
+						pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, sourceId)
+					}
+				}
 				if source == 2 {
 					title = cm.Push.SaleChance.Due.Title
 					content = cm.Push.SaleChance.Due.Content
-					pcHref = cm.Push.SaleChance.Due.PcHref
 					mobileHref = cm.Push.SaleChance.Due.MobileHref
 				} else if source == 3 {
 					title = cm.Push.Custom.Due.Title
 					content = cm.Push.Custom.Due.Content
-					pcHref = cm.Push.Custom.Due.PcHref
 					mobileHref = cm.Push.Custom.Due.MobileHref
 				}
 				u := &service.User{}
@@ -79,8 +103,10 @@ func sendMess() {
 				}
 			}
 			return true
-		}, `select a.id,a.name,b.position_id,a.source,a.source_id from task a left join task_team b on (a.id =b.task_id and b.role=1)
-				where a.status!=3 and a.next_follow_time >= ? and a.next_follow_time < ?`, st, et)
+		}, `SELECT a.id,a.name,b.position_id,a.source,a.source_id,c.responsible_id FROM task a 
+				LEFT JOIN task_team b ON (a.id =b.task_id AND b.role=1)
+				LEFT JOIN  task_transfer c ON(a.id =c.task_id AND c.is_transfer =1)
+				WHERE a.status!=3 AND a.next_follow_time >= ? AND a.next_follow_time < ?`, st, et)
 
 		log.Println("end cron", st, et)
 	}, "sendMsg")

+ 2 - 2
service/custom.go

@@ -127,11 +127,11 @@ func (this *CustomService) Add(ctx context.Context) (int64, string) {
 		pcHref := ""
 		content := ""
 		if this.Types == 1 {
-			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, customId)
+			pcHref = fmt.Sprintf(cm.Push.Custom.Create.MyselfPcHref, positionId, taskId, customId)
 			content = fmt.Sprintf(cm.Push.Custom.Create.MySelfContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 
 		} else if this.Types == 2 {
-			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.TransferPcHref, positionId)
+			pcHref = fmt.Sprintf(cm.Push.Custom.Create.TransferPcHref, positionId)
 			content = fmt.Sprintf(cm.Push.Custom.Create.TransferContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 		}
 

+ 2 - 2
service/sale_chance.go

@@ -131,11 +131,11 @@ func (this *SaleChanceService) Add(ctx context.Context) (int64, string) {
 		content := ""
 		pcHref := ""
 		if this.Types == 1 {
-			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, chanceId)
+			pcHref = fmt.Sprintf(cm.Push.SaleChance.Create.MyselfPcHref, positionId, taskId, chanceId)
 			content = fmt.Sprintf(cm.Push.SaleChance.Create.MySelfContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 
 		} else if this.Types == 2 {
-			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.TransferPcHref, positionId)
+			pcHref = fmt.Sprintf(cm.Push.SaleChance.Create.TransferPcHref, positionId)
 			content = fmt.Sprintf(cm.Push.SaleChance.Create.TransferContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 		}