| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewFollowRecordSearch().SetNumber(followRecord.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if followRecord.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | | followRecord.MemberId = userInfo.CrmUserId |
| | | } |
| | | } |
| | | |
| | | errCode = followRecordService.AddFollowRecord(followRecord) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | |
| | | followRecordModel.Purpose = followRecord.Purpose |
| | | followRecordModel.Content = followRecord.Content |
| | | followRecordModel.Record = followRecord.Record |
| | | followRecordModel.CodeStandID = followRecord.CodeStandID |
| | | |
| | | return ecode.OK, &followRecordModel |
| | | } |
| | |
| | | if params.SearchMap == nil { |
| | | params.SearchMap = make(map[string]interface{}, 0) |
| | | } |
| | | params.SearchMap["member_id"] = userInfo.CrmUserId |
| | | params.SearchMap["member_ids"] = userInfo.SubUserIds |
| | | } |
| | | |
| | | followRecords, total, errCode := followRecordService.GetFollowRecordList(params.Page, params.PageSize, params.SearchMap) |