From 08d858716ad674ebe81e9c11c62c9ec4b6ce8d87 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期四, 17 八月 2023 20:00:45 +0800
Subject: [PATCH] add

---
 service/saleChance.go |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/service/saleChance.go b/service/saleChance.go
index 2c62a4f..1610c07 100644
--- a/service/saleChance.go
+++ b/service/saleChance.go
@@ -15,21 +15,6 @@
 	return ecode.OK
 }
 
-func (SaleChanceService) DeleteSaleChance(id int) int {
-	// check saleChange exist
-	_, err := model.NewSaleChanceSearch().SetId(id).Find()
-	if err != nil {
-		return ecode.SaleChanceNotExist
-	}
-
-	// delete saleChange
-	err = model.NewSaleChanceSearch().SetId(id).Delete()
-	if err != nil {
-		return ecode.SaleChanceDeleteErr
-	}
-	return ecode.OK
-}
-
 func (SaleChanceService) UpdateSaleChance(saleChange *model.SaleChance) int {
 	// update saleChange
 	err := model.NewSaleChanceSearch().SetId(saleChange.Id).Update(saleChange)
@@ -84,3 +69,12 @@
 
 	return ecode.OK
 }
+
+func (SaleChanceService) DeleteSaleChance(ids []int) int {
+	// delete client
+	err := model.NewSaleChanceSearch().SetIds(ids).Delete()
+	if err != nil {
+		return ecode.SaleChanceDeleteErr
+	}
+	return ecode.OK
+}

--
Gitblit v1.8.0