From 530fed8ec225453572d57b15c200ab062c335457 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 01 十一月 2023 19:20:21 +0800 Subject: [PATCH] 公海member_id使用0 --- api/v1/contact.go | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/api/v1/contact.go b/api/v1/contact.go index 1a72e6b..97068ca 100644 --- a/api/v1/contact.go +++ b/api/v1/contact.go @@ -34,11 +34,25 @@ return } + if params.MemberId == 0 { + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + params.MemberId = userInfo.CrmUserId + } + } + errCode = contactService.AddContact(&contact) if errCode != ecode.OK { ctx.Fail(errCode) return } + //if params.CodeRule.Method == 1 { + // autoCode := model.GetAutoCode(contact.Id, ¶ms.CodeRule) + // m := map[string]interface{}{ + // "number": autoCode, + // } + // _ = model.NewContactSearch(nil).SetId(contact.Id).UpdateByMap(m) + //} ctx.Ok() } @@ -143,6 +157,7 @@ contact.Birthday = t contact.Wechat = params.Wechat contact.IsFirst = params.IsFirst + //contact.CodeStandID = params.CodeStandID return ecode.OK, contact } @@ -166,10 +181,10 @@ if params.SearchMap == nil { params.SearchMap = make(map[string]interface{}, 0) } - params.SearchMap["member_id"] = userInfo.CrmUserId + params.SearchMap["member_ids"] = userInfo.SubUserIds } - contacts, total, errCode := contactService.GetContactList(params.Page, params.PageSize, params.SearchMap) + contacts, total, errCode := contactService.GetContactList(params.Page, params.PageSize, params.SearchMap, params.ClientId) if errCode != ecode.OK { ctx.Fail(errCode) return -- Gitblit v1.8.0