| | |
| | | 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). |
| | |
| | | SetPreload(true). |
| | | SetServiceContractId(serviceContractId). |
| | | SetSalesDetailsId(salesDetailsId). |
| | | SetMemberIds(memberIds). |
| | | SetOrder("created_at desc"). |
| | | Find() |
| | | if err != nil { |
| | | return nil, 0, ecode.DBErr |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |