|
@@ -78,7 +78,6 @@ func (m *Front) WxKeyset(tpl string) error {
|
|
|
func (m *Front) WxKeysetAjaxReq() {
|
|
|
defer util.Catch()
|
|
|
userId, _ := m.GetSession("userId").(string)
|
|
|
- positionType := util.Int64All(m.GetSession("positionType"))
|
|
|
if userId == "" {
|
|
|
m.ServeJson(map[string]interface{}{
|
|
|
"flag": false,
|
|
@@ -86,9 +85,6 @@ func (m *Front) WxKeysetAjaxReq() {
|
|
|
return
|
|
|
}
|
|
|
types := "o_jy"
|
|
|
- if positionType == 1 {
|
|
|
- types = "o_entniche"
|
|
|
- }
|
|
|
//增加锁,防止map读写
|
|
|
// lock, _ := m.Session().Get("Lock").(*sync.Mutex)
|
|
|
// lock.Lock()
|
|
@@ -162,7 +158,7 @@ func (m *Front) WxKeysetAjaxReq() {
|
|
|
saveData[fmt.Sprintf("%s.a_key", types)] = keyMaps
|
|
|
} else if reqType == "saveArea" { //保存信息范围
|
|
|
index = m.GetString("index")
|
|
|
- saveData[types+"o.a_key."+index+".area"] = m.GetSlice("area")
|
|
|
+ saveData[types+".a_key."+index+".area"] = m.GetSlice("area")
|
|
|
} else if reqType == "saveInfotype" { //保存信息类型
|
|
|
index = m.GetString("index")
|
|
|
saveData[types+".a_key."+index+".infotype"] = m.GetSlice("infotype")
|
|
@@ -195,7 +191,7 @@ func (m *Front) WxKeysetAjaxReq() {
|
|
|
}
|
|
|
saveData[types+".s_email"] = strings.Trim(m.GetString("email"), " ")
|
|
|
saveData[types+".i_wxpush"] = wxpush
|
|
|
- saveData[types+"o_jy.i_mailpush"] = mailpush
|
|
|
+ saveData[types+".i_mailpush"] = mailpush
|
|
|
} else if reqType == "delKeysWord" { //
|
|
|
index = m.GetString("index")
|
|
|
var keyMaps = []map[string]interface{}{}
|
|
@@ -240,26 +236,26 @@ func (m *Front) WxKeysetAjaxReq() {
|
|
|
var regtime int64
|
|
|
if rd := jyutil.Compatible.Select(userId, `{"o_jy":1,"l_registedate":1}`); rd != nil && len(*rd) > 0 {
|
|
|
//获取活动上线时间
|
|
|
- optimalTime, _ := config.Sysconfig["optimalTime"].(string)
|
|
|
- optime, _ = time.ParseInLocation(Date_Full_Layout, optimalTime, time.Local)
|
|
|
- regtime, _ = (*rd)["l_registedate"].(int64)
|
|
|
- if ojy, _ := (*rd)["o_jy"].(map[string]interface{}); len(ojy) > 0 {
|
|
|
- if ojy["i_new"] == nil {
|
|
|
- if time.Unix(regtime, 0).After(optime) {
|
|
|
- saveData["o_jy.i_new"] = 1
|
|
|
- } else {
|
|
|
- saveData["o_jy.i_new"] = 0
|
|
|
- }
|
|
|
- }
|
|
|
- if ojy["a_key"] != nil {
|
|
|
- ak, _ := ojy["a_key"].([]interface{})
|
|
|
- if len(ak) > indexInt {
|
|
|
- if akmap, _ := ak[indexInt].(map[string]interface{}); akmap["from"] != nil {
|
|
|
- saveKey["from"] = akmap["from"]
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ optimalTime, _ := config.Sysconfig["optimalTime"].(string)
|
|
|
+ optime, _ = time.ParseInLocation(Date_Full_Layout, optimalTime, time.Local)
|
|
|
+ regtime, _ = (*rd)["l_registedate"].(int64)
|
|
|
+ if ojy, _ := (*rd)["o_jy"].(map[string]interface{}); len(ojy) > 0 {
|
|
|
+ if ojy["i_new"] == nil {
|
|
|
+ if time.Unix(regtime, 0).After(optime) {
|
|
|
+ saveData[types+".i_new"] = 1
|
|
|
+ } else {
|
|
|
+ saveData[types+".i_new"] = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ojy["a_key"] != nil {
|
|
|
+ ak, _ := ojy["a_key"].([]interface{})
|
|
|
+ if len(ak) > indexInt {
|
|
|
+ if akmap, _ := ak[indexInt].(map[string]interface{}); akmap["from"] != nil {
|
|
|
+ saveKey["from"] = akmap["from"]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if !a_key_ok && indexInt == 0 { //第一次新增
|
|
|
index = ""
|