Browse Source

Merge branch 'dev4.6.2.1' of http://192.168.3.207:8080/qmx/jy into dev4.6.2.1

zhangyuhan 3 years ago
parent
commit
edf5af8a51

+ 2 - 9
src/jfw/front/front.go

@@ -1033,7 +1033,7 @@ func (f *Front) TSGuide() error {
 		return f.Render("/weixin/wxtsguide.html")
 	} else {
 		reqType := f.GetString("reqType")
-		index, _ := f.GetInteger("index")
+		// index, _ := f.GetInteger("index")
 		result := make(bson.M)
 		if reqType == "save" {
 			var keyMaps []map[string]interface{}
@@ -1070,14 +1070,7 @@ func (f *Front) TSGuide() error {
 			}
 		} else if reqType == "over" {
 			saveData := bson.M{
-				"o_jy.o_area":       map[string]interface{}{},
-				"o_jy.l_modifydate": time.Now().Unix(),
-				"i_ts_guide":        1,
-			}
-			if index > 2 {
-				saveData = bson.M{
-					"i_ts_guide": 1,
-				}
+				"i_ts_guide": 1,
 			}
 			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 		} else if reqType == "preview" {

+ 1 - 0
src/jfw/front/login.go

@@ -115,6 +115,7 @@ func (l *Login) Login() error {
 						"s_company":     s_company,
 						"o_jy": map[string]interface{}{
 							"i_apppush":    1,
+							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"i_ratemode":   2,
 							"l_modifydate": time.Now().Unix(),
 						},

+ 1 - 0
src/jfw/front/otherAct.go

@@ -135,6 +135,7 @@ func (f *Front) Lpsubmit() error {
 				"i_ts_guide":    2,
 				"o_jy": map[string]interface{}{
 					"i_apppush":    1,
+					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"i_ratemode":   2,
 					"l_modifydate": time.Now().Unix(),
 				},

+ 1 - 0
src/jfw/front/pchelper.go

@@ -128,6 +128,7 @@ func (l *PcHelper) Login() error {
 							"o_jy": map[string]interface{}{
 								"i_apppush":    1,
 								"i_ratemode":   2,
+								"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 								"l_modifydate": time.Now().Unix(),
 							},
 							"s_regsource": "pchelper",

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

@@ -291,7 +291,7 @@ func (f *Front) TSGuide() error {
 		return f.Render("/weixin/wxtsguide.html")
 	} else {
 		reqType := f.GetString("reqType")
-		index, _ := f.GetInteger("index")
+		// index, _ := f.GetInteger("index")
 		result := make(bson.M)
 		if reqType == "save" {
 			var keyMaps []map[string]interface{}
@@ -328,14 +328,7 @@ func (f *Front) TSGuide() error {
 			}
 		} else if reqType == "over" {
 			saveData := bson.M{
-				"o_jy.o_area":       map[string]interface{}{},
-				"o_jy.l_modifydate": time.Now().Unix(),
-				"i_ts_guide":        1,
-			}
-			if index > 2 {
-				saveData = bson.M{
-					"i_ts_guide": 1,
-				}
+				"i_ts_guide": 1,
 			}
 			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 		} else if reqType == "preview" {

+ 3 - 0
src/jfw/modules/app/src/app/front/login.go

@@ -206,6 +206,7 @@ func (l *Login) Login() error {
 						"o_jy": map[string]interface{}{
 							"i_apppush":    1,
 							"i_ratemode":   2,
+							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"l_modifydate": time.Now().Unix(),
 						},
 					}
@@ -462,6 +463,7 @@ func (l *Login) Register() error {
 					data["o_jy"] = map[string]interface{}{
 						"i_apppush":    1,
 						"i_ratemode":   2,
+						"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 						"l_modifydate": time.Now().Unix(),
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
@@ -605,6 +607,7 @@ func (l *Login) WxLogin() {
 				"o_jy": map[string]interface{}{
 					"i_apppush":    1,
 					"i_ratemode":   2,
+					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"l_modifydate": time.Now().Unix(),
 				},
 			}

+ 4 - 3
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -98,7 +98,7 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 	if userId == "" {
 		return &userPower
 	}
-	userPower.IsUpgrade = true
+	userPower.IsUpgrade = false
 	userPower.Uid = userId
 	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
 
@@ -141,8 +141,9 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 			userPower.FreeBuyerPort = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheBuyerPortKey, userId))
 			userPower.FreeFile = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheFileKey, userId))
 			o_jy := qutil.ObjToMap((*data)["o_jy"])
-			if _, ok := (*o_jy)["o_area"]; !ok {
-				userPower.IsUpgrade = false
+			//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+			if qutil.IntAll((*o_jy)["i_newfree"]) > 0 {
+				userPower.IsUpgrade = true
 			}
 		}
 	}

+ 4 - 2
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -68,11 +68,13 @@ func freeSet(area map[string]interface{}, industry []string, userId string) *Fun
 //免费用户地区调整
 func FreeSubChange(userId string, area *map[string]interface{}, industry []string, ppb, isfirst bool) bool {
 	setMap := map[string]interface{}{"$set": map[string]interface{}{
-		"o_jy.o_area": area, //设置地区
+		"o_jy.o_area":    area, //设置地区
+		"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
 	}}
 	if ppb {
 		setMap = map[string]interface{}{"$set": map[string]interface{}{
-			"o_jy.o_area_p": area, //设置地区
+			"o_jy.o_area_p":  area, //设置地区
+			"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
 		}}
 	}
 	updateOk := db.Mgo.UpdateById("user", userId, setMap)

+ 13 - 1
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -90,7 +90,19 @@ func (this *OrderListDetails) GetOrderPayAllMsg() {
 				(*oData)["return_type"] = (*returnRecord)["return_type"]
 			}
 		}
-
+		//获取最后一次购买的订单
+		lastOrderMap := LastOrder(qutil.ObjToString((*oData)["product_type"]), userId)
+		//最后一次够买的vip订单
+		for _, n := range lastOrderMap {
+			if n == orderCode {
+				(*oData)["lastbuy_code"] = n
+				if data, ok := util.MQFW.FindById("user", userId, `{"i_vip_status":1,"o_jy":1}`); data != nil && ok && len(*data) > 0 {
+					(*oData)["i_vip_status"] = qutil.Int64All((*data)["i_vip_status"])
+					ojy := qutil.ObjToMap((*data)["o_jy"])
+					(*oData)["i_pp_status"] = qutil.IntAllDef((*ojy)["i_ppstatus"], 0) //i_pp_status : -1 到期  0未购买 1已购买
+				}
+			}
+		}
 		//卡卷id加密
 		if (*oData)["d_relation_id"] != "" {
 			(*oData)["userLotteryId"] = qutil.SE.Encode2Hex(qutil.ObjToString((*oData)["d_relation_id"]))

+ 5 - 3
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -7,9 +7,6 @@ import (
 	"database/sql"
 	"encoding/base64"
 	"fmt"
-	"github.com/dchest/captcha"
-	"github.com/go-xweb/httpsession"
-	"github.com/go-xweb/xweb"
 	"log"
 	"mongodb"
 	qutil "qfw/util"
@@ -19,6 +16,10 @@ import (
 	"strings"
 	"time"
 	"util"
+
+	"github.com/dchest/captcha"
+	"github.com/go-xweb/httpsession"
+	"github.com/go-xweb/xweb"
 )
 
 type UserAccount struct {
@@ -648,6 +649,7 @@ func (this *UserAccount) WxUnBind() {
 			(*unsetMap)["o_jy"] = map[string]interface{}{
 				"i_wxpush":   1,
 				"i_ratemode": 2,
+				"i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 			}
 			//公众号微信关注移至另一用户中  此时微信公众号用户session问题错乱
 			if saveId := util.MQFW.Save("user", unsetMap); saveId == "" {

+ 2 - 0
src/jfw/modules/weixin/src/wx/wx.go

@@ -502,6 +502,7 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 			newUser["i_ts_guide"] = 2
 			newUser["o_jy"] = map[string]interface{}{
 				"i_wxpush":   1,
+				"i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 				"i_ratemode": 2,
 			}
 		} else {
@@ -581,6 +582,7 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 				"s_sourceid":      source,
 				"i_sourceid":      isourceid,
 				"o_jy.i_wxpush":   1,
+				"o_jy.i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 				"i_ispush":        1,
 				"s_headimageurl":  u.HeadImageUrl,
 				"s_nickname":      u.Nickname,