improve function Unscoped for package gdb

This commit is contained in:
John
2020-06-06 16:28:16 +08:00
parent 30501a882d
commit 29d9bb17cd

View File

@ -12,14 +12,10 @@ import (
"github.com/gogf/gf/os/gtime"
)
// Unscoped enables/disables the soft deleting feature.
func (m *Model) Unscoped(unscoped ...bool) *Model {
// Unscoped disables the soft deleting feature.
func (m *Model) Unscoped() *Model {
model := m.getModel()
if len(unscoped) > 0 {
model.unscoped = unscoped[0]
} else {
model.unscoped = true
}
model.unscoped = true
return model
}