From cc94e1f7427fa598f3e3758650554e97ef957034 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 28 十月 2023 16:53:32 +0800 Subject: [PATCH] 销售线索支持查看下属数据 --- api/v1/contract.go | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/api/v1/contract.go b/api/v1/contract.go index 8041742..5a0dcdd 100644 --- a/api/v1/contract.go +++ b/api/v1/contract.go @@ -35,6 +35,16 @@ return } + count, err := model.NewContractSearch().SetNumber(params.Number).Count() + if err != nil { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜楠岃瘉澶辫触") + return + } + if count > 0 { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜宸插瓨鍦�") + return + } + if contract.MemberId == 0 { userInfo := utils.GetUserInfo(c) if userInfo.UserType == constvar.UserTypeSub { @@ -46,14 +56,6 @@ if errCode != ecode.OK { ctx.Fail(errCode) return - } - - if params.CodeRule.Method == 1 { - autoCode := model.GetAutoCode(contract.Id, ¶ms.CodeRule) - m := map[string]interface{}{ - "number": autoCode, - } - _ = model.NewContractSearch().SetId(contract.Id).UpdateByMap(m) } ctx.Ok() @@ -138,6 +140,7 @@ File: contract.File, CodeStandID: contract.CodeStandID, ContractName: contract.ContractName, + SendTime: contract.SendTime, } return ecode.OK, contractModel -- Gitblit v1.8.0