| | |
| | | return contacts, total, ecode.OK |
| | | } |
| | | |
| | | func (ClientService) Assign(id, memberId int) int { |
| | | func (ClientService) Assign(ids []int, memberId int) int { |
| | | // check client exist |
| | | errCode := CheckClientExist(id) |
| | | if errCode != ecode.OK { |
| | | return errCode |
| | | } |
| | | //errCode := CheckClientExist(id) |
| | | //if errCode != ecode.OK { |
| | | // return errCode |
| | | //} |
| | | |
| | | // assign client |
| | | err := model.NewClientSearch(nil).SetId(id).UpdateByMap(map[string]interface{}{ |
| | | err := model.NewClientSearch(nil).SetIds(ids).UpdateByMap(map[string]interface{}{ |
| | | "member_id": memberId, |
| | | }) |
| | | if err != nil { |