18 lines
302 B
Go
18 lines
302 B
Go
package util
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/go-pripro/shop/pkg/setting"
|
|
"github.com/unknwon/com"
|
|
)
|
|
|
|
func GetPage(c *gin.Context) int {
|
|
result := 0
|
|
page, _ := com.StrTo(c.Query("page")).Int()
|
|
if page > 0 {
|
|
result = (page - 1) * setting.AppSetting.PageSize
|
|
}
|
|
|
|
return result
|
|
}
|