fuwencai 2 жил өмнө
parent
commit
ff61b469d3

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

@@ -129,7 +129,7 @@ func GetHotCache(redisKey string) (list []*BuyerList, err error) {
 // identityType : 0 采购单位 1-中标单位
 // limit: 数量
 func getEntBaseInfo(identityType, limit int) *[]map[string]interface{} {
-	q := "SELECT  company_id AS id,name FROM   dws_f_ent_baseinfo WHERE     company_id !='' and company_id is not null  AND (identity_type &(1 << ?)) > 0 order by latest_time desc  limit ?"
+	q := "SELECT  company_id AS id,name,name_id  FROM   dws_f_ent_baseinfo WHERE     company_id !='' and company_id is not null  AND (identity_type &(1 << ?)) > 0 order by latest_time desc  limit ?"
 	return public.GlobalCommonMysql.SelectBySql(q, identityType, limit)
 
 }
@@ -359,7 +359,7 @@ func HotBuyerList(entIsNew bool) []*BuyerList {
 	var buyerList []*BuyerList
 	for _, b := range *data {
 		name := qu.ObjToString(b["name"])
-		buyerId := qu.ObjToString(b["id"])
+		buyerId := qu.ObjToString(b["name_id"])
 		if name != "" && buyerId != "" {
 			idEncode := encrypt.EncodeArticleId2ByCheck(buyerId)
 			buyerList = append(buyerList, &BuyerList{

+ 3 - 4
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -572,10 +572,9 @@ func getBuyerListMsg(buyerNames []string) (dMap map[string]map[string]interface{
 }
 
 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
+	rs := db.MysqlGloabl.SelectBySql(`SELECT name  FROM dws_f_ent_baseinfo where name_id=? and (identity_type &(1 << 0)) > 0 limit 1`, buyerId)
+	if rs != nil && len(*rs) > 0 {
+		return qutil.InterfaceToStr((*rs)[0]["name"])
 	}
-	buyerName, _ = (*r)[0]["name"].(string)
 	return
 }