| skipped 32 lines |
33 | 33 | | expiration := detail.LicenseInfo.Expired |
34 | 34 | | t, _ := time.Parse("2006-01-01", expiration) |
35 | 35 | | now := time.Now() |
36 | | - | subD := now.Sub(t) |
| 36 | + | subD := t.Sub(now) |
37 | 37 | | day := int(math.Floor(subD.Hours() / 24)) |
38 | | - | if day < 7 { |
39 | | - | |
| 38 | + | if day > 0 && (day == 7 || day == 30 || day == 3 || day == 15) { |
40 | 39 | | message := map[string]string{} |
41 | 40 | | message["message"] = fmt.Sprintf("License还有%d天到期,请及时处理", day) |
42 | 41 | | err := l.msgService.SendMsg(constant.LicenseExpires, constant.System, map[string]string{"name": "license"}, true, message) |
| skipped 6 lines |