| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (SContractService) GetServiceContractByContractId(contractId int) ([]*model.ServiceContract, int) { |
| | | list, err := model.NewServiceContractSearch().SetId(contractId).FindAll() |
| | | if err != nil { |
| | | return nil, ecode.SContractListErr |
| | | } |
| | | //func (SContractService) GetServiceContractByContractId(contractId int) ([]*model.ServiceContract, int) { |
| | | // list, err := model.NewServiceContractSearch().SetId(contractId).FindAll() |
| | | // if err != nil { |
| | | // return nil, ecode.SContractListErr |
| | | // } |
| | | // |
| | | // return list, ecode.OK |
| | | //} |
| | | |
| | | return list, ecode.OK |
| | | } |
| | | |
| | | func (SContractService) GetServiceContractList(page, pageSize int, keyword string) ([]*model.ServiceContract, int) { |
| | | func (SContractService) GetServiceContractList(page, pageSize int, keyword string) ([]*model.ServiceContract, int64, int) { |
| | | // get contact list |
| | | contacts, err := model.NewServiceContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() |
| | | contacts, total, err := model.NewServiceContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() |
| | | if err != nil { |
| | | return nil, ecode.SContractListErr |
| | | return nil, 0, ecode.SContractListErr |
| | | } |
| | | return contacts, ecode.OK |
| | | return contacts, total, ecode.OK |
| | | } |