Browse Source

feat:修改默认时间

wangchuanjin 1 năm trước cách đây
mục cha
commit
494696f961
1 tập tin đã thay đổi với 7 bổ sung7 xóa
  1. 7 7
      p/struct.go

+ 7 - 7
p/struct.go

@@ -107,7 +107,7 @@ func (p *PushSet) ResetSubSet() {
 		return
 	}
 	//
-	if p.SubSet.RateMode == 0 || p.SubSet.RateMode == 5 {
+	if p.SubSet.RateMode < 1 || p.SubSet.RateMode > 4 {
 		p.SubSet.RateMode = 2
 		if len(p.SubSet.Times) == 0 {
 			p.SubSet.Times = append(p.SubSet.Times, "09:00", "14:00")
@@ -117,8 +117,8 @@ func (p *PushSet) ResetSubSet() {
 	}
 	sort.Strings(p.SubSet.Times)
 	//
-	if p.EntInfo.RateMode == 0 || p.EntInfo.RateMode == 5 {
-		p.EntInfo.RateMode = 2
+	if p.EntInfo.RateMode < 1 || p.EntInfo.RateMode > 4 {
+		p.EntInfo.RateMode = 1
 		if len(p.EntInfo.Times) == 0 {
 			p.EntInfo.Times = append(p.EntInfo.Times, "09:00", "14:00")
 		}
@@ -126,7 +126,7 @@ func (p *PushSet) ResetSubSet() {
 		p.EntInfo.Times = append(p.EntInfo.Times, "09:00")
 	}
 	//
-	if p.NewprojectForecast.RateMode == 0 || p.NewprojectForecast.RateMode == 5 {
+	if p.NewprojectForecast.RateMode < 1 || p.NewprojectForecast.RateMode > 4 {
 		p.NewprojectForecast.RateMode = 2
 		if len(p.NewprojectForecast.Times) == 0 {
 			p.NewprojectForecast.Times = append(p.NewprojectForecast.Times, "09:00", "14:00")
@@ -135,7 +135,7 @@ func (p *PushSet) ResetSubSet() {
 		p.NewprojectForecast.Times = append(p.NewprojectForecast.Times, "09:00")
 	}
 	//
-	if p.FollowProject.RateMode == 0 || p.FollowProject.RateMode == 5 {
+	if p.FollowProject.RateMode < 1 || p.FollowProject.RateMode > 4 {
 		p.FollowProject.RateMode = 2
 		if len(p.FollowProject.Times) == 0 {
 			p.FollowProject.Times = append(p.FollowProject.Times, "09:00", "14:00")
@@ -144,7 +144,7 @@ func (p *PushSet) ResetSubSet() {
 		p.FollowProject.Times = append(p.FollowProject.Times, "09:00")
 	}
 	//
-	if p.FollowEnt.RateMode == 0 || p.FollowEnt.RateMode == 5 {
+	if p.FollowEnt.RateMode < 1 || p.FollowEnt.RateMode > 4 {
 		p.FollowEnt.RateMode = 2
 		if len(p.FollowEnt.Times) == 0 {
 			p.FollowEnt.Times = append(p.FollowEnt.Times, "09:00", "14:00")
@@ -280,7 +280,7 @@ func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
 			WxPush:   util.IntAllDef(newprojectForecast["i_wxpush"], 1),
 			AppPush:  util.IntAllDef(newprojectForecast["i_apppush"], 1),
 			MailPush: util.IntAll(newprojectForecast["i_mailpush"]),
-			RateMode: util.IntAll(subSet["i_ratemode"]),
+			RateMode: util.IntAll(newprojectForecast["i_ratemode"]),
 			Times:    util.ObjArrToStringArr(newprojectForecast_times),
 		},
 		EntInfo: &PushSetChild{