mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-14 05:03:49 +08:00
fix 优化deleted_by字段的crud生成功能
fix 优化数据`hotgo.sql`文件字段默认值和初始数据 fix 修复web端字典空数据可能引发的潜在问题
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user