From d4bf53dd19a45ef09a367babcf7a2ac04ae1d08f Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期二, 17 十月 2023 14:31:31 +0800 Subject: [PATCH] bug修改 --- api/v1/salesReturn.go | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/api/v1/salesReturn.go b/api/v1/salesReturn.go index ab99f0c..bf1fdbd 100644 --- a/api/v1/salesReturn.go +++ b/api/v1/salesReturn.go @@ -1,12 +1,14 @@ 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/pkg/structx" + "aps_crm/utils" "github.com/gin-gonic/gin" "strconv" "strings" @@ -33,6 +35,13 @@ if errCode != ecode.OK { ctx.Fail(errCode) return + } + + if salesReturn.MemberId == 0 { + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + salesReturn.MemberId = userInfo.CrmUserId + } } errCode = salesReturnService.AddSalesReturn(&salesReturn) @@ -165,7 +174,13 @@ return } - salesReturns, total, errCode := salesReturnService.GetSalesReturnList(params) + var memberIds []int + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + memberIds = []int{userInfo.CrmUserId} + } + + salesReturns, total, errCode := salesReturnService.GetSalesReturnList(params, memberIds) if errCode != ecode.OK { ctx.Fail(errCode) return -- Gitblit v1.8.0