| | |
| | | } |
| | | |
| | | func (SalesDetailsService) DeleteSalesDetails(id int) int { |
| | | _, err := model.NewSalesDetailsSearch().SetId(id).Find() |
| | | _, err := model.NewSalesDetailsSearch().SetId(id).First() |
| | | if err != nil { |
| | | return ecode.SalesDetailsNotExist |
| | | } |
| | |
| | | |
| | | func (SalesDetailsService) UpdateSalesDetails(salesDetails *model.SalesDetails) int { |
| | | // check salesDetails exist |
| | | _, err := model.NewSalesDetailsSearch().SetId(salesDetails.Id).Find() |
| | | _, err := model.NewSalesDetailsSearch().SetId(salesDetails.Id).First() |
| | | if err != nil { |
| | | return ecode.SalesDetailsNotExist |
| | | } |