| | |
| | | package service
|
| | |
|
| | | import (
|
| | | "aps_crm/constvar" |
| | | "aps_crm/model"
|
| | | "aps_crm/pkg/ecode"
|
| | | )
|
| | |
| | | // return list, ecode.OK
|
| | | //}
|
| | |
|
| | | func (SContractService) GetServiceContractList(page, pageSize int, keyword string) ([]*model.ServiceContract, int64, int) {
|
| | | // get contact list
|
| | | contacts, total, err := model.NewServiceContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll()
|
| | | if err != nil {
|
| | | return nil, 0, ecode.SContractListErr
|
| | | }
|
| | | return contacts, total, ecode.OK
|
| | | }
|
| | |
|
| | | func (SContractService) DeleteServiceContract(ids []int) int {
|
| | | // delete client
|
| | | err := model.NewServiceContractSearch().SetIds(ids).Delete()
|
| | |
| | | }
|
| | | return ecode.OK
|
| | | }
|
| | | |
| | | func (SContractService) GetServiceContractList(page, pageSize int, queryClass constvar.ServiceContractQueryClass, keywordType constvar.ServiceContractKeywordType, keyword string) ([]*model.ServiceContract, int64, int) { |
| | | // get contact list |
| | | contacts, total, err := model.NewServiceContractSearch(). |
| | | SetKeyword(keyword). |
| | | SetKeywordType(keywordType). |
| | | SetQueryClass(queryClass). |
| | | SetPage(page, pageSize).FindAll() |
| | | if err != nil { |
| | | return nil, 0, ecode.SContractListErr |
| | | } |
| | | return contacts, total, ecode.OK |
| | | } |