瀏覽代碼

Merge branch 'feature/v4.8.40_wky' of qmx/jy into feature/v4.8.40

wangkaiyue 2 年之前
父節點
當前提交
018809d71d

+ 28 - 24
src/jfw/front/classificationTag.go

@@ -1,28 +1,28 @@
 package front
 
 import (
-    qu "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jybase/encrypt"
-    elastic "app.yhyue.com/moapp/jybase/es"
-    "app.yhyue.com/moapp/jybase/redis"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
-    "app.yhyue.com/moapp/jypkg/public"
-    "encoding/json"
-    "fmt"
-    "jy/src/jfw/config"
-    "jy/src/jfw/jyutil"
-    "jy/src/jfw/paging"
-    "log"
-    "math"
-    "math/rand"
-    "strconv"
-    "sync"
-    "time"
+	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	elastic "app.yhyue.com/moapp/jybase/es"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	"app.yhyue.com/moapp/jypkg/public"
+	"encoding/json"
+	"fmt"
+	"jy/src/jfw/config"
+	"jy/src/jfw/jyutil"
+	"jy/src/jfw/paging"
+	"log"
+	"math"
+	"math/rand"
+	"strconv"
+	"sync"
+	"time"
 
-    "net/http"
+	"net/http"
 
-    "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 )
 
 type KeyType struct {
@@ -290,10 +290,14 @@ func HotBuyerList(entIsNew bool) []*BuyerList {
 		var buyerList []*BuyerList
 		for _, b := range *data {
 			name := qu.ObjToString(b["name"])
-			buyerList = append(buyerList, &BuyerList{
-				Name: name,
-				Url:  qu.If(entIsNew, fmt.Sprintf("/entpc/unit_portrayal/%s", name), fmt.Sprintf("/swordfish/page_big_pc/unit_portrayal/%s", name)).(string),
-			})
+			buyerId := qu.ObjToString(b["id"])
+			if name != "" && buyerId != "" {
+				idEncode := encrypt.EncodeArticleId2ByCheck(buyerId)
+				buyerList = append(buyerList, &BuyerList{
+					Name: name,
+					Url:  qu.If(entIsNew, fmt.Sprintf("/entpc/unit_portrayal_id/%s", idEncode), fmt.Sprintf("/swordfish/page_big_pc/unit_portrayal_id/%s", idEncode)).(string),
+				})
+			}
 		}
 		return buyerList
 	}

+ 1 - 1
src/jfw/front/tags.go

@@ -387,7 +387,7 @@ func (this *Tags) GetIndustry(industryHref string) interface{} {
 	if l := redis.Get("other", rediskey); l != nil {
 		return l
 	} else {
-		data := public.BaseMysql.SelectBySql(`select a.id,a.name,b.id class_id,b.name class_1 from seo_words.seo_industry a left join  seo_words.seo_industry_class b on a.class_1=b.name order by a.class_1`)
+		data := public.BaseMysql.SelectBySql(`select a.id,a.name,b.id class_id,b.name class_1 from seo_words.seo_industry a inner join  seo_words.seo_industry_class b on a.class_1=b.name and  a.class_2 !='药品'  order by a.class_1`)
 		industryArr := []string{}
 		industryMap := map[string][]map[string]interface{}{}
 		if len(*data) > 0 && data != nil {

+ 16 - 1
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -448,9 +448,15 @@ func (this *SubVipPortrait) BuyerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyerName := this.GetString("buyer")
+		//id转中文
+		if len(buyerName) > 0 && len([]rune(buyerName)) == len(buyerName) {
+			//获取中文名字
+			buyerName = getBuyerNameById(util.DecodeId(buyerName))
+		}
 		if buyerName == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
+
 		cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
 		cepm.Session = this.Session()
 		if err != nil {
@@ -507,7 +513,7 @@ func getEntListMsg(ids []string) (dMap map[string]map[string]interface{}) {
 // getBuyerListMsg 获取采购单位基本信息
 func getBuyerListMsg(buyerNames []string) (dMap map[string]map[string]interface{}) {
 	dMap = make(map[string]map[string]interface{})
-	rData := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"buyer_name":["%s"]}}]}},"size":%d,"_source":["buyer_name","city","province","buyerclass"]}`, strings.Join(buyerNames, `","`), len(buyerNames)))
+	rData := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"_id":"%s"}}]}},"size":1,"_source":["name"]}`, strings.Join(buyerNames, `","`)))
 	if rData == nil || len(*rData) == 0 {
 		return
 	}
@@ -529,3 +535,12 @@ func getBuyerListMsg(buyerNames []string) (dMap map[string]map[string]interface{
 	}
 	return
 }
+
+func getBuyerNameById(buyerId string) (buyerName string) {
+	r := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"_id":["%s"]}}]}},"size":1,"_source":["name"]}`, buyerId))
+	if r == nil || len(*r) == 0 {
+		return
+	}
+	buyerName, _ = (*r)[0]["name"].(string)
+	return
+}

+ 4 - 4
src/web/templates/pc/tags/template/area-selector.html

@@ -14,10 +14,10 @@
                             <a class="city-item city" href="{{$vv.url}}" data-c-name="{{$vv.name}}">{{$vv.name}}</a>
                         {{end}}
                     </div>
-                    <div class="city-list-footer" style="display: none">
-                        <button class="action-button confirm">确定</button>
-                        <button class="action-button cancel">取消</button>
-                    </div>
+<!--                    <div class="city-list-footer" style="display: none">-->
+<!--                        <button class="action-button confirm">确定</button>-->
+<!--                        <button class="action-button cancel">取消</button>-->
+<!--                    </div>-->
                 </div>
             </div>
         {{end}}