From 2f0aa60ce2e10be53d9c865a6177bf731e182203 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期四, 17 八月 2023 11:15:41 +0800
Subject: [PATCH] fix
---
service/contract.go | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/service/contract.go b/service/contract.go
index 58cb8e0..b966dce 100644
--- a/service/contract.go
+++ b/service/contract.go
@@ -29,15 +29,6 @@
return ecode.OK
}
-func (ContractService) GetContractList() ([]*model.Contract, int) {
- list, err := model.NewContractSearch().FindAll()
- if err != nil {
- return nil, ecode.ContractListErr
- }
-
- return list, ecode.OK
-}
-
func (ContractService) UpdateContract(contract *model.Contract) int {
// check contract exist
_, err := model.NewContractSearch().SetId(contract.Id).Find()
@@ -52,3 +43,12 @@
return ecode.OK
}
+
+func (ContractService) GetContractList(page, pageSize int, data map[string]interface{}) ([]*model.Contract, int64, int) {
+ // get contact list
+ contacts, total, err := model.NewContractSearch().SetPage(page, pageSize).SetSearchMap(data).FindAll()
+ if err != nil {
+ return nil, 0, ecode.ContractListErr
+ }
+ return contacts, total, ecode.OK
+}
--
Gitblit v1.8.0