From 5dbc6216fa75459f3af5c0ba7736ec3ec8ad7a0e Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期四, 17 八月 2023 09:34:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
service/saleChance.go | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/service/saleChance.go b/service/saleChance.go
index 03b01c3..2c62a4f 100644
--- a/service/saleChance.go
+++ b/service/saleChance.go
@@ -54,11 +54,33 @@
return ecode.OK
}
-func (SaleChanceService) GetSaleChanceList(page, pageSize int, keyword string) ([]*model.SaleChance, int) {
+func (SaleChanceService) GetSaleChanceList(page, pageSize int, data map[string]interface{}) ([]*model.SaleChance, int64, int) {
// get contact list
- contacts, err := model.NewSaleChanceSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll()
+ contacts, total, err := model.NewSaleChanceSearch().SetPage(page, pageSize).SetSearchMap(data).FindAll()
if err != nil {
- return nil, ecode.SaleChanceListErr
+ return nil, 0, ecode.SaleChanceListErr
}
- return contacts, ecode.OK
+ return contacts, total, ecode.OK
+}
+
+// push
+func (SaleChanceService) PushSaleChance(id, step int) int {
+ // check saleChange exist
+ errCode := CheckSaleChangeExist(id)
+ if errCode != ecode.OK {
+ return errCode
+ }
+ // check step
+ _, err := model.NewSaleStageSearch().SetId(step).Find()
+ if err != nil {
+ return ecode.SaleStageNotExist
+ }
+
+ // push saleChange
+ err = model.NewSaleChanceSearch().SetId(id).Update(&model.SaleChance{SaleStageId: step})
+ if err != nil {
+ return ecode.SaleChanceUpdateErr
+ }
+
+ return ecode.OK
}
--
Gitblit v1.8.0