fix 优化deleted_by字段的crud生成功能

fix 优化数据`hotgo.sql`文件字段默认值和初始数据
fix 修复web端字典空数据可能引发的潜在问题
This commit is contained in:
孟帅
2024-08-27 19:19:08 +08:00
parent 33e5252516
commit 37b2b82130
14 changed files with 165 additions and 504 deletions

View File

@@ -150,10 +150,15 @@ func (s *s@{.servFunName}) Delete(ctx context.Context, in *@{.templateGroup}in.@
if count > 0 {
return gerror.New("请先删除该@{.tableComment}下的所有下级!")
}@{end}
@{ if eq .deletedUpdate "" }
if _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).WherePri(in.@{.pk.GoName}).Delete();err != nil {
err = gerror.Wrap(err, "删除@{.tableComment}失败,请稍后重试!")
return
}
}@{else}
if _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).WherePri(in.@{.pk.GoName}).Data(@{.deletedUpdate}).Update();err != nil {
err = gerror.Wrap(err, "删除@{.tableComment}失败,请稍后重试!")
return
}@{end}
return
}@{end}