Эх сурвалжийг харах

Merge branch 'master' into feature/v4.8.3

lianbingjie 2 жил өмнө
parent
commit
d6ace75353

+ 22 - 26
src/jfw/front/wxkeyset.go

@@ -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 = ""

+ 2 - 2
src/jfw/modules/app/src/app/front/logoffuser.go

@@ -43,7 +43,7 @@ func (l *Logoffuser) Out() {
 	if !R.CheckReqParam(l.ResponseWriter, l.Request, "cause") {
 		return
 	}
-	user_id := l.GetSession("userId").(string)
+	user_id := l.GetSession("mgoUserId").(string)
 	status := 0
 	msg := ""
 	//获取用户注销原因
@@ -116,7 +116,7 @@ func UserIsOk(userid string) (int, string) {
 func LogOffAppUser(user_id, cause string) bool {
 	delete_data := map[string]interface{}{}
 	delete_data["s_cause"] = cause //注销原因
-	user := utils.Compatible.Select(user_id, "")
+	user, _ := mongodb.FindById("user", user_id, "")
 	delete_data["o_user"] = *user
 	delete_data["l_createtime"] = time.Now().Unix()
 	//存库

+ 2 - 2
src/jfw/modules/bigmember/src/service/push/push.go

@@ -129,8 +129,8 @@ func (a *Action) Detail() {
 			"wxpush":         util.IntAll(o_vipjy["i_wxpush"]),
 		}
 	case "free_subscribe":
-		user := config.Compatible.Select(userId, `{"s_myemail":1,"o_vipjy":1}`)
-		o_vipjy, _ := (*user)["o_vipjy"].(map[string]interface{})
+		user := config.Compatible.Select(userId, `{"s_myemail":1,"o_jy":1}`)
+		o_vipjy, _ := (*user)["o_jy"].(map[string]interface{})
 		apppush := util.IntAll(o_vipjy["i_apppush"])
 		mailpush := util.IntAll(o_vipjy["i_mailpush"])
 		if apppush == 0 && mailpush == 0 {

+ 3 - 1
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -438,6 +438,7 @@ func GetCollList(c *util.CollList, session *httpsession.Session) map[string]inte
 func Power(session *httpsession.Session) (bool, map[string]interface{}) {
 	isVip, isMember, isEnt, privatedata := false, false, false, false
 	vipstatus := 0
+	var registedate int64
 	resp := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if resp != nil {
 		if resp.VipStatus > 1 {
@@ -454,13 +455,14 @@ func Power(session *httpsession.Session) (bool, map[string]interface{}) {
 			isEnt = true
 		}
 		privatedata = resp.PrivateGD
+		registedate = resp.Data.Free.Registedate
 	}
 	return isVip || isEnt || isMember, map[string]interface{}{
 		"vip":         vipstatus,
 		"member":      isMember,
 		"entniche":    isEnt,
 		"privatedata": privatedata,
-		//"registedate": registedate,
+		"registedate": registedate,
 	}
 }
 

+ 5 - 4
src/web/staticres/me/js/push_setting.js

@@ -165,19 +165,20 @@ var pushSettingVueConf = {
             this.getUserInfo(function (info) {
                 // console.log(info)
                 if (_this.userInfo.subscribeVip > 0) {
-                    _this.settingList[0].show = false
                     _this.settingList[1].show = true
                 } else {
-                    _this.settingList[0].show = true
                     _this.settingList[1].show = false
                 }
                 if (_this.userInfo.bigmemberVip > 0) {
-                  _this.settingList[0].show = false
                   _this.settingList[4].show = true
                 } else {
-                  _this.settingList[0].show = true
                   _this.settingList[4].show = false
                 }
+                if (_this.userInfo.subscribeVip <= 0 && _this.userInfo.bigmemberVip <= 0) {
+                  _this.settingList[0].show = true
+                } else {
+                  _this.settingList[0].show = false
+                }
             })
         },
         toSettingDetail: function (item) {