From 663db1dd160e759c9401289554543b1d1ea1e5cb Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 05 八月 2023 12:17:17 +0800 Subject: [PATCH] 服务单管理故障类别增删改查,服务单管理花费时间增删改查,增加服务方式、花费时间、严重程度、优先级别初始化数据 --- service/serviceOrder.go | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/service/serviceOrder.go b/service/serviceOrder.go index 2c2e80d..60a6d5f 100644 --- a/service/serviceOrder.go +++ b/service/serviceOrder.go @@ -30,7 +30,7 @@ } func (ServiceOrderService) GetServiceOrderList() ([]*model.ServiceOrder, int64, int) { - list, total, err := model.NewServiceOrderSearch().Find() + list, total, err := model.NewServiceOrderSearch().SetPreload(true).Find() if err != nil { return nil, 0, ecode.DBErr } @@ -46,9 +46,7 @@ return ecode.DBErr } - err = model.NewServiceOrderSearch().SetId(v.Id).Updates(map[string]interface{}{ - - }) + err = model.NewServiceOrderSearch().SetId(v.Id).Updates(map[string]interface{}{}) if err != nil { return ecode.DBErr } @@ -58,9 +56,9 @@ } func (ServiceOrderService) UpdateServiceOrder(serviceOrder *model.ServiceOrder) int { - err := model.NewServiceOrderSearch().Save(serviceOrder) - if err != nil { - return ecode.DBErr - } + err := model.NewServiceOrderSearch().Save(serviceOrder) + if err != nil { + return ecode.DBErr + } return ecode.OK } -- Gitblit v1.8.0