Commit ed06aa7a authored by hujiebin's avatar hujiebin

低版本用30页面

parent 171edf2c
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/resource/mysql" "git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/utils"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jinzhu/now" "github.com/jinzhu/now"
"hilo-user/_const/enum/cp_e" "hilo-user/_const/enum/cp_e"
...@@ -40,6 +41,12 @@ func CpRank(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -40,6 +41,12 @@ func CpRank(c *gin.Context) (*mycontext.MyContext, error) {
if pageReq.PageIndex == 0 { if pageReq.PageIndex == 0 {
pageReq.PageIndex = 1 pageReq.PageIndex = 1
} }
appVersion, deviceType := c.GetHeader(mycontext.APP_VERSION), c.GetHeader(mycontext.DEVICETYPE)
if deviceType == "android" {
if lower, _ := utils.CompareVersion(appVersion, fmt.Sprintf("<= %s", "3.9.0")); lower {
pageReq.PageSize = 30
}
}
queryType := c.Param("queryType") queryType := c.Param("queryType")
if queryType != "day" && queryType != "week" && queryType != "month" { if queryType != "day" && queryType != "week" && queryType != "month" {
return myCtx, bizerr.InvalidParameter return myCtx, bizerr.InvalidParameter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment