|
@@ -2,6 +2,7 @@ package p
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "sort"
|
|
|
"strings"
|
|
|
|
|
|
util "app.yhyue.com/moapp/jybase/common"
|
|
@@ -177,7 +178,16 @@ func NewUserInfo(temp map[string]interface{}, tp int) *UserInfo {
|
|
|
//解析用户的推送设置
|
|
|
func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
|
|
|
subSet, _ := obj["o_subset"].(map[string]interface{})
|
|
|
- times, _ := subSet["a_times"].([]interface{})
|
|
|
+ rateMode := util.IntAllDef(subSet["i_ratemode"], 2)
|
|
|
+ a_times, _ := subSet["a_times"].([]interface{})
|
|
|
+ times := []string{}
|
|
|
+ for _, v := range a_times {
|
|
|
+ times = append(times, util.ObjToString(v))
|
|
|
+ }
|
|
|
+ if len(times) == 0 {
|
|
|
+ times = append(times, "09:00", "14:00")
|
|
|
+ }
|
|
|
+ sort.Strings(times)
|
|
|
weekReport, _ := obj["o_week_report"].(map[string]interface{})
|
|
|
monthReport, _ := obj["o_month_report"].(map[string]interface{})
|
|
|
newprojectForecast, _ := obj["o_newproject_forecast"].(map[string]interface{})
|
|
@@ -190,8 +200,8 @@ func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
|
|
|
WxPush: util.IntAllDef(subSet["i_wxpush"], 1),
|
|
|
AppPush: util.IntAllDef(subSet["i_apppush"], 1),
|
|
|
MailPush: util.IntAll(subSet["i_mailpush"]),
|
|
|
- RateMode: util.IntAllDef(subSet["i_ratemode"], 5),
|
|
|
- Times: util.ObjArrToStringArr(times),
|
|
|
+ RateMode: rateMode,
|
|
|
+ Times: times,
|
|
|
},
|
|
|
WeekReport: &PushSetChild{
|
|
|
WxPush: util.IntAllDef(weekReport["i_wxpush"], 1),
|