From 5afe95d422ab2d2e933d12f8aa99483a38fc17b5 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 22 Aug 2018 14:14:10 +0800 Subject: [PATCH] - fix some annotation. --- business/jxcallback/orderman/orderman_ext.go | 7 ++++++- controllers/jx_order.go | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 8039709f4..6889dbe76 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -11,7 +11,8 @@ import ( ) const ( - maxLastHours = 2 * 24 // 最多只能查询两天内的订单数据 + maxLastHours = 7 * 24 // 最多只能查询7天内的订单数据 + defLastHours = 2 * 24 // 缺省是两天内的订单 defPageSize = 50 ) @@ -22,6 +23,8 @@ var ( func (c *OrderManager) GetStoreOrderInfo(storeID string, lastHours int, fromStatus, toStatus, offset, pageSize int) (orders []*model.GoodsOrderExt, err error) { if lastHours > maxLastHours { lastHours = maxLastHours + } else if lastHours == 0 { + lastHours = defLastHours } if toStatus == 0 { toStatus = fromStatus @@ -53,6 +56,8 @@ func (c *OrderManager) GetStoreOrderInfo(storeID string, lastHours int, fromStat func (c *OrderManager) GetStoreOrderCountInfo(storeID string, lastHours int) (countInfo []*model.GoodsOrderCountInfo, err error) { if lastHours > maxLastHours { lastHours = maxLastHours + } else if lastHours == 0 { + lastHours = defLastHours } db := orm.NewOrm() diff --git a/controllers/jx_order.go b/controllers/jx_order.go index 4a4034ef4..7ecb59530 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -96,7 +96,7 @@ func (c *OrderController) CreateWaybillOnProviders() { // @Title 得到门店订单信息 // @Description 得到门店订单信息 // @Param storeID query string true "京西门店ID" -// @Param lastHours query int false "最近多少小时的信息" +// @Param lastHours query int false "最近多少小时的信息(缺省为两天)" // @Success 200 {object} business.model.CallResult // @Failure 200 {object} business.model.CallResult // @router /GetStoreOrderCountInfo [get] @@ -133,11 +133,11 @@ func (c *OrderController) GetStoreOrderCountInfo() { // @Title 得到门店订单状态信息 // @Description 得到门店订单状态信息 // @Param storeID query string true "京西门店ID" -// @Param lastHours query int false "最近多少小时的信息" -// @Param fromStatus query int true "起始状态" -// @Param toStatus query int false "起始状态" -// @Param offset query int false "起始状态" -// @Param pageSize query int false "起始状态" +// @Param lastHours query int false "最近多少小时的信息(缺省为两天)" +// @Param fromStatus query int true "起始状态(包括)" +// @Param toStatus query int false "结束状态(包括)" +// @Param offset query int false "订单列表起始序号(以0开始,缺省为0)" +// @Param pageSize query int false "订单列表页大小(缺省为50)" // @Success 200 {object} business.model.CallResult // @Failure 200 {object} business.model.CallResult // @router /GetStoreOrderInfo [get]