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/subOrder.go | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/service/subOrder.go b/service/subOrder.go index 0f23c74..183f8e5 100644 --- a/service/subOrder.go +++ b/service/subOrder.go @@ -16,19 +16,6 @@ return ecode.OK } -func (SubOrderService) DeleteSubOrder(id int) int { - _, err := model.NewSubOrderSearch().SetId(id).Find() - if err != nil { - return ecode.SubOrderNotExist - } - - err = model.NewSubOrderSearch().SetId(id).Delete() - if err != nil { - return ecode.SubOrderNotExist - } - return ecode.OK -} - func (SubOrderService) UpdateSubOrder(subOrder *model.SubOrder) int { // check subOrder exist _, err := model.NewSubOrderSearch().SetId(subOrder.Id).Find() @@ -52,3 +39,12 @@ } return contacts, total, ecode.OK } + +func (SubOrderService) DeleteSubOrder(ids []int) int { + // delete client + err := model.NewSubOrderSearch().SetIds(ids).Delete() + if err != nil { + return ecode.SubOrderDeleteErr + } + return ecode.OK +} -- Gitblit v1.8.0