浏览代码

默认值处理

WH01243 7 月之前
父节点
当前提交
29fd0af197
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      jyBXCore/rpc/service/operator.go

+ 7 - 1
jyBXCore/rpc/service/operator.go

@@ -349,6 +349,12 @@ func getLabel(entId int64) []map[string]interface{} {
 			} else {
 				// 处理二级和三级标签
 				if _, exists := labels[pid]; exists {
+					if len(labelOptions[pid]) == 0 {
+						labelOptions[pid] = append(labelOptions[pid], map[string]interface{}{
+							"label": 全部,
+							"value": "",
+						})
+					}
 					labelOptions[pid] = append(labelOptions[pid], map[string]interface{}{
 						"label": name,
 						"value": name,
@@ -512,7 +518,7 @@ func SearchList(operator Operator) (int64, *[]map[string]interface{}) {
 	//must处理
 	//filter处理
 	if operator.Tag == 1 {
-		mustArr = append(mustArr, `{"match":{"subtype":"采购意向"}}`)
+		filterArr = append(filterArr, `{"match":{"toptype":"采购意向"}}`)
 		operator.TopType = ""
 	} else if operator.Tag == 2 {
 		mustArr = append(mustArr, `{"exists":{"field":"price"}}`)