| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (ContractService) GetContractList(page, pageSize int, data map[string]interface{}) ([]*model.Contract, int64, int) { |
| | | func (ContractService) GetContractList(page, pageSize int, data map[string]interface{}, keyword string) ([]*model.Contract, int64, int) { |
| | | // get contact list |
| | | contacts, total, err := model.NewContractSearch().SetPage(page, pageSize).SetSearchMap(data).FindAll() |
| | | contacts, total, err := model.NewContractSearch().SetPage(page, pageSize).SetSearchMap(data).SetKeyword(keyword).FindAll() |
| | | if err != nil { |
| | | return nil, 0, ecode.ContractListErr |
| | | } |
| | | return contacts, total, ecode.OK |
| | | } |
| | | |
| | | func (ContractService) DeleteContract(ids []int) int { |
| | | func (ContractService) DeleteContract(id int) int { |
| | | // delete client |
| | | err := model.NewContractSearch().SetIds(ids).Delete() |
| | | err := model.NewContractSearch().SetId(id).Delete() |
| | | if err != nil { |
| | | return ecode.ContractDeleteErr |
| | | } |