Bläddra i källkod

fix:pdf权益回收判断是否存在可使用权益

duxin 1 månad sedan
förälder
incheckning
1aec46b364
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4 4
      entbase/src/service/person/person.go

+ 4 - 4
entbase/src/service/person/person.go

@@ -536,7 +536,7 @@ func (a *Action) Del() {
 	}
 	//回收pdf权益
 	entId := qutil.IntAll(a.GetSession("entId"))
-	go PdfRecycle(id, entId)
+	PdfRecycle(id, entId)
 	if VarUser.Del(frameworkEntId, id) {
 		status = 1
 	}
@@ -544,14 +544,14 @@ func (a *Action) Del() {
 }
 
 func PdfRecycle(ids string, entId int) {
-	log.Println("PdfRecycle===", ids, entId)
-	phones := Mysql.SelectBySql(`SELECT a.phone FROM entniche_user a  WHERE a.id in (?)`, ids)
+	phones := Mysql.SelectBySql(`SELECT a.id,a.phone FROM entniche_user a  WHERE a.id in (?)`, ids)
+	log.Println("PdfRecycle===", ids, entId, phones)
 	if phones != nil && len(*phones) > 0 {
 		var ps []string
 		for _, m := range *phones {
 			ps = append(ps, fmt.Sprintf(`"%s"`, qutil.InterfaceToStr(m["phone"])))
 		}
-		data := Base.SelectBySql("SELECT c.id AS positionId FROM base_user a INNER JOIN base_position c ON a.id = c.user_id WHERE c.ent_id = ? and  a.phone in (?)", entId, strings.Join(ps, ","))
+		data := Base.SelectBySql(fmt.Sprintf("SELECT c.id AS positionId FROM base_user a INNER JOIN base_position c ON a.id = c.user_id WHERE c.ent_id = %d and  a.phone in (%s)", entId, strings.Join(ps, ",")))
 		if data != nil && len(*data) > 0 {
 			for _, m := range *data {
 				positionId := qutil.InterfaceToStr(m["positionId"])