Browse Source

编辑图片 名称校验

gmy 2 tuần trước cách đây
mục cha
commit
df2b165f9d
2 tập tin đã thay đổi với 1 bổ sung38 xóa
  1. 1 1
      controllers/image_conf_controller.go
  2. 0 37
      controllers/ppt_v2.go

+ 1 - 1
controllers/image_conf_controller.go

@@ -215,7 +215,7 @@ func (this *ImageConfController) EditImageMaterial() {
 	if err != nil {
 		return
 	}
-	if imageConfByName != nil {
+	if imageConfByName != nil && imageConfByName.ImageConfId != req.ImageConfId {
 		br.Msg = "图片名称已存在,请重新上传!"
 		br.ErrMsg = "图片名称已存在,请重新上传!"
 		return

+ 0 - 37
controllers/ppt_v2.go

@@ -409,43 +409,6 @@ func (this *PptV2Controller) DetailPpt() {
 			hasAuth = true
 		}
 	}
-
-	var condition string
-	var pars []interface{}
-
-	// 维护封底 背景图 前端懒 不愿意再查 让我这边返 这块后期素材多了 可能会调整复杂
-	if pptInfo.CurrentBackgroundImg != "" {
-		condition += ` conf_type=? `
-		pars = append(pars, 1)
-
-		condition += ` AND image_type=? `
-		pars = append(pars, 2)
-
-		condition += ` ORDER BY create_time asc `
-
-		imageConfList, err := models.GetImageConfByCondition(condition, pars)
-
-		if err == nil && len(imageConfList) > 0 {
-			pptInfo.CurrentBackgroundImg = imageConfList[0].Url
-			pptInfo.CurrentBackgroundImgId = imageConfList[0].ImageConfId
-		}
-	} else if pptInfo.BackCoverImg != "" {
-		condition += ` conf_type=? `
-		pars = append(pars, 1)
-
-		condition += ` AND image_type=? `
-		pars = append(pars, 3)
-
-		condition += ` ORDER BY create_time asc `
-
-		imageConfList, err := models.GetImageConfByCondition(condition, pars)
-
-		if err == nil && len(imageConfList) > 0 {
-			pptInfo.BackCoverImg = imageConfList[0].Url
-			pptInfo.BackCoverImgId = imageConfList[0].ImageConfId
-		}
-	}
-
 	// 编辑中
 	editor, e := services.UpdatePptEditing(pptId, 0, sysUser.AdminId, sysUser.RealName, false)
 	if e != nil {