Explorar o código

Merge branch 'dev_v1.1.63_wh' of BaseService/jyMicroservices into feature/v1.1.63

王浩 hai 7 meses
pai
achega
d539b2ff8d
Modificáronse 1 ficheiros con 9 adicións e 8 borrados
  1. 9 8
      jyBXCore/rpc/service/operator.go

+ 9 - 8
jyBXCore/rpc/service/operator.go

@@ -122,7 +122,7 @@ func getGetCriteriaType(entId, positionId, tag int64) []map[string]interface{} {
 			configName := gconv.String(v["config_name"])
 			switch configName {
 			case "行业":
-				industryArr, _ := getConfiguration("行业", "industry", entId)
+				industryArr, _ := getConfiguration("行业", "industry", entId, positionId)
 				if len(industryArr) > 0 {
 					data = append(data, map[string]interface{}{
 						"key":        "industry",
@@ -137,7 +137,7 @@ func getGetCriteriaType(entId, positionId, tag int64) []map[string]interface{} {
 				}
 
 			case "中标人标签":
-				winnerArr, _ := getConfiguration("运营商中标标签", "winner_tag", entId)
+				winnerArr, _ := getConfiguration("运营商中标标签", "winner_tag", entId, positionId)
 				if len(winnerArr) > 0 {
 					data = append(data, map[string]interface{}{
 						"key":        "winnerTag",
@@ -288,18 +288,19 @@ func getGetCriteriaType(entId, positionId, tag int64) []map[string]interface{} {
 	}
 	return data
 }
-func getConfiguration(conditionName, conditionType string, entId int64) ([]map[string]interface{}, map[string]interface{}) {
+func getConfiguration(conditionName, conditionType string, entId int64, positionId int64) ([]map[string]interface{}, map[string]interface{}) {
 	dataMap := make(map[string]interface{})
 	data := IC.BiMysql.SelectBySql(`SELECT
 					DISTINCT b.name,b.element_value as code
 				FROM
 					customer_data_yys_permissions  a  INNER JOIN   customer_data_yys_permission_elements  b  
 				on  
-					a.ent_id = ?
+				    a.position_id=?
+					and a.ent_id = ?
 					and a.is_delete = 0 
 					AND a.element_name = ?
 				and  FIND_IN_SET( b.element_value,a.element_value)	
-				and  b.element_field=? order by  code `, entId, conditionName, conditionType)
+				and  b.element_field=?  order by  code `, positionId, entId, conditionName, conditionType)
 	options := []map[string]interface{}{}
 	if data == nil {
 		return options, dataMap
@@ -859,8 +860,8 @@ func SearchList(operator Operator) (int64, *[]map[string]interface{}, int64) {
 		data = IC.BiMysql.SelectBySql(sqlStr,
 			idArr...)
 		if data != nil && len(*data) > 0 {
-			_, winnerMap := getConfiguration("运营商中标标签", "winner_tag", operator.EntId)
-			_, industryMap := getConfiguration("行业", "industry", operator.EntId)
+			_, winnerMap := getConfiguration("运营商中标标签", "winner_tag", operator.EntId, operator.PositionId)
+			_, industryMap := getConfiguration("行业", "industry", operator.EntId, operator.PositionId)
 			fileArr := &[]map[string]interface{}{}
 			if operator.Tag == 0 {
 				fileArr = IC.BiMysql.SelectBySql("select   * from   field_order       ")
@@ -880,7 +881,7 @@ func SearchList(operator Operator) (int64, *[]map[string]interface{}, int64) {
 					key := gconv.String(m["file"])
 					newData[key] = v[key]
 				}
-				v["infoid"] = ME.EncodeArticleId2ByCheck(gconv.String(v["infoid"]))
+				newData["infoid"] = ME.EncodeArticleId2ByCheck(gconv.String(v["infoid"]))
 				(*data)[i] = newData
 			}
 		}