From 581cb45bb6a5cb928dfa920abf9c51652aae2da5 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期五, 13 十月 2023 16:39:27 +0800 Subject: [PATCH] 接口白名单 --- api/v1/masterOrder.go | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/api/v1/masterOrder.go b/api/v1/masterOrder.go index c72c089..246e9b8 100644 --- a/api/v1/masterOrder.go +++ b/api/v1/masterOrder.go @@ -1,11 +1,13 @@ package v1 import ( + "aps_crm/constvar" "aps_crm/model" "aps_crm/model/request" "aps_crm/model/response" "aps_crm/pkg/contextx" "aps_crm/pkg/ecode" + "aps_crm/utils" "github.com/gin-gonic/gin" ) @@ -43,7 +45,7 @@ m := map[string]interface{}{ "number": autoCode, } - _ = model.NewContactSearch(nil).SetId(masterOrder.Id).UpdateByMap(m) + _ = model.NewMasterOrderSearch().SetId(masterOrder.Id).UpdateByMap(m) } ctx.Ok() @@ -152,6 +154,14 @@ return } + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + if params.SearchMap == nil { + params.SearchMap = make(map[string]interface{}, 0) + } + params.SearchMap["member_id"] = userInfo.CrmUserId + } + masterOrders, total, errCode := masterOrderService.GetMasterOrderList(params.Page, params.PageSize, params.SearchMap) if errCode != ecode.OK { ctx.Fail(errCode) -- Gitblit v1.8.0