diff --git a/app/cmd/make/stubs/model/model_util.stub b/app/cmd/make/stubs/model/model_util.stub index c12ff19..546d712 100644 --- a/app/cmd/make/stubs/model/model_util.stub +++ b/app/cmd/make/stubs/model/model_util.stub @@ -25,7 +25,7 @@ func All() ({{VariableNamePlural}} []{{StructName}}) { func IsExist(field, value string) bool { var count int64 - database.DB.Model({{StructName}}{}).Where(" = ?", field, value).Count(&count) + database.DB.Model({{StructName}}{}).Where(field + " = ?", value).Count(&count) return count > 0 } @@ -38,4 +38,4 @@ func Paginate(c *gin.Context, perPage int) ({{VariableNamePlural}} []{{StructNam perPage, ) return -} \ No newline at end of file +}