Browse Source

代码修改

WH01243 2 years ago
parent
commit
bbde67e76c

+ 3 - 2
common/src/qfw/util/bidsearch/search.go

@@ -2,6 +2,7 @@ package bidsearch
 
 import (
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"fmt"
 	"log"
 	"net/http"
@@ -390,9 +391,9 @@ func GetSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinne
 	return
 }
 
-func PublicSearch(userId, selectType, publishtime string, bidSearchOldUserLimit int64, currentPage, pageSize int, appid string, session *httpsession.Session, host, key string) (bool, string, []string, int, int) {
+func PublicSearch(userId, selectType, publishtime string, bidSearchOldUserLimit int64, currentPage, pageSize int, session *httpsession.Session, string, middleground middleground.Middleground) (bool, string, []string, int, int) {
 	var start int
-	vipStatus := jy.GetVipState(appid, session, host, key, userId)
+	vipStatus := jy.GetVipState(session, middleground, userId)
 	isPayedUser := vipStatus.IsPayedUser()
 	queryItems := vipStatus.GetQueryItems(selectType, bidSearchOldUserLimit)
 	if publishtime == "" {

+ 2 - 2
common/src/qfw/util/jy/bigVipPower.go

@@ -146,14 +146,14 @@ func GetEntnicheState(userId string, mysql *mysql.Mysql, mg m.MongodbSim) *BigVi
 }
 
 // 获取大会员个人基本信息
-func GetBigVipUserBaseMsg(appid string, session *httpsession.Session, middleground middleground.Middleground) *BigVipBaseMsg {
+func GetBigVipUserBaseMsg(session *httpsession.Session, middleground middleground.Middleground) *BigVipBaseMsg {
 	userId := qutil.ObjToString(session.Get("userId"))
 	baseUserId := qutil.Int64All(session.Get("base_user_id"))
 	entId := qutil.Int64All(session.Get("entId"))
 	positionType := qutil.Int64All(session.Get("positionType"))
 	accountId := qutil.Int64All(session.Get("accountId"))
 	userPower := BigVipBaseMsg{}
-	data := middleground.PowerCheckCenter.Check(appid, userId, baseUserId, accountId, entId)
+	data := middleground.PowerCheckCenter.Check("10000", userId, baseUserId, accountId, entId)
 	if positionType == 0 {
 		userId = qutil.InterfaceToStr(session.Get("userId"))
 	} else {

+ 3 - 2
common/src/qfw/util/jy/payUser.go

@@ -2,6 +2,7 @@ package jy
 
 import (
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"bytes"
 	"encoding/json"
 	"errors"
@@ -22,13 +23,13 @@ type VipState struct {
 	registerData int64 //注册时间
 }
 
-func GetVipState(appid string, session *httpsession.Session, host, key, userId string) (vs *VipState) {
+func GetVipState(session *httpsession.Session, middleground middleground.Middleground, userId string) (vs *VipState) {
 	vs = &VipState{}
 	if userId == "" {
 		return
 	}
 	//data, ok := mg.FindById("user", userId, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1,"l_registedate":1`)
-	data := GetBigVipUserBaseMsg("10000", session, host, key)
+	data := GetBigVipUserBaseMsg(session, middleground)
 	if data != nil {
 		i_vip_status := data.Data.Vip.Status
 		if i_vip_status > 1 {

+ 11 - 10
common/src/qfw/util/jy/switchService.go

@@ -2,6 +2,7 @@ package jy
 
 import (
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jypkg/middleground"
 )
 
 var SwitchService = &switchService{
@@ -26,10 +27,10 @@ type switchService struct {
  * @param mongodb
  * @return string 服务类型
  */
-func (s *switchService) Get(session *httpsession.Session, appid, host, key string) string {
+func (s *switchService) Get(session *httpsession.Session, middleground middleground.Middleground) string {
 	//userId, _ := session.Get("userId").(string)
 	v, _ := session.Get(s.SessionKey).(string)
-	data := GetBigVipUserBaseMsg(appid, session, host, key)
+	data := GetBigVipUserBaseMsg(session, middleground)
 	//u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
 	if data != nil {
 		if i_member_status := data.Status; v == s.Member && i_member_status > 0 {
@@ -48,12 +49,12 @@ func (s *switchService) Get(session *httpsession.Session, appid, host, key strin
 	return s.Free
 }
 
-func (s *switchService) GetEntniche(session *httpsession.Session, appid, host, key string) string {
+func (s *switchService) GetEntniche(session *httpsession.Session, middleground middleground.Middleground) string {
 	sessMap := session.GetMultiple()
 	//userId, _ := sessMap["userId"].(string)
 	v, _ := sessMap[s.SessionKey].(string)
 	//u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
-	data := GetBigVipUserBaseMsg(appid, session, host, key)
+	data := GetBigVipUserBaseMsg(session, middleground)
 	/* if entId, entUserId := util.IntAll(sessMap["entId"]), util.IntAll(sessMap["entUserId"]); entId > 0 && entUserId > 0 {
 		      //当前企业是否购买商机管理
 		      if sql.CountBySql(`SELECT count(1) as count FROM entniche_info a inner join entniche_user b on (a.id=? and a.status=1 and ifnull(a.power_source,0)=0 and b.id=? and b.power=1)`, entId, entUserId) > 0 {
@@ -84,16 +85,16 @@ func (s *switchService) GetEntniche(session *httpsession.Session, appid, host, k
 }
 
 //所选服务是否是大会员
-func (s *switchService) IsMember(session *httpsession.Session, appid, host, key string) bool {
-	return s.GetEntniche(session, appid, host, key) == s.Member
+func (s *switchService) IsMember(session *httpsession.Session, middleground middleground.Middleground) bool {
+	return s.GetEntniche(session, middleground) == s.Member
 }
 
 //所选服务是否是超级订阅
-func (s *switchService) IsVip(session *httpsession.Session, appid, host, key string) bool {
-	return s.Get(session, appid, host, key) == s.Vip
+func (s *switchService) IsVip(session *httpsession.Session, middleground middleground.Middleground) bool {
+	return s.Get(session, middleground) == s.Vip
 }
 
 //所选服务是否是免费
-func (s *switchService) IsFree(session *httpsession.Session, appid, host, key string) bool {
-	return s.Get(session, appid, host, key) == s.Free
+func (s *switchService) IsFree(session *httpsession.Session, middleground middleground.Middleground) bool {
+	return s.Get(session, middleground) == s.Free
 }