Merge 9532a32c2a263511459c30494fbaa6564547a044 into 4e34a6d21b63e9a9b701a70be9759e5539bf26e9
This commit is contained in:
commit
2d7da50b49
@ -458,6 +458,10 @@ func (db *DB) Count(count *int64) (tx *DB) {
|
||||
defer delete(tx.Statement.Clauses, "SELECT")
|
||||
}
|
||||
|
||||
if len(tx.Statement.scopes) > 0 {
|
||||
tx.Statement.executeScopes()
|
||||
}
|
||||
|
||||
if len(tx.Statement.Selects) == 0 {
|
||||
tx.Statement.AddClause(clause.Select{Expression: clause.Expr{SQL: "count(*)"}})
|
||||
} else if !strings.HasPrefix(strings.TrimSpace(strings.ToLower(tx.Statement.Selects[0])), "count(") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user