From 530fed8ec225453572d57b15c200ab062c335457 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 01 十一月 2023 19:20:21 +0800 Subject: [PATCH] 公海member_id使用0 --- service/masterOrder.go | 40 ++++++++++++++++++---------------------- 1 files changed, 18 insertions(+), 22 deletions(-) diff --git a/service/masterOrder.go b/service/masterOrder.go index c1255a1..4836e3a 100644 --- a/service/masterOrder.go +++ b/service/masterOrder.go @@ -16,28 +16,6 @@ return ecode.OK } -func (MasterOrderService) DeleteMasterOrder(id int) int { - _, err := model.NewMasterOrderSearch().SetId(id).Find() - if err != nil { - return ecode.MasterOrderNotExist - } - - err = model.NewMasterOrderSearch().SetId(id).Delete() - if err != nil { - return ecode.MasterOrderNotExist - } - return ecode.OK -} - -func (MasterOrderService) GetMasterOrderList() ([]*model.MasterOrder, int) { - list, err := model.NewMasterOrderSearch().FindAll() - if err != nil { - return nil, ecode.MasterOrderListErr - } - - return list, ecode.OK -} - func (MasterOrderService) UpdateMasterOrder(masterOrder *model.MasterOrder) int { // check masterOrder exist _, err := model.NewMasterOrderSearch().SetId(masterOrder.Id).Find() @@ -52,3 +30,21 @@ return ecode.OK } + +func (MasterOrderService) GetMasterOrderList(page, pageSize int, data map[string]interface{}) ([]*model.MasterOrder, int64, int) { + // get contact list + contacts, total, err := model.NewMasterOrderSearch().SetPage(page, pageSize).SetSearchMap(data).FindAll() + if err != nil { + return nil, 0, ecode.MasterOrderListErr + } + return contacts, total, ecode.OK +} + +func (MasterOrderService) DeleteMasterOrder(ids []int) int { + // delete client + err := model.NewMasterOrderSearch().SetIds(ids).Delete() + if err != nil { + return ecode.MasterOrderDeleteErr + } + return ecode.OK +} -- Gitblit v1.8.0