- add optional params fromTime and toTime for TmpGetJxBadCommentsByStoreId

This commit is contained in:
gazebo
2019-02-19 16:36:31 +08:00
parent c18a522132
commit c0d659e300
7 changed files with 134 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model"
"github.com/astaxie/beego"
)
@@ -207,12 +208,17 @@ func (c *StoreController) TmpGetJxBadCommentsNo() {
// @Param type query int true "评论类型0差评1所有"
// @Param page query int true "起始页从1开始"
// @Param size query int true "页大小"
// @Param fromTime query string false "创建起始时间"
// @Param toTime query string false "创建结束时间"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TmpGetJxBadCommentsByStoreId [get]
func (c *StoreController) TmpGetJxBadCommentsByStoreId() {
c.callTmpGetJxBadCommentsByStoreId(func(params *tStoreTmpGetJxBadCommentsByStoreIdParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.TmpGetJxBadCommentsByStoreId(params.Ctx, params.JxStoreId, params.Page, params.Size, params.Type)
timeList, err2 := jxutils.BatchStr2Time(params.FromTime, params.ToTime)
if err = err2; err == nil {
retVal, err = cms.TmpGetJxBadCommentsByStoreId(params.Ctx, params.JxStoreId, (params.Page-1)*params.Size, params.Size, params.Type, timeList[0], timeList[1])
}
return retVal, "", err
})
}