Răsfoiți Sursa

Merge branch 'dev4.5.2' of http://172.16.10.252:8080/qmx/jy into dev4.5.2

TANGSHIZHE 4 ani în urmă
părinte
comite
e2acadacbf

+ 26 - 26
src/jfw/modules/common/src/qfw/util/jy/subvipPortrait.go

@@ -32,9 +32,6 @@ func (this *BigVipBaseMsg) SubVipPortraitUsage(mysql *mysql.Mysql, entId string)
 }
 
 func (this *BigVipBaseMsg) isVisitEnt(mysql *mysql.Mysql, entId string) bool {
-	if this.VipStatus <= 0 || entId == "" {
-		return false
-	}
 	now := time.Now()
 	//浏览缓存
 	visitedCache := fmt.Sprintf(UsePortraitVisited, this.Uid, int(now.Month()), entId)
@@ -54,37 +51,40 @@ func (this *BigVipBaseMsg) SubVipPortraitTimesCheck(mysql *mysql.Mysql, entId st
 	if this.VipStatus <= 0 || entId == "" {
 		return fmt.Errorf("非法请求")
 	}
-
+	fullCount, now := 0, time.Now()
 	//查询本月是否浏览过
 	if this.isVisitEnt(mysql, entId) {
 		return nil
 	}
 
-	fullCount, now := 0, time.Now()
-	if this.Vip_BuySet.AreaCount == -1 {
-		fullCount = 16 * OneAreaTimes //全国全国行业
-	} else {
-		fullCount = this.Vip_BuySet.AreaCount * OneAreaTimes
-	}
+	//并发控制
+	if redis.Incr(PowerCacheDb, fmt.Sprintf(UsePortraitVisited, this.Uid, int(now.Month()), entId)) == 1 {
+		_ = redis.SetExpire(PowerCacheDb, fmt.Sprintf(UsePortraitVisited, this.Uid, int(now.Month()), entId), 60*60*5)
+		if this.Vip_BuySet.AreaCount == -1 {
+			fullCount = 16 * OneAreaTimes //全国全国行业
+		} else {
+			fullCount = this.Vip_BuySet.AreaCount * OneAreaTimes
+		}
 
-	//校验本月次数是否使用完
-	useKey := fmt.Sprintf(PortraitRecordTimes, this.Uid, int(now.Month()))
+		//校验本月次数是否使用完
+		useKey := fmt.Sprintf(PortraitRecordTimes, this.Uid, int(now.Month()))
 
-	useCount := redis.GetInt(PowerCacheDb, useKey)
-	if useCount >= fullCount {
-		return fmt.Errorf("本月次数已使用完")
-	}
+		useCount := redis.GetInt(PowerCacheDb, useKey)
+		if useCount >= fullCount {
+			return fmt.Errorf("本月次数已使用完")
+		}
 
-	//新增使用记录
-	if mysql.Insert(PortraitRecordTable, map[string]interface{}{
-		"user_id":     this.Uid,
-		"ent_id":      entId,
-		"create_time": now.Format("2006-01-02 15:04:05"),
-	}) == 0 {
-		return fmt.Errorf("数据记录异常")
-	}
-	if redis.Incr(PowerCacheDb, useKey) == 1 {
-		_ = redis.SetExpire(PowerCacheDb, useKey, 24*60*60*31) //次数缓存一个月
+		//新增使用记录
+		if mysql.Insert(PortraitRecordTable, map[string]interface{}{
+			"user_id":     this.Uid,
+			"ent_id":      entId,
+			"create_time": now.Format("2006-01-02 15:04:05"),
+		}) == 0 {
+			return fmt.Errorf("数据记录异常")
+		}
+		if redis.Incr(PowerCacheDb, useKey) == 1 {
+			_ = redis.SetExpire(PowerCacheDb, useKey, 24*60*60*31) //次数缓存一个月
+		}
 	}
 	return nil
 }

+ 6 - 6
src/web/staticres/frontRouter/pc/seeHistory/js/index-pc.js

@@ -41,8 +41,8 @@ var vm = new Vue({
             statusEnum: ['存续', '吊销', '注销', '撤销'],
             statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
             seeList: {
-                pageNum: 0, // 当前页
-                pageSize: 50, // 每页多少条数据
+                pageNum: 1, // 当前页
+                pageSize: 10, // 每页多少条数据
                 total: 0, // 总页数
                 list: [] // 返回的数据
             }
@@ -51,7 +51,6 @@ var vm = new Vue({
     created() {
         this.years = new Date().getFullYear()
         this.months = parseInt(new Date().getMonth() + 1)
-        // this.dateVal = this.years + '年' + this.months + '月'
         this.dateVal = new Date()
         this.subPoint()
         this.subRecord()
@@ -75,7 +74,7 @@ var vm = new Vue({
                 year: this.years,
                 month: this.months,
                 pageSize: this.seeList.pageSize,
-                pageNum: this.seeList.pageNum
+                pageNum: this.seeList.pageNum - 1
             }
         },
         subRecord() {
@@ -89,7 +88,7 @@ var vm = new Vue({
                 var _this = this
                 if (res.error_code == 0 && res.data.list) {
                     if (res.data.total) {
-                        this.listState.total = res.data.total
+                        this.seeList.total = res.data.total
                     }
                     res.data.list.forEach(v => {
                         const arrs = {
@@ -114,12 +113,13 @@ var vm = new Vue({
         },
         onPageChange(page) {
             this.seeList.pageNum = page
+            this.seeList.list = []
             this.subRecord()
         },
         dateHandler(val) {
             this.years = val.getFullYear()
             this.months = val.getMonth() + 1
-            this.seeList.pageNum = 0
+            this.seeList.pageNum = 1
             this.seeList.list = []
             this.subRecord()
         },

+ 3 - 3
src/web/templates/frontRouter/pc/seeHistory/sess/index.html

@@ -46,7 +46,7 @@
                 <i class="el-icon-arrow-down r-icons" @click="dateHandler"></i>
             </div>
         </div>
-        <div class="see-content w" v-show="seeList.length !== 0">
+        <div class="see-content w" v-show="seeList.list.length !== 0">
             <div class="lists flex" v-for="item in seeList.list" :key="item._id">
                 <div class="words-img" :style="{'background-color': item.color}" @click="detailed(item._id)">
                     <span>{item.abbr1}</span><span class="xin-xi">{item.abbr2}</span>
@@ -59,7 +59,7 @@
                     <div class="cont-tips di-zhi">地址:<span>{item.address}</span></div>
                 </div>
             </div>
-            <div class="el-pagination-container">
+            <div class="el-pagination-container" v-show="seeList.total">
                 <el-pagination
                     background
                     layout="prev, pager, next, ->"
@@ -71,7 +71,7 @@
                 ></el-pagination>
             </div>
         </div>
-        <div class="no-data" v-show="seeList.length === 0"><el-image src="/images/pc_12.png"></el-image><div class="tip-text"><p>暂无数据</p></div></div>
+        <div class="no-data" v-show="seeList.list.length === 0"><el-image src="/images/pc_12.png"></el-image><div class="tip-text"><p>暂无数据</p></div></div>
     </section>
 
     {{include "/common/pcbottom.html"}}

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

@@ -122,7 +122,8 @@
 			<div class="search">
 				<form method="post" action="/jylab/supsearch/index.html" id="zbIndex">
 					<input class="ser" autocomplete="off"  type="text" name="keywords" placeholder="请输入您想要查询的招标信息" id="keywords" value="" />
-					<input type="hidden" name="searchvalue">
+          <input type="hidden" name="searchvalue">
+          <input type="hidden" name="publishtime" value="lately-30">
 					<input class="btn" type="button" onclick="zbSeatch('zbIndex')" />
 				</form>
         <div class="index_search_thikn">