a
This commit is contained in:
@@ -128,8 +128,8 @@ func Cash(ctx *jxcontext.Context, orderID string, payType int, vendorPayType str
|
||||
return errCode, err
|
||||
}
|
||||
|
||||
func GetOrders(ctx *jxcontext.Context, orderID string, orderType int, cityCodes []int, fromTime, toTime, keyword string, offset, pageSize int) (pageInfo *model.PagedInfo, err error) {
|
||||
return dao.GetOrders(dao.GetDB(), orderID, orderType, cityCodes, utils.Str2Time(fromTime), utils.Str2Time(toTime), keyword, offset, pageSize)
|
||||
func GetOrders(ctx *jxcontext.Context, orderID, userID string, orderType int, cityCodes []int, fromTime, toTime, keyword string, offset, pageSize int) (pageInfo *model.PagedInfo, err error) {
|
||||
return dao.GetOrders(dao.GetDB(), orderID, userID, orderType, cityCodes, utils.Str2Time(fromTime), utils.Str2Time(toTime), keyword, offset, pageSize)
|
||||
}
|
||||
|
||||
func FinishedCashOrders(ctx *jxcontext.Context, orderIDs []string) (err error) {
|
||||
|
||||
@@ -94,7 +94,7 @@ func GetDeliveryOrders(db *DaoDB, userIDs []string, statuss []int, fromTime, toT
|
||||
return pagedInfo, err
|
||||
}
|
||||
|
||||
func GetOrders(db *DaoDB, orderID string, orderType int, cityCodes []int, fromTime, toTime time.Time, keyword string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
func GetOrders(db *DaoDB, orderID, userID string, orderType int, cityCodes []int, fromTime, toTime time.Time, keyword string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
var orders []*model.Order
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS a.*
|
||||
@@ -110,6 +110,10 @@ func GetOrders(db *DaoDB, orderID string, orderType int, cityCodes []int, fromTi
|
||||
sql += ` AND a.order_id = ?`
|
||||
sqlParams = append(sqlParams, orderID)
|
||||
}
|
||||
if userID != "" {
|
||||
sql += ` AND a.user_id = ?`
|
||||
sqlParams = append(sqlParams, userID)
|
||||
}
|
||||
if orderType != 0 {
|
||||
sql += ` AND a.type = ?`
|
||||
sqlParams = append(sqlParams, orderType)
|
||||
|
||||
@@ -64,6 +64,7 @@ func (c *OrderController) CreateOrder() {
|
||||
// @Description 查询订单提现申请
|
||||
// @Param token header string true "认证token"
|
||||
// @Param orderID query string false "订单号"
|
||||
// @Param userID query string false "用户ID"
|
||||
// @Param orderType query int false "订单类型,1为支付,2为提现"
|
||||
// @Param cityCodes query string false "城市code列表"
|
||||
// @Param fromTime query string false "开始时间"
|
||||
@@ -78,7 +79,7 @@ func (c *OrderController) GetOrders() {
|
||||
c.callGetOrders(func(params *tOrderGetOrdersParams) (retVal interface{}, errCode string, err error) {
|
||||
var cityCodes []int
|
||||
if err = jxutils.Strings2Objs(params.CityCodes, &cityCodes); err == nil {
|
||||
retVal, err = cms.GetOrders(params.Ctx, params.OrderID, params.OrderType, cityCodes, params.FromTime, params.ToTime, params.Keyword, params.Offset, params.PageSize)
|
||||
retVal, err = cms.GetOrders(params.Ctx, params.OrderID, params.UserID, params.OrderType, cityCodes, params.FromTime, params.ToTime, params.Keyword, params.Offset, params.PageSize)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user