Merge pull request #1520 from FlyingBlazer/patch-1

Fix gdb Order
This commit is contained in:
John Guo 2022-03-09 20:48:54 +08:00 committed by GitHub
commit 61db7d96b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ func (m *Model) Order(orderBy ...string) *Model {
if model.orderBy != "" {
model.orderBy += ","
}
model.orderBy = model.db.GetCore().QuoteString(strings.Join(orderBy, " "))
model.orderBy += model.db.GetCore().QuoteString(strings.Join(orderBy, " "))
return model
}

View File

@ -438,7 +438,7 @@ func Test_Model_Clone(t *testing.T) {
defer dropTable(table)
gtest.C(t, func(t *gtest.T) {
md := db.Model(table).Where("id IN(?)", g.Slice{1, 3})
md := db.Model(table).Safe(true).Where("id IN(?)", g.Slice{1, 3})
count, err := md.Count()
t.AssertNil(err)