|
|
@ -66,14 +66,12 @@ func PageEduAssistInfoByDistrictCode(districtCode string, directly string) ([]Sc
|
|
|
|
日期:2020-06-30
|
|
|
|
日期:2020-06-30
|
|
|
|
xxbxlxm -1:全部
|
|
|
|
xxbxlxm -1:全部
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
func PageSchoolInfoByDistrictCode(districtCode string, xxbxlxm string) ([]SchoolModel.School, error) {
|
|
|
|
func PageSchoolInfoByDistrictCode(districtCode string, xxbxlxm string, directly string) ([]SchoolModel.School, error) {
|
|
|
|
enableFlagTerm := elastic.NewTermQuery("enable_flag", 1)
|
|
|
|
enableFlagTerm := elastic.NewTermQuery("enable_flag", 1)
|
|
|
|
delFlagTerm := elastic.NewTermQuery("del_flag", 0)
|
|
|
|
delFlagTerm := elastic.NewTermQuery("del_flag", 0)
|
|
|
|
var districtCodeTerm *elastic.TermQuery
|
|
|
|
var districtCodeTerm *elastic.TermQuery
|
|
|
|
cityFlag := 0
|
|
|
|
|
|
|
|
if strings.HasSuffix(districtCode, "00") { //市
|
|
|
|
if strings.HasSuffix(districtCode, "00") { //市
|
|
|
|
districtCodeTerm = elastic.NewTermQuery("city_code", districtCode)
|
|
|
|
districtCodeTerm = elastic.NewTermQuery("city_code", districtCode)
|
|
|
|
cityFlag = 1
|
|
|
|
|
|
|
|
} else { //区
|
|
|
|
} else { //区
|
|
|
|
districtCodeTerm = elastic.NewTermQuery("district_code", districtCode)
|
|
|
|
districtCodeTerm = elastic.NewTermQuery("district_code", districtCode)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -81,7 +79,7 @@ func PageSchoolInfoByDistrictCode(districtCode string, xxbxlxm string) ([]School
|
|
|
|
orgTypeTerm := elastic.NewTermQuery("data_content.org_type", "2")
|
|
|
|
orgTypeTerm := elastic.NewTermQuery("data_content.org_type", "2")
|
|
|
|
var boolQuery *elastic.BoolQuery
|
|
|
|
var boolQuery *elastic.BoolQuery
|
|
|
|
if xxbxlxm == "-1" {
|
|
|
|
if xxbxlxm == "-1" {
|
|
|
|
if cityFlag == 1 {
|
|
|
|
if directly == "1" {
|
|
|
|
interfaceArr := CommonUtil.ConvertStringArrToInterfaceArr([]string{"360", "811", "821"})
|
|
|
|
interfaceArr := CommonUtil.ConvertStringArrToInterfaceArr([]string{"360", "811", "821"})
|
|
|
|
directlyUnderTypeTerms := elastic.NewTermsQuery("data_content.xxjbzm", interfaceArr...)
|
|
|
|
directlyUnderTypeTerms := elastic.NewTermsQuery("data_content.xxjbzm", interfaceArr...)
|
|
|
|
boolQuery = elastic.NewBoolQuery().Must(enableFlagTerm, delFlagTerm, districtCodeTerm, orgTypeTerm, directlyUnderTypeTerms)
|
|
|
|
boolQuery = elastic.NewBoolQuery().Must(enableFlagTerm, delFlagTerm, districtCodeTerm, orgTypeTerm, directlyUnderTypeTerms)
|
|
|
@ -91,7 +89,7 @@ func PageSchoolInfoByDistrictCode(districtCode string, xxbxlxm string) ([]School
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
xxbxlxmTerm := elastic.NewTermQuery("school_type", xxbxlxm)
|
|
|
|
xxbxlxmTerm := elastic.NewTermQuery("school_type", xxbxlxm)
|
|
|
|
if cityFlag == 1 {
|
|
|
|
if directly == "1" {
|
|
|
|
interfaceArr := CommonUtil.ConvertStringArrToInterfaceArr([]string{"360", "811", "821"})
|
|
|
|
interfaceArr := CommonUtil.ConvertStringArrToInterfaceArr([]string{"360", "811", "821"})
|
|
|
|
directlyUnderTypeTerms := elastic.NewTermsQuery("data_content.xxjbzm", interfaceArr...)
|
|
|
|
directlyUnderTypeTerms := elastic.NewTermsQuery("data_content.xxjbzm", interfaceArr...)
|
|
|
|
boolQuery = elastic.NewBoolQuery().Must(enableFlagTerm, delFlagTerm, districtCodeTerm, orgTypeTerm, xxbxlxmTerm, directlyUnderTypeTerms)
|
|
|
|
boolQuery = elastic.NewBoolQuery().Must(enableFlagTerm, delFlagTerm, districtCodeTerm, orgTypeTerm, xxbxlxmTerm, directlyUnderTypeTerms)
|
|
|
|