| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (SalesDetailsService) GetSalesDetailsList() ([]*model.SalesDetails, int) { |
| | | list, err := model.NewSalesDetailsSearch().FindAll() |
| | | if err != nil { |
| | | return nil, ecode.SalesDetailsListErr |
| | | } |
| | | |
| | | return list, ecode.OK |
| | | } |
| | | |
| | | func (SalesDetailsService) UpdateSalesDetails(salesDetails *model.SalesDetails) int { |
| | | // check salesDetails exist |
| | | _, err := model.NewSalesDetailsSearch().SetId(salesDetails.Id).Find() |
| | |
| | | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (SalesDetailsService) GetSalesDetailsList(page, pageSize int, keyword string) ([]*model.SalesDetails, int) { |
| | | // get contact list |
| | | contacts, err := model.NewSalesDetailsSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() |
| | | if err != nil { |
| | | return nil, ecode.SalesDetailsListErr |
| | | } |
| | | return contacts, ecode.OK |
| | | } |