Browse Source

feat:增加方法

wangchuanjin 1 năm trước cách đây
mục cha
commit
1e99dc18cf
1 tập tin đã thay đổi với 4 bổ sung7 xóa
  1. 4 7
      service/operate.go

+ 4 - 7
service/operate.go

@@ -1,12 +1,13 @@
 package service
 
 import (
-	. "bp.jydev.jianyu360.cn/BaseService/biService/entity"
 	"bytes"
 	"encoding/json"
 	"io/ioutil"
 	"log"
 	"net/http"
+
+	. "bp.jydev.jianyu360.cn/BaseService/biService/entity"
 )
 
 type Operate struct {
@@ -32,12 +33,8 @@ func (a *Operate) InfoOperate() bool {
 		}
 		sendParam["nid"] = a.NewId
 	} else {
-		//删除
-		//清除mysql数据
-		if BiService.Delete("customer_data_ttzl", map[string]interface{}{"id_new": a.NewId}) {
-			//清除es数据
-			Es.DelById("ttbid", "ttbid", a.NewId)
-		} else {
+		//清除es数据 清除mysql数据
+		if !DelById("ttbid", a.NewId) || !BiService.Delete("customer_data_ttzl", map[string]interface{}{"id_new": a.NewId}) {
 			return false
 		}
 		projectId := (*data)["projectId"]