mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
允许多次调用Order
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user