sunty
2019-07-31 0d3258816045980d68d1b695106501026f424944
controllers/taglist.go
@@ -33,11 +33,12 @@
   sources := make([]map[string]interface{}, 0)
   for _, value := range tokenRes["datalist"].([]interface{}) {
      tokenRes := make(map[string]interface{})
      key := value.(map[string]interface{})["id"].(string)
      tr := value.(map[string]interface{})
      key := tr["id"].(string)
      tokenRes["key"] = key
      tokenRes["title"] = value.(map[string]interface{})["tableName"].(string)
      tokenRes["value"] = value.(map[string]interface{})["id"].(string)
      status := int(value.(map[string]interface{})["isDelete"].(float64))
      tokenRes["title"] = tr["tableName"].(string)
      tokenRes["value"] = tr["id"].(string)
      status := int(tr["isDelete"].(float64))
      tokenRes["status"] = status
      if status == 1 {
         if GetTotalFromDb(key) == false {
@@ -53,7 +54,7 @@
func GetTotalFromDb(id string) (flag bool) {
   flag = false
   url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
      "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search"
      "/" + config.EsInfo.EsIndex.VideoPersons.IndexName + "/_search"
   prama := "{\"query\":{\"bool\":{\"filter\":[{\"term\":{\"baseInfo.tableId\":\"" + id + "\"}}]}},\"size\":0}"
   buf, err := esutil.EsReq("POST", url, []byte(prama))
   if err != nil {
@@ -72,6 +73,7 @@
      fmt.Println("first hits change error!")
      return
   }
   total := int(middle["total"].(float64))
   if total > 0 {
      flag = true