| | |
| | | } |
| | | return contacts, total, ecode.OK |
| | | } |
| | | |
| | | // push |
| | | func (SaleChanceService) PushSaleChance(id, step int) int { |
| | | // check saleChange exist |
| | | errCode := CheckSaleChangeExist(id) |
| | | if errCode != ecode.OK { |
| | | return errCode |
| | | } |
| | | // check step |
| | | _, err := model.NewSaleStageSearch().SetId(step).Find() |
| | | if err != nil { |
| | | return ecode.SaleStageNotExist |
| | | } |
| | | |
| | | // push saleChange |
| | | err = model.NewSaleChanceSearch().SetId(id).Update(&model.SaleChance{SaleStageId: step}) |
| | | if err != nil { |
| | | return ecode.SaleChanceUpdateErr |
| | | } |
| | | |
| | | return ecode.OK |
| | | } |