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/serviceOrder.go |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/service/serviceOrder.go b/service/serviceOrder.go
index 8de6e57..c7e30a7 100644
--- a/service/serviceOrder.go
+++ b/service/serviceOrder.go
@@ -30,7 +30,15 @@
 	return ecode.OK
 }
 
-func (ServiceOrderService) GetServiceOrderList(page, pageSize int, queryClass constvar.ServiceOrderQueryClass, keywordType constvar.ServiceOrderKeywordType, keyword string, serviceContractId, salesDetailsId int) ([]*model.ServiceOrder, int64, int) {
+func (ServiceOrderService) BatchDeleteServiceOrder(ids []int) int {
+	err := model.NewServiceOrderSearch().DeleteByIds(ids)
+	if err != nil {
+		return ecode.DBErr
+	}
+	return ecode.OK
+}
+
+func (ServiceOrderService) GetServiceOrderList(page, pageSize int, queryClass constvar.ServiceOrderQueryClass, keywordType constvar.ServiceOrderKeywordType, keyword string, serviceContractId, salesDetailsId int, memberIds []int) ([]*model.ServiceOrder, int64, int) {
 	list, total, err := model.NewServiceOrderSearch().
 		SetPage(page, pageSize).
 		SetKeyword(keyword).
@@ -39,6 +47,8 @@
 		SetPreload(true).
 		SetServiceContractId(serviceContractId).
 		SetSalesDetailsId(salesDetailsId).
+		SetMemberIds(memberIds).
+		SetOrder("created_at desc").
 		Find()
 	if err != nil {
 		return nil, 0, ecode.DBErr
@@ -65,7 +75,7 @@
 }
 
 func (ServiceOrderService) UpdateServiceOrder(serviceOrder *model.ServiceOrder) int {
-	err := model.NewServiceOrderSearch().SetId(serviceOrder.Id).Save(serviceOrder)
+	err := model.NewServiceOrderSearch().SetId(serviceOrder.Id).Updates(serviceOrder)
 	if err != nil {
 		return ecode.DBErr
 	}

--
Gitblit v1.8.0