Browse Source

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

tsz 3 years ago
parent
commit
0667e627e8

+ 21 - 22
src/jfw/modules/common/src/qfw/util/jy/switchService.go

@@ -1,11 +1,11 @@
 package jy
 
 import (
+	"fmt"
+	"github.com/go-xweb/httpsession"
 	. "mongodb"
 	"qfw/util"
 	"qfw/util/mysql"
-
-	"github.com/go-xweb/httpsession"
 )
 
 var SwitchService = &switchService{
@@ -32,10 +32,8 @@ type switchService struct {
  */
 func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 	userId, _ := session.Get("userId").(string)
-	//entUserId := util.IntAll(this.GetSession(""))
 	v, _ := session.Get(s.SessionKey).(string)
 	u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
-	//entniche:=false
 	if ok && u != nil {
 		if i_vip_status := util.IntAll((*u)["i_vip_status"]); v == s.Vip && i_vip_status > 0 {
 			return s.Vip
@@ -44,7 +42,7 @@ func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 		} else if i_vip_status > 0 {
 			session.Set(s.SessionKey, s.Vip)
 			return s.Vip
-		}else if i_member_status > 0 {
+		} else if i_member_status > 0 {
 			session.Set(s.SessionKey, s.Member)
 			return s.Member
 		}
@@ -53,26 +51,30 @@ func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 	return s.Free
 }
 
-func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim,sql *mysql.Mysql) string {
+func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim, sql *mysql.Mysql) string {
 	userId, _ := session.Get("userId").(string)
 	entUserId := util.IntAll(session.Get("entUserId"))
 	v, _ := session.Get(s.SessionKey).(string)
 	u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
-	entniche:=false
-	res := sql.SelectBySql(`SELECT i.isNew,i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
+	entniche := false
+	fmt.Println("2222",entUserId)
+	if entUserId != 0 {
+		res := sql.SelectBySql(`SELECT i.isNew,i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
 			ON u.ent_id=i.id
 			ORDER BY  i.status DESC,i.auth_status DESC, CASE WHEN u.id=? THEN 0  ELSE 1 END  ASC`, entUserId)
-	if res != nil && len(*res) > 0 {
-		//已购买企业未过期-商机管理用户
-		for _, v := range *res {
-			if util.IntAll(v["status"]) == 1 && util.IntAll(v["power"]) == 1 && util.IntAll(v["isNew"]) == 1 {
-				//d["isFree"] = false
-				//d["entniche"] = true
-				entniche=true
-				break
+		if res != nil && len(*res) > 0 {
+			//已购买企业未过期-商机管理用户
+			for _, v := range *res {
+				if util.IntAll(v["status"]) == 1 && util.IntAll(v["power"]) == 1 && util.IntAll(v["isNew"]) == 1 {
+					//d["isFree"] = false
+					//d["entniche"] = true
+					entniche = true
+					break
+				}
 			}
 		}
 	}
+	fmt.Println("22223",entniche)
 	if ok && u != nil {
 		if i_vip_status := util.IntAll((*u)["i_vip_status"]); v == s.Vip && i_vip_status > 0 {
 			return s.Vip
@@ -81,10 +83,11 @@ func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim,s
 		} else if i_vip_status > 0 {
 			session.Set(s.SessionKey, s.Vip)
 			return s.Vip
-		} else if entniche   {
+		} else if entniche {
+			fmt.Println("1231212",entniche)
 			session.Set(s.SessionKey, s.Entniche)
 			return s.Entniche
-		}else if i_member_status > 0 {
+		} else if i_member_status > 0 {
 			session.Set(s.SessionKey, s.Member)
 			return s.Member
 		}
@@ -107,7 +110,3 @@ func (s *switchService) IsVip(session *httpsession.Session, m MongodbSim) bool {
 func (s *switchService) IsFree(session *httpsession.Session, m MongodbSim) bool {
 	return s.Get(session, m) == s.Free
 }
-//所选服务是否是超级订阅
-func (s *switchService) IsEntniche(session *httpsession.Session, m MongodbSim) bool {
-	return s.Get(session, m) == s.Entniche
-}

+ 2 - 2
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -542,7 +542,7 @@ func GetInfoById(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, idlist
 		}
 	}
 	//mongodb bidding
-	log.Println(1)
+	fmt.Println(1)
 	mgo_ids := []primitive.ObjectID{}
 	for _, v := range es_ids {
 		if infos[v] == nil {
@@ -561,7 +561,7 @@ func GetInfoById(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, idlist
 		}
 	}
 	//mongodb bidding_back
-	log.Println(2)
+	fmt.Println(2)
 	mgo_back_ids := []primitive.ObjectID{}
 	for _, v := range mgo_ids {
 		if infos[mg.BsonIdToSId(v)] == nil {

+ 1 - 1
src/jfw/modules/publicapply/src/dataexport/service/action.go

@@ -85,7 +85,7 @@ func (des *DataExportStruct) ByPushHistory() {
 		defer util.Catch()
 		vipType := des.GetString("vt")
 		if vipType == "" { //默认取已切换的企业
-			vipType = jy.SwitchService.Get(des.Session(), db.Mgo)
+			vipType = jy.SwitchService.GetEntniche(des.Session(), db.Mgo,db.Mysql)
 		}
 		exportNum, _ := des.GetInteger("exportNum")
 		_, _, list := jy.NewSubscribePush(vipType).Datas(&jy.SubPushQueryParam{

+ 16 - 9
src/jfw/modules/publicapply/src/subscribePush/service/pushList.go

@@ -31,6 +31,8 @@ type SubscribePush struct {
 //VipSwitch 大会员、超级订阅、商机管理切换
 func (sp *SubscribePush) VipSwitch() {
 	userId, _ := sp.GetSession("userId").(string)
+	//entUserId := util.IntAll(sp.GetSession("entUserId"))
+	fmt.Println("11111111111",util.IntAll(sp.GetSession("entUserId")))
 	rData, errMsg := func() (interface{}, error) {
 		if userId == "" {
 			return nil, fmt.Errorf("未登录")
@@ -38,7 +40,9 @@ func (sp *SubscribePush) VipSwitch() {
 		switchOk := false
 		vt := sp.GetString("vt")
 		if vt == "" {
-			jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
+			vt=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
+			sp.SetSession(jy.SwitchService.SessionKey, vt)
+			fmt.Println("1231233",vt)
 		} else if vt == jy.SubVipFlag {
 			vipMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
 			if vipMsg.VipStatus <= 0 {
@@ -80,13 +84,15 @@ func (sp *SubscribePush) HasPushHistory() {
 	if userId == "" {
 		return
 	}
+
 	vipType := sp.GetString("vt")
 	if vipType == "" { //默认取已切换的企业
 		vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
+	fmt.Println("12312",vipType,userId,	util.IntAll(sp.GetSession("entUserId")))
 	if vipType==jy.SwitchService.Entniche{
 		fmt.Println(util.IntAll(sp.GetSession("entUserId")))
-		userId = util.ObjToString(sp.GetSession("entUserId"))
+		userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
 	}
 	go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)
 	user, _ := jy.NewSubscribePush().UserInfo(db.Mgo, userId)
@@ -202,11 +208,10 @@ func (sp *SubscribePush) HistoryPaging() {
 	}
 	vipType := sp.GetString("vt")
 	if vipType == "" { //默认取已切换的企业
-		vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+		vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
-	log.Println("ssss", util.ObjToString(sp.GetSession("entUserId")))
 	if vipType==jy.SwitchService.Entniche{
-		userId = util.ObjToString(sp.GetSession("entUserId"))
+		userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
 	}
 	pageNum, _ := sp.GetInteger("pageNum")
 	PageSize, _ := sp.GetInteger("pageSize")
@@ -235,7 +240,6 @@ func (sp *SubscribePush) HistoryPaging() {
 	} else {
 		spqp.PushMysql = db.MysqlPush
 	}
-	log.Println(3333)
 	hasNextPage, total, list := jy.NewSubscribePush(vipType).Datas(spqp)
 	//查询是否收藏
 	jy.NewSubscribePush().MakeCollection(userId, db.Mysql, list)
@@ -268,11 +272,13 @@ func (sp *SubscribePush) SetRead() error {
 	}
 	vipType := sp.GetString("vt")
 	if vipType == "" { //默认取已切换的企业
-		vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+		vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
 	if userId := util.ObjToString(sp.GetSession("userId")); userId != "" {
 		if vipType == jy.SwitchService.Member {
 			jy.NewSubscribePush(vipType).Visit(db.MysqlMemberPush, userId, vsid)
+		} else if vipType == jy.SwitchService.Entniche {
+			jy.NewSubscribePush(vipType).Visit(db.MysqlEntnichePush, userId, vsid)
 		} else {
 			jy.NewSubscribePush(vipType).Visit(db.MysqlPush, userId, vsid)
 		}
@@ -297,7 +303,8 @@ func (sp *SubscribePush) GetPushCount() error {
 	if userId != "" {
 		vipType := sp.GetString("vt")
 		if vipType == "" { //默认取已切换的企业
-			vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+			vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
+
 		}
 		matchway, _ := sp.GetInteger("matchway")
 		sp.ServeJson(map[string]interface{}{
@@ -315,7 +322,7 @@ func (sp *SubscribePush) GetPushAllCount() error {
 		index, _ := sp.GetInteger("index")
 		vipType := sp.GetString("vt")
 		if vipType == "" { //默认取已切换的企业
-			vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+			vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 		}
 		sp.ServeJson(map[string]interface{}{
 			"count": entity.SubViewDatasCount(userId, vipType, sp.GetString("item"), index),

+ 2 - 2
src/web/staticres/js/pur-search-index-pc.js

@@ -403,7 +403,7 @@ var vm = new Vue({
             return tempArr
         },
         doSearch: function () {
-            $('.tags-box').slideToggle()
+            $('.tags-box').hide()
             this.listState.pageNum = 1
             this.getList(1, 'search')
         },
@@ -458,7 +458,7 @@ var vm = new Vue({
             })
         },
         onPageChange: function (p) {
-            $('.tags-box').slideToggle()
+            $('.tags-box').hide()
             this.listState.pageNum = p
             this.getList(p)
         },