xuzhiheng 5 năm trước cách đây
mục cha
commit
039999a253
3 tập tin đã thay đổi với 24 bổ sung19 xóa
  1. 12 9
      src/history/util_history.go
  2. 12 10
      src/util/config.go
  3. BIN
      src/web/res/fields.xlsx

+ 12 - 9
src/history/util_history.go

@@ -534,16 +534,19 @@ func SearchEnterpriseInfo(tmp map[string]interface{}) {
 				tmp["company_address"] = company_address
 			}
 			//注册资金"capital" : "324 万","capital" : 124.8,
-			if capital := qu.ObjToString(data["capital"]); capital != "" {
-				tmp["capital"] = capital
-				//if capitalStr, ok := data["capital"].(string); ok && capitalStr != "" {
-				//	if capital := ObjToMoney(capitalStr); capital != 0 { //金额转换
-				//		tmp["capital"] = capital
-				//	}
-				//} else if capitalFloat, ok := data["capital"].(float64); ok && capitalFloat != 0 {
-				//	tmp["capital"] = capitalFloat
-				//}
+			if data["capital"] != nil {
+				tmp["capital"] = qu.Float64All(data["capital"])
 			}
+			// if capital := qu.Float64All(data["capital"]); capital != "" {
+			// 	tmp["capital"] = capital
+			// if capitalStr, ok := data["capital"].(string); ok && capitalStr != "" {
+			// 	if capital := ObjToMoney(capitalStr); capital != 0 { //金额转换
+			// 		tmp["capital"] = capital
+			// 	}
+			// } else if capitalFloat, ok := data["capital"].(float64); ok && capitalFloat != 0 {
+			// 	tmp["capital"] = capitalFloat
+			// }
+			// }
 			//注册时间"establish_date" : ISODate("1949-10-01T00:00:00.000+0000")
 			if establish_date := qu.ObjToString(data["establish_date"]); establish_date != "" {
 				tmp["establish_date"] = establish_date

+ 12 - 10
src/util/config.go

@@ -111,18 +111,20 @@ func initCitys() {
 	for _, data := range *datas {
 		brief := data["brief"].(string)
 		Province = append(Province, brief)
-		citys := data["citys"].([]interface{})
-		citytmp := []string{}
-		for _, city := range citys {
-			cityMap := city.(map[string]interface{})
-			for cname, districts := range cityMap {
-				citytmp = append(citytmp, cname)
-				tmp := districts.([]interface{})
-				districtarr := qu.ObjArrToStringArr(tmp)
-				CityDistricts[cname] = districtarr
+		if data["citys"] != nil {
+			citys := data["citys"].([]interface{})
+			citytmp := []string{}
+			for _, city := range citys {
+				cityMap := city.(map[string]interface{})
+				for cname, districts := range cityMap {
+					citytmp = append(citytmp, cname)
+					tmp := districts.([]interface{})
+					districtarr := qu.ObjArrToStringArr(tmp)
+					CityDistricts[cname] = districtarr
+				}
 			}
+			ProvinceCitys[brief] = citytmp
 		}
-		ProvinceCitys[brief] = citytmp
 	}
 }
 

BIN
src/web/res/fields.xlsx