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/saleChance.go | 30 +++++++++++------------------- 1 files changed, 11 insertions(+), 19 deletions(-) diff --git a/api/v1/saleChance.go b/api/v1/saleChance.go index 791ce98..addf56e 100644 --- a/api/v1/saleChance.go +++ b/api/v1/saleChance.go @@ -33,16 +33,15 @@ ctx.Fail(errCode) return } - if params.CodeRule.Method != 1 { - count, err := model.NewSaleChanceSearch().SetNumber(saleChance.Number).Count() - if err != nil { - ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜楠岃瘉澶辫触") - return - } - if count > 0 { - ctx.FailWithMsg(ecode.UnknownErr, "閿�鍞満浼氱紪鐮佸凡瀛樺湪") - return - } + + count, err := model.NewSaleChanceSearch().SetNumber(saleChance.Number).Count() + if err != nil { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜楠岃瘉澶辫触") + return + } + if count > 0 { + ctx.FailWithMsg(ecode.UnknownErr, "閿�鍞満浼氱紪鐮佸凡瀛樺湪") + return } if saleChance.MemberId == 0 { @@ -56,14 +55,6 @@ if errCode != ecode.OK { ctx.Fail(errCode) return - } - - if params.CodeRule.Method == 1 { - autoCode := model.GetAutoCode(saleChance.Id, ¶ms.CodeRule) - m := map[string]interface{}{ - "number": autoCode, - } - _ = model.NewSaleChanceSearch().SetId(saleChance.Id).UpdateByMap(m) } ctx.Ok() @@ -208,6 +199,7 @@ sc.Address.CountryId = saleChance.Address.CountryId sc.Address.ProvinceId = saleChance.Address.ProvinceId sc.CodeStandID = saleChance.CodeStandID + sc.Products = saleChance.Products return ecode.OK, sc } @@ -234,7 +226,7 @@ if params.SearchMap == nil { params.SearchMap = make(map[string]interface{}, 0) } - params.SearchMap["member_id"] = userInfo.CrmUserId + params.SearchMap["member_ids"] = userInfo.SubUserIds } saleChances, total, errCode := saleChanceService.GetSaleChanceList(params.Page, params.PageSize, params.SearchMap) -- Gitblit v1.8.0