Browse Source

分支合并

lianbingjie 2 years ago
parent
commit
111119bd45

+ 2 - 2
src/jfw/front/classificationTag.go

@@ -73,12 +73,12 @@ func GetWinnerInfo() (data []BuyerList) {
 	from := randGen.Intn(100)
 
 	//关联中标企业
-	r := elastic.Get("winner", "winner", fmt.Sprintf(`{"query": {"bool": {"must": []}},"_source": ["_id","name"],"from": %d,"size": 200}`, from))
+	r := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query": {"bool": {"must": []}},"_source": ["_id","company_name"],"from": %d,"size": 200}`, from))
 	if r != nil {
 		for _, v := range *r {
 			var vs BuyerList
 			id := encrypt.EncodeArticleId2ByCheck(qu.InterfaceToStr(v["_id"]))
-			vs.Name = qu.InterfaceToStr(v["name"])
+			vs.Name = qu.InterfaceToStr(v["company_name"])
 			vs.Url = fmt.Sprintf("/swordfish/page_big_pc/ent_portrait/%s", id)
 			data = append(data, vs)
 		}

+ 3 - 1
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -125,13 +125,15 @@ func NoLoginAssociatedInfo(entId string) []map[string]interface{} {
 		randGen := rand.New(rand.NewSource(time.Now().UnixNano()))
 		from := randGen.Intn(100)
 		//关联中标企业
-		r := es.Get("winner", "winner", fmt.Sprintf(`{"query": {"bool": {"must": [{"query_string": {"default_field": "city","query": "%s*"}}]}},"_source": ["_id","name"],"from": %d,"size": 30}`, qutil.InterfaceToStr((*entinfo)["company_area"]), from))
+		r := es.Get("qyxy", "qyxy", fmt.Sprintf(`{"query": {"bool": {"must": [{"query_string": {"default_field": "company_area","query": "%s*"}}]}},"_source": ["_id","company_name"],"from": %d,"size": 30}`, qutil.InterfaceToStr((*entinfo)["company_area"]), from))
 		if r != nil {
 			winnerData = *r
 		}
 
 		for _, v := range winnerData {
 			v["_id"] = encrypt.EncodeArticleId2ByCheck(qutil.InterfaceToStr(v["_id"]))
+			v["name"] = qutil.InterfaceToStr(v["company_name"])
+			delete(v, "company_name")
 		}
 	}
 	return winnerData

+ 22 - 11
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -1,6 +1,8 @@
 package portrait
 
 import (
+	"app.yhyue.com/moapp/jybase/redis"
+	"encoding/json"
 	"errors"
 	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
@@ -459,7 +461,26 @@ func (this *SubVipPortrait) BuyerPortrait() {
 		if buyerName == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-
+		redisKey := fmt.Sprintf("buyerPortraitKey_%s", buyerName)
+		if userId == "" {
+			if bytes, err := redis.GetBytes("other", redisKey); err == nil && bytes != nil {
+				rData := make(map[string]interface{})
+				if err = json.Unmarshal(*bytes, &rData); err != nil {
+					log.Printf("[MANAGER-ERR]buyerPortraitKey_  GetData Error %v \n", err)
+					return rData, nil
+				}
+			}
+			q := `{"size": 1,"_source": ["buyerclass","province","city"],"query": {"match_phrase": {"name": "%s"}}}`
+			data := elastic.Get("buyer", "buyer", fmt.Sprintf(q, buyerName))
+			if data != nil && len(*data) > 0 {
+				rData := (*data)[0]
+				if bytes, err := json.Marshal(rData); err == nil && bytes != nil {
+					_ = redis.PutBytes("other", redisKey, &bytes, 2*24*60*60)
+				}
+				return rData, nil
+			}
+			return nil, nil
+		}
 		cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
 		cepm.Session = this.Session()
 		if err != nil {
@@ -487,17 +508,7 @@ func (this *SubVipPortrait) BuyerPortrait() {
 		if power == 3 {
 			rData["onTrial"] = true
 		}
-<<<<<<< HEAD
 		rData["name"] = buyerName
-=======
-		if userId == "" { //未登录用户限制字段
-			rData = map[string]interface{}{
-				"city":       rData["city"],
-				"buyerclass": rData["buyerclass"],
-				"province":   rData["province"],
-			}
-		}
->>>>>>> master
 		return rData, nil
 	}()
 	if errMsg != nil {

+ 2 - 2
src/web/staticres/js/superSearch.js

@@ -1589,10 +1589,10 @@ function distributeInit(){
   $.ajax({
     type: 'get',
     contentType: "application/json",
-    url: '/bigmember/use/isAdd',
+    url: '/entbase/ent/entinfo',
     success: function (r) {
       if (r.data) {
-        if(r.data.entSubscribe == 1){
+        if(r.data.admin_system || r.data.admin_department){
           $('#right-distribute').show();
           $('.line-distribute').show();
         }  

+ 6 - 4
src/web/templates/pc/biddetail_rec.html

@@ -135,8 +135,10 @@
         #statusbar{
           padding: 10px 0 0 0!important;
           line-height: 24px;
-          overflow: hidden;
+          /* overflow: hidden; */
         }
+        .clearfix:after {visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
+        .clearfix {*zoom:1; }
         .com-tagsbar{
           margin-top: 12px;
         }
@@ -211,7 +213,7 @@
                 {{.T.obj.title}}
             </h1>
             <div class="com-tagsbar"></div>
-            <div class="com-statusbar" id="statusbar">
+            <div class="com-statusbar clearfix" id="statusbar">
                 <!-- 自定义标签弹框 -->
                 <div class="tags-box" id="collectTags">
                     <div class="tags-inputs">
@@ -1788,10 +1790,10 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
           $.ajax({
           type: 'get',
           contentType: "application/json",
-          url: '/bigmember/use/isAdd',
+          url: '/entbase/ent/entinfo',
           success: function (r) {
            if (r.data) {
-             if(r.data.entSubscribe == 1){
+             if(r.data.admin_system || r.data.admin_department){
                $('#manual-distribution').show();
             }  
            }