Skip to content

Commit

Permalink
first limit 1
Browse files Browse the repository at this point in the history
  • Loading branch information
yfsoftcom committed Sep 9, 2020
1 parent 47e8880 commit 282081b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/google/uuid v1.1.2 // indirect
github.com/magiconair/properties v1.8.2 // indirect
github.com/stretchr/testify v1.6.1
github.com/team4yf/fpm-go-pkg v0.0.0-20200907232930-67704d580ed7
github.com/team4yf/fpm-go-pkg v0.0.0-20200909075814-040cb22d0a7d
github.com/team4yf/yf-fpm-server-go v0.2.4
go.uber.org/zap v1.16.0 // indirect
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a // indirect
gopkg.in/ini.v1 v1.60.2 // indirect
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 // indirect
gopkg.in/ini.v1 v1.61.0 // indirect
gorm.io/driver/postgres v1.0.0
gorm.io/gorm v1.20.0
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/team4yf/fpm-go-pkg v0.0.0-20200907232930-67704d580ed7 h1:Aj3aR0AJbtGMaaFopjtSD6etjFDDfOQKpa6kgI2Mg+g=
github.com/team4yf/fpm-go-pkg v0.0.0-20200907232930-67704d580ed7/go.mod h1:XbqR6ji35BTcEgTean4+wXcImNniLBXv3Y6v4m289Lw=
github.com/team4yf/fpm-go-pkg v0.0.0-20200909075814-040cb22d0a7d h1:UdOFybs9h/ct4xFxcCLE7CMlkqraVPIYDxXAv8Hzun0=
github.com/team4yf/fpm-go-pkg v0.0.0-20200909075814-040cb22d0a7d/go.mod h1:XbqR6ji35BTcEgTean4+wXcImNniLBXv3Y6v4m289Lw=
github.com/team4yf/yf-fpm-server-go v0.1.19 h1:6ad6qGjoODYSCqmi+H9N67X/VTGbgheQpYrW5H7Ml6E=
github.com/team4yf/yf-fpm-server-go v0.1.19/go.mod h1:5dJbftfRpNBb2cmTsntlilhHoJFRl+lVEB6JH1JBPGk=
github.com/team4yf/yf-fpm-server-go v0.1.20 h1:T3eHOceZ8tbEug5f/XEECzNkwur9uZMlrACBZKiW03Y=
Expand Down Expand Up @@ -413,6 +415,8 @@ golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 h1:AvbQYmiaaaza3cW3QXRyPo5kY
golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 h1:W0lCpv29Hv0UaM1LXb9QlBHLNP8UFfcKjblhVCWftOM=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down Expand Up @@ -480,6 +484,8 @@ gopkg.in/ini.v1 v1.60.1 h1:P5y5shSkb0CFe44qEeMBgn8JLow09MP17jlJHanke5g=
gopkg.in/ini.v1 v1.60.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.60.2 h1:7i8mqModL63zqi8nQn8Q3+0zvSCZy1AxhBgthKfi4WU=
gopkg.in/ini.v1 v1.60.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10=
gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
2 changes: 1 addition & 1 deletion plugins/dbImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (p *ormImpl) First(q *db.QueryData, result interface{}) (err error) {
}
query = query.Select(fields[0], fields[1:]...)
}
query = query.Offset(q.Pager.Skip).Limit(q.Pager.Limit)
query = query.Offset(0).Limit(1)
if len(q.Sorter) > 0 {
for _, sort := range q.Sorter {
query = query.Order(sort.Sortby + " " + sort.Asc)
Expand Down

0 comments on commit 282081b

Please sign in to comment.