mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-12 20:23:52 +08:00
CURD 优化
1. `Delete`删除方法, 新增: `Unscoped()`, 已经有删除时间了, 不需要更新编辑时间, 新建时间,编辑时间, 删除时间独立 2. `List`列表方法, JOSN 字段搜索问题处理 3. 模版新增 `in.In` 参数, 在模版中使用`in`参数,如: 插件目录名称
This commit is contained in:
@@ -151,11 +151,11 @@ func (s *s@{.servFunName}) Delete(ctx context.Context, in *@{.templateGroup}in.@
|
||||
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 {
|
||||
if _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).WherePri(in.@{.pk.GoName}).Unscoped().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 {
|
||||
if _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).WherePri(in.@{.pk.GoName}).Data(@{.deletedUpdate}).Unscoped().Update();err != nil {
|
||||
err = gerror.Wrap(err, "删除@{.tableComment}失败,请稍后重试!")
|
||||
return
|
||||
}@{end}
|
||||
|
||||
Reference in New Issue
Block a user