Procházet zdrojové kódy

默认推送时间

wangchuanjin před 2 roky
rodič
revize
36f56751da
1 změnil soubory, kde provedl 9 přidání a 4 odebrání
  1. 9 4
      p/struct.go

+ 9 - 4
p/struct.go

@@ -178,14 +178,19 @@ func NewUserInfo(temp map[string]interface{}, tp int) *UserInfo {
 //解析用户的推送设置
 func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
 	subSet, _ := obj["o_subset"].(map[string]interface{})
-	rateMode := util.IntAllDef(subSet["i_ratemode"], 2)
-	a_times, _ := subSet["a_times"].([]interface{})
+	rateMode := util.IntAll(subSet["i_ratemode"])
 	times := []string{}
+	a_times, _ := subSet["a_times"].([]interface{})
 	for _, v := range a_times {
 		times = append(times, util.ObjToString(v))
 	}
-	if len(times) == 0 {
-		times = append(times, "09:00", "14:00")
+	if rateMode == 0 || rateMode == 5 {
+		rateMode = 2
+		if len(times) == 0 {
+			times = append(times, "09:00", "14:00")
+		}
+	} else if rateMode == 2 && len(times) == 0 {
+		times = append(times, "09:00")
 	}
 	sort.Strings(times)
 	weekReport, _ := obj["o_week_report"].(map[string]interface{})