Procházet zdrojové kódy

Merge branch 'master' into feature/v4.7.60

lianbingjie před 2 roky
rodič
revize
abe11e1a98

+ 17 - 5
src/jfw/front/tags.go

@@ -9,6 +9,7 @@ import (
 	"log"
 	"math"
 	"math/rand"
+	"net/http"
 	qu "qfw/util"
 	"qfw/util/bidsearch"
 	"qfw/util/elastic"
@@ -17,6 +18,7 @@ import (
 	"strings"
 	"time"
 
+	"github.com/go-xweb/httpsession"
 	"github.com/go-xweb/xweb"
 )
 
@@ -229,7 +231,12 @@ func (this *Tags) Index(types, name string) {
 	this.T["tdk"] = this.GetTDK(haveList, types, checkedKeywords, pageNum, checkedLetter, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, checkedKeywords)
 	if haveList {
 		//信息类型
-		this.T["biddingList"], this.T["biddingCount"] = this.GetBidding(checkedIndustry, checkedProvince, checkedCity, InfoType, checkedKeywords)
+		isLimit := false
+		this.T["biddingList"], this.T["biddingCount"], isLimit = this.GetBidding(checkedIndustry, checkedProvince, checkedCity, InfoType, checkedKeywords, this.Request, this.ResponseWriter, this.Session())
+		if isLimit {
+			this.Redirect("/504.html")
+			return
+		}
 		filters["biddingCount"] = this.T["biddingCount"]
 		if qu.Int64All(this.T["biddingCount"]) == 0 && types == "letter" {
 			this.T["letterList"], this.T["letterListCount"], this.T["pagingMap"] = this.GetLetterPaging(pageNum, checkedLetter)
@@ -583,15 +590,20 @@ func GetBiddingPlatformType() (nameToCode map[string]int64, codeToName map[int64
 	return
 }
 
-func (this *Tags) GetBidding(industry, area, city, stype, keyword string) ([]map[string]interface{}, int64) {
+func (this *Tags) GetBidding(industry, area, city, stype, keyword string, request *http.Request, responseWriter http.ResponseWriter, session *httpsession.Session) ([]map[string]interface{}, int64, bool) {
 	rediskey := fmt.Sprintf("pcseo_getbidding_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
 	rediskeyCount := fmt.Sprintf("pcseo_getbidding_count_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
 
 	if l, ok := redis.Get("other", rediskey).([]interface{}); ok && l != nil {
 		count := redis.GetInt("other", rediskeyCount)
-		return qu.ObjArrToMapArr(l), int64(count)
+		return qu.ObjArrToMapArr(l), int64(count), false
 	} else {
 		if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
+			if public.Lst.IsLimited(request, responseWriter, session, false) == 1 { //没有被限制
+				defer public.Lst.Limit()
+			} else {
+				return nil, 0, true
+			}
 			//
 			query1 := `{"query": {"bool": {"must":[`
 			query_start := `{"query": {"bool": {"must":[`
@@ -664,11 +676,11 @@ func (this *Tags) GetBidding(industry, area, city, stype, keyword string) ([]map
 				public.BidListConvert(industry, datas)
 				redis.Put("other", rediskey, datas, 2*60*60)
 				redis.Put("other", rediskeyCount, count, 2*60*60)
-				return *datas, count
+				return *datas, count, false
 			}
 		}
 	}
-	return nil, 0
+	return nil, 0, false
 }
 
 //获取关键词

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

@@ -248,14 +248,14 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 			userPower.PrivateGD = mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone) > 0
 
 			//用于判断是否含有企业主体的超级订阅、大会员服务
-			epowerData := mysql.SelectBySql(`SELECT c.product_type FROM entniche_user a INNER JOIN entniche_power b 
-		 									INNER JOIN entniche_wait_empower c 
+			epowerData := mysql.SelectBySql(`SELECT c.product_type FROM entniche_user a INNER JOIN entniche_power b
+		 									INNER JOIN entniche_wait_empower c
 		 									ON a.id =b.ent_user_id  AND c.id = b.wait_empower_id WHERE a.phone =? AND c.end_time >?`, phone, time.Now().Format(qutil.Date_Full_Layout))
 			if epowerData != nil && len(*epowerData) > 0 {
 				for _, v := range *epowerData {
 					product_type := qutil.ObjToString(v["product_type"])
 					if strings.Contains(product_type, "VIP订阅") {
-						userPower.MemberPowerType = 2
+						userPower.VipPowerType = 2
 					} else if strings.Contains(product_type, "大会员") {
 						userPower.MemberPowerType = 2
 					}

+ 1 - 1
src/web/staticres/public-pc/js/header-nav.js

@@ -133,7 +133,7 @@ function trySelectNav (name) {
 })();
 function docScroll(e){
   var $href = window.location.href;
-  var opa = $(document).scrollTop() / 120
+  var opa = $(document).scrollTop() / 20
   var curTheme =$("#public-nav").attr('data-theme')
   if(opa >= 1){
     $("#public-nav").removeClass('light-bg-dark-color').removeClass('light-bg-light-color')

+ 12 - 12
src/web/templates/frontRouter/pc/enterpriseCertificatio/free/index.html

@@ -486,9 +486,9 @@
         judgeTop();
         docScroll();
       });
-      
+
     })();
-    
+
     $.ajax({
                 type:'GET',
                 url:'/commercial/customer/info',
@@ -498,21 +498,21 @@
                 success:function(res) {
                   $('.phone_box').html(res.data.phone)
                   $('.wchat_box').html('<img src='+res.data.wxCodeImg+' alt="">')
-                  
-                
+
+
                 },
                 error:function(err) {
                     console.log(err)
                 }
             })
-     
+
      function docScroll(e){
       var $href = window.location.href;
-      var opa = $(document).scrollTop() / 120
+      var opa = $(document).scrollTop() / 20
       var curTheme =$("#public-nav").attr('data-theme')
       if(opa >= 1){
         $('.loginBtn').removeClass('loginBtnnew')
-      
+
       }else {
         if(firstTheme === 'dark'){
           setNavTheme('dark')
@@ -523,7 +523,7 @@
     }
     $("#public-nav .iner .jynav li").bind("mouseenter",function(){
       $('.loginBtn').removeClass('loginBtnnew')
-   
+
   })
   // $("#public-nav .iner .jynav li").bind("mouseleave",function(){
   //   $('.loginBtn').addClass('loginBtnnew')
@@ -531,7 +531,7 @@
   // })
   // $('.loginBtn').bind("mouseenter",function(){
   //     $('.loginBtn').removeClass('loginBtnnew')
-   
+
   // })
   // $('.loginBtn').bind("mouseleave",function(){
   //   $('.loginBtn').addClass('loginBtnnew')
@@ -540,7 +540,7 @@
     function getUrlKey(name) {
       return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
     }
-  }) 
+  })
   function cooperativePartner(source) { //成为合作商
             checkLogin()
             vmPartner.isNeedSubmit(source, function () {
@@ -561,10 +561,10 @@
             if (!loginflag) {
                 $("#bidLogin").modal("show");
             }
-        } 
+        }
   function onlinekf () {
       $('.help-slide-zx.open-customer').trigger('click')
-    } 
+    }
 </script>
 {{include "/common/bidLeaveInfo.html"}}
 <!--S-百度统计-->

+ 2 - 2
src/web/templates/pc/index.html

@@ -506,7 +506,7 @@
             slideChangeTransitionStart: function() {
               var img = document.getElementsByClassName('swiper-slide-active')[0].children[0];
               var theme = $(img).attr('data-theme')
-              var opa = $(document).scrollTop() / 120
+              var opa = $(document).scrollTop() / 20
               if (opa < 1) {
                 if (theme === 'light') {
                   setTimeout(function(){
@@ -718,7 +718,7 @@
     window.addEventListener('scroll', function() {
       var img = document.getElementsByClassName('swiper-slide-active')[0].children[0];
       var theme = $(img).attr('data-theme')
-      var opa = $(document).scrollTop() / 120
+      var opa = $(document).scrollTop() / 20
       if (opa < 1) {
         if (theme === 'light') {
           $('.public-nav').addClass('light-bg-dark-color').removeClass('light-bg-light-color')