فهرست منبع

默认值处理

WH01243 7 ماه پیش
والد
کامیت
70759e8a1f
1فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 13 2
      jyBXCore/rpc/service/operator.go

+ 13 - 2
jyBXCore/rpc/service/operator.go

@@ -287,16 +287,27 @@ func getGetCriteriaType(entId, positionId, tag int64) []map[string]interface{} {
 }
 func getConfiguration(conditionName, conditionType string, entId int64) []map[string]interface{} {
 	data := IC.BiMysql.SelectBySql(`SELECT
-					DISTINCT b.name,b.code
+					DISTINCT b.name,b.element_value
 				FROM
 					customer_data_yys_permissions  a  INNER JOIN   customer_data_yys_permission_elements  b  
 				on  
 					a.ent_id = ?
 					and a.is_delete = 0 
 					AND a.element_name = ?
-				and  FIND_IN_SET( b.code,a.element_value)	
+				and  FIND_IN_SET( b.element_value,a.element_value)	
 				and  b.element_field=?`, entId, conditionName, conditionType)
 	options := []map[string]interface{}{}
+	if data == nil {
+		return options
+	}
+	if len(*data) == 0 {
+		data = IC.BiMysql.SelectBySql(`SELECT
+					DISTINCT name,element_value
+				FROM
+					customer_data_yys_permission_elements  where 
+					ent_id = ?
+				and  element_field=? and  pcode!=""`, entId, conditionType)
+	}
 	if data != nil && len(*data) > 0 {
 		options = append(options, map[string]interface{}{
 			"label": "全部",