zhangqian
2023-10-28 05582688724c78bc70a7bc860193c67677f6c8cf
api/v1/saleChance.go
@@ -33,7 +33,7 @@
      ctx.Fail(errCode)
      return
   }
   if params.CodeRule.Method != 1 {
      count, err := model.NewSaleChanceSearch().SetNumber(saleChance.Number).Count()
      if err != nil {
         ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败")
@@ -42,7 +42,6 @@
      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, &params.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
}