浏览代码

修改push列表加session

renzheng 9 年之前
父节点
当前提交
ab1ac7fb71

+ 1 - 1
common/src/qfw/util/encrypt_test.go

@@ -25,7 +25,7 @@ func Test_sim(t *testing.T) {
 	s4 := "oJULtwzXo6EFV//////??????----oJULtwzXsLVHoDeXBEWOXCkME9p4,oZQC_s_DfLpFKIKIP2TpiR-16Glg,1453788982,swordfishaction--1Ah-Xey,_R_B/i?mXGM8,uid,123456,swordfishaction"
 	se := SimpleEncrypt{Key: "topnet"}
 	log.Println("=====", se.EncodeString(s4))
-	log.Println("---", se.DecodeString("GyUlIhEDDjcDIjM8GysVNicxIyAoLQ45MVYAWkkbLj4zMRYrMAk8HiM/PSQ5PlcgBAYiQ1RCMwMXQlRAQVxHVl1NTF1cHRIbBgsWBxYcFQwEBwoa"))
+	log.Println("---", se.DecodeString("GyUlIhEDDjcfWCAyIl4xBkgsERYiLAwZLCg9VkkBHQtcX1FBR1hJWldCREMHFhUBBwccBxYA"))
 	now := time.Now()
 	tom := time.Date(now.Year(), now.Month(), now.Day(), 18, 0, 0, 0, time.Local)
 	log.Println(now.Unix(), tom.Unix(), 1453686600-1453716000)

+ 1 - 1
core/src/qfw/member/memberindex.go

@@ -40,7 +40,7 @@ func init() {
 func (m *MemberIndex) Sess(str string) error {
 
 	util.Try(func() {
-		strs := strings.Split(str, "##")
+		strs := strings.Split(str, "__")
 		str := strings.Split(sewx.DecodeString(strs[0]), ",")
 		if len(str) == 4 {
 			openid := str[0]

+ 1 - 1
core/src/qfw/member/membermanager.go

@@ -1081,7 +1081,7 @@ func returnFront(m *Member, key string) error {
 
 //更新cookie sessoin
 func UpdateCookieSession(action *xweb.Action, loginType string, flag bool, r map[string]interface{}) {
-	log.Println(r)
+	//log.Println(r)
 	freeze := IntAll(r["i_freeze"])
 	action.Session().Set("i_freeze", freeze)
 	if r["s_nickname"] == nil || r["s_nickname"].(string) == "" {

二进制
etl/server/src/trsserver/trsserver


+ 3 - 1
etl/server/src/trsserver/trsserver.go

@@ -9,6 +9,7 @@ import (
 	"qfw/util"
 	"qfw/util/mongodb"
 	"sync"
+	"time"
 )
 
 var SysConfig map[string]interface{}
@@ -68,7 +69,8 @@ func TrsZtbSave(filename string, tmp []interface{}) {
 			if n == 0 {
 				if _, ok := v["publishtime"].(int64); !ok {
 					v["publishtime"] = int64(v["publishtime"].(float64))
-					v["comeintime"] = int64(v["comeintime"].(float64))
+					//v["comeintime"] = int64(v["comeintime"].(float64))
+					v["comeintime"] = time.Now().Unix()
 				}
 				err := session.DB(mongodbName).C(collection).Insert(v)
 				if err != nil {

+ 9 - 4
push/src/qfw/push/dopush/dopush.go

@@ -66,6 +66,7 @@ func EachAllBidInfo(stype, TITLEA, ShortTitle string, lastTime int64, MaxPushSiz
 	query := session.DB("qfw").C("bidding").Find(mongodb.ObjToOth(q)).Sort("-publishtime").Iter()
 	userMap := &map[*push.MemberInterest]*list.List{}
 	var returnLastTime interface{}
+	var returnLastTimeLong int64 = 0
 L1:
 	for tmp := new(map[string]interface{}); query.Next(tmp); {
 		title := util.ObjToString((*tmp)["title"])
@@ -96,14 +97,18 @@ L1:
 					}
 				}
 			}
-			if returnLastTime == nil {
-				returnLastTime = (*tmp)["comeintime"]
+			if (*tmp)["comeintime"] != nil {
+				ttmp := (*tmp)["comeintime"].(int64)
+				if ttmp > returnLastTimeLong {
+					returnLastTimeLong = ttmp
+				}
 			}
 		}
 		tmp = new(map[string]interface{})
 	}
 	now := time.Now()
-	if pushType == 1 && returnLastTime != nil {
+	if pushType == 1 && returnLastTimeLong > 0 {
+		returnLastTime = returnLastTimeLong
 		push.PushConfig[stype+"StartTime"] = util.FormatDateWithObj(&returnLastTime, util.Date_Full_Layout)
 	}
 	for k, v := range *(userMap) {
@@ -228,6 +233,6 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, stype string, no
 		Date:    wxDate,
 		Service: "剑鱼君",
 		//Url:     push.PushConfig["bidViewDomain"].(string) + "/wxpush/bid/" + k.Openid + "/" + wid + "/aa"})
-		Url: push.PushConfig["bidViewDomain"].(string) + "/mobile/sess/" + se.EncodeString(k.Openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "##" + k.Openid + "##" + wid + "##aa"})
+		Url: push.PushConfig["bidViewDomain"].(string) + "/mobile/sess/" + se.EncodeString(k.Openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "__" + k.Openid + "__" + wid + "__aa"})
 
 }