Browse Source

更新

master
huangjiajun 2 days ago
parent
commit
5ba747417a
2 changed files with 11 additions and 1 deletions
  1. +6
    -0
      app/svc/svc_applet_application.go
  2. +5
    -1
      app/svc/svc_applet_application_ad_space.go

+ 6
- 0
app/svc/svc_applet_application.go View File

@@ -115,6 +115,12 @@ func AppletApplicationSave(c *gin.Context) {
}
user := GetUser(c)
engine := MasterDb(c)
count, _ := engine.Where("id<>? and name=?", utils.StrToInt(req.Id), req.Name).Count(&model.AppletApplication{})
if count > 0 {
e.OutErr(c, 400, e.NewErr(400, "名称重复"))
return
}

NewAppletApplicationDb := implement.NewAppletApplicationDb(engine)
var data *model.AppletApplication
if utils.StrToInt(req.Id) > 0 {


+ 5
- 1
app/svc/svc_applet_application_ad_space.go View File

@@ -100,7 +100,11 @@ func AppletApplicationAdSpaceSave(c *gin.Context) {
e.OutErr(c, 400, e.NewErr(400, "应用不存在"))
return
}

count, _ := MasterDb(c).Where("name=?", req.Name).Count(&model.AppletApplicationAdSpaceList{})
if count > 0 {
e.OutErr(c, 400, e.NewErr(400, "名称重复"))
return
}
user := GetUser(c)
engine := MasterDb(c)
data := &model.AppletApplicationAdSpaceList{


Loading…
Cancel
Save