Forráskód Böngészése

wip:新老商机管理区分

WH01243 3 éve
szülő
commit
8e3d72c14c

+ 7 - 10
src/jfw/front/dataExport.go

@@ -850,7 +850,7 @@ func (this *DataExport) GetPcEntAuth() {
 	}
 	isNew := false
 	if phone != "" {
-		ent := public.Mysql.SelectBySql("select id,phone,createtime from entniche_info where phone=? and status=1 ", phone)
+		ent := public.Mysql.SelectBySql("select id,isNew,phone,createtime from entniche_info where phone=? and status=1 ", phone)
 		if ent != nil && len(*ent) != 0 {
 			for _, val := range *ent {
 				if pcUsers[util.IntAll(val["id"])] {
@@ -858,11 +858,10 @@ func (this *DataExport) GetPcEntAuth() {
 					if hideUsers[util.IntAll(val["id"])] {
 						entnicheMenu = false
 					} else {
-						//loc, _ := time.LoadLocation("Local")
-						//t2, _ := time.ParseInLocation("2006-01-02 15:04:05", util.ObjToString(val["createtimes"]), loc)
-						//if t2.Unix() > int64(1642227707) {
+						/*if  util.IntAll(val["isNew"])==1{
 							isNew = true
-						//}
+						}*/
+						isNew = true
 						entnicheMenu = true
 					}
 					break
@@ -874,7 +873,7 @@ func (this *DataExport) GetPcEntAuth() {
 			if user != nil && len(*user) > 0 {
 				for _, v := range *user {
 					if pcUsers[util.IntAll(v["ent_id"])] {
-						ents := public.Mysql.SelectBySql("select status,id,createtime from entniche_info where id=? ", util.IntAll(v["ent_id"]))
+						ents := public.Mysql.SelectBySql("select status,id,createtime,isNew from entniche_info where id=? ", util.IntAll(v["ent_id"]))
 						if ents != nil && len(*ents) != 0 {
 							for _, vv := range *ents {
 								if util.IntAll(vv["status"]) == 1 {
@@ -884,11 +883,9 @@ func (this *DataExport) GetPcEntAuth() {
 									if hideUsers[util.IntAll(vv["id"])] {
 										entnicheMenu = false
 									} else {
-										//loc, _ := time.LoadLocation("Local")
-										//t2, _ := time.ParseInLocation("2006-01-02 15:04:05", util.ObjToString(vv["createtime"]), loc)
-										//if t2.Unix() > int64(1642227707) {
+										if  util.IntAll(vv["isNew"])==1{
 											isNew = true
-										//}
+										}
 										entnicheMenu = true
 									}
 								}

+ 4 - 2
src/jfw/modules/app/src/app/front/me.go

@@ -375,12 +375,14 @@ func (l *Me) MyInfo() {
 		if phone != "" {
 			//已购买企业未过期
 			log.Println("SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1",phone)
-			if entInfo := public.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
+			if entInfo := public.Mysql.SelectBySql(`SELECT status,isNew FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
 				for _, v := range (*entInfo) {
-					if qutil.IntAll(v["status"]) == 1 {
+					//&& qutil.IntAll(v["isNew"]
+					if qutil.IntAll(v["status"]) == 1  {
 						isEnt = true
 						break
 					}
+
 				}
 			}
 		}

+ 6 - 8
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -105,7 +105,7 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 		}
 	}
 	//大会员状态
-	data, ok := mg.FindById("user", userId, `{"i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
+	data, ok := mg.FindById("user", userId, `{"s_phone":1,"i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
 	if ok && *data != nil && len(*data) > 0 {
 		userPower.Registedate = qutil.Int64All((*data)["l_registedate"])
 		userPower.Status = qutil.IntAllDef((*data)["i_member_status"], 0)
@@ -142,22 +142,20 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 		}
 	}
 	entniche:=0
-/*	res := mysql.SelectBySql(`SELECT i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
+	res := mysql.SelectBySql(`SELECT 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)
+			ORDER BY  i.status DESC,i.auth_status DESC, CASE WHEN u.phone=? THEN 0  ELSE 1 END  ASC`, (*data)["s_phone"])
 	if res != nil && len(*res) > 0 {
-		entname := qutil.ObjToString((*res)[0]["name"])
-		d["entname"] = entname
+		//entname := qutil.ObjToString((*res)[0]["name"])
+		/*d["entname"] = entname*/
 		//已购买企业未过期-商机管理用户
 		for _, v := range *res {
 			if qutil.IntAll(v["status"]) == 1 && qutil.IntAll(v["power"]) == 1 {
-				d["isFree"] = false
-				d["entniche"] = true
 				entniche =1
 				break
 			}
 		}
-	}*/
+	}
 	//子账号查询父节点权限
 	queryId := qutil.If(userPower.Pid == "", userId, userPower.Pid).(string)
 	//用户购买的服务

+ 10 - 2
src/jfw/modules/common/src/qfw/util/jy/subscribepush.go

@@ -208,7 +208,7 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}) *Sub
 }
 
 func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total int64, result []*SubPushList) {
-	// log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
+	 log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
 	if spqp.UserId == "" {
 		return
 	}
@@ -227,6 +227,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 	starttime, endtime := int64(0), int64(0)
 	st, et := "", ""
 	now := time.Now()
+	log.Println(4444)
 	if spqp.SelectTime == "today" { //今天
 		starttime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
 	} else if spqp.SelectTime == "yesterday" { //昨天
@@ -249,11 +250,14 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 			endtime = time.Date(etTime.Year(), etTime.Month(), etTime.Day(), 23, 59, 59, 0, time.Local).Unix()
 		}
 	}
+	log.Println(2222)
 	nowFormat := NowFormat(Date_Short_Layout)
 	start := (spqp.PageNum - 1) * spqp.PageSize
 	end := start + spqp.PageSize
 	//时间是今天,没有别的过滤条件
 	if nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
+
+		log.Println("a1")
 		subPush, err := s.GetTodayCache(spqp.UserId)
 		if err != nil {
 			log.Println(spqp.UserId, "GetTodayCache Error", err)
@@ -276,12 +280,15 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 		}
 		total = int64(length)
 	} else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize <= 250 { //全部,没有过滤条件 之前缓存5页*50条=250
-		allCache, err := s.GetAllCache(spqp.UserId)
+		log.Println("a2")
+	allCache, err := s.GetAllCache(spqp.UserId)
 		if err != nil {
 			log.Println(spqp.UserId, "GetAllCache Error", err)
 		}
 		if err != nil || allCache == nil || allCache.Date != nowFormat || len(allCache.Datas) == 0 {
+			log.Println("a3")
 			spqp.PageNum = 1
+			log.Println(1111)
 			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
 			allCache = &SubPush{
 				Date:  nowFormat,
@@ -299,6 +306,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 		}
 		total = allCache.Count
 	} else {
+		log.Println("a4")
 		result, total = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
 	}
 	if result == nil {

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

@@ -59,13 +59,13 @@ func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim,s
 	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.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
+	res := sql.SelectBySql(`SELECT i.isNew,i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN z 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 {
+			if util.IntAll(v["status"]) == 1 && util.IntAll(v["power"]) == 1 && util.IntAll(v["isNew"]) == 1 {
 				//d["isFree"] = false
 				//d["entniche"] = true
 				entniche=true

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

@@ -457,12 +457,14 @@ func Power(userid string) (bool, map[string]interface{}) {
 		}
 		if phone != "" {
 			//已购买企业未过期
-			if entInfo := *db.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len(entInfo) > 0 {
+			if entInfo := *db.Mysql.SelectBySql(`SELECT status,isNew FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len(entInfo) > 0 {
 				for _, v := range entInfo {
-					if qu.IntAll(v["status"]) == 1 {
+					//&& qu.IntAll(v["isNew"]) == 1
+					if qu.IntAll(v["status"]) == 1 && qu.IntAll(v["isNew"]) == 1{
 						isEnt = true
 						break
 					}
+
 				}
 			}
 			// if db.Mysql.CountBySql(`select count(1) from entniche_user where phone = ? and power =1`, phone) > 0 {
@@ -534,6 +536,7 @@ func GetInfoById(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, idlist
 		}
 	}
 	//mongodb bidding
+	log.Println(1)
 	mgo_ids := []primitive.ObjectID{}
 	for _, v := range es_ids {
 		if infos[v] == nil {
@@ -552,6 +555,7 @@ func GetInfoById(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, idlist
 		}
 	}
 	//mongodb bidding_back
+	log.Println(2)
 	mgo_back_ids := []primitive.ObjectID{}
 	for _, v := range mgo_ids {
 		if infos[mg.BsonIdToSId(v)] == nil {

+ 2 - 2
src/jfw/modules/publicapply/src/dataexport/entity/collection.go

@@ -24,9 +24,9 @@ func IsPay(userid string) bool {
 		}
 		if phone != "" {
 			//已购买企业未过期
-			if entInfo := *db.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len(entInfo) > 0 {
+			if entInfo := *db.Mysql.SelectBySql(`SELECT status,isNew FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len(entInfo) > 0 {
 				for _, v := range entInfo {
-					if util.IntAll(v["status"]) == 1 {
+					if util.IntAll(v["status"]) == 1 && util.IntAll(v["isNew"]) == 1 {
 						isEnt = true
 						break
 					}

+ 2 - 2
src/jfw/modules/publicapply/src/me/me.go

@@ -61,9 +61,9 @@ func (m *Me) MyInfo() {
 		isEnt := false
 		if phone != "" {
 			//已购买企业未过期
-			if entInfo := public.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
+			if entInfo := public.Mysql.SelectBySql(`SELECT status,isNew FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
 				for _, v := range (*entInfo) {
-					if util.IntAll(v["status"]) == 1 {
+					if util.IntAll(v["status"]) == 1 && util.IntAll(v["isNew"]) == 1{
 						isEnt = true
 						break
 					}

+ 2 - 0
src/jfw/modules/publicapply/src/subscribePush/service/pushList.go

@@ -204,6 +204,7 @@ func (sp *SubscribePush) HistoryPaging() {
 	if vipType == "" { //默认取已切换的企业
 		vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
 	}
+	log.Println("ssss", util.ObjToString(sp.GetSession("entUserId")))
 	if vipType==jy.SwitchService.Entniche{
 		userId = util.ObjToString(sp.GetSession("entUserId"))
 	}
@@ -234,6 +235,7 @@ 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)