查询用户的京东快递

This commit is contained in:
苏尹岚
2020-10-23 16:45:52 +08:00
parent 4bb5e12d2d
commit b4eafb711f
4 changed files with 163 additions and 0 deletions

View File

@@ -595,9 +595,13 @@ func CancelJdDelivery(ctx *jxcontext.Context, vendorWaybillID, reason string) (e
)
err = dao.GetEntity(db, &dOrder, "VendorWaybillID")
userBill, err := dao.GetUserBill(db, ctx.GetUserID(), "")
dOrders, err := dao.GetDeliveryOrdersNoPage(db, []string{ctx.GetUserID()}, []int{model.OrderStatusCanceled}, DayTimeBegin, DayTimeEnd)
if err != nil {
return err
}
if len(dOrders) > 0 {
return fmt.Errorf("抱歉,您已经在今天取消过京东物流订单!")
}
if dOrder.ID == 0 {
return fmt.Errorf("未找到该运单!")
}
@@ -635,3 +639,7 @@ func CancelJdDelivery(ctx *jxcontext.Context, vendorWaybillID, reason string) (e
dao.Commit(db)
return err
}
func GetJdDelivery(ctx *jxcontext.Context, status int, fromTime, toTime string, pageSize, offset int) (pagedInfo *model.PagedInfo, err error) {
return dao.GetDeliveryOrders(dao.GetDB(), []string{ctx.GetUserID()}, []int{status}, utils.Str2Time(fromTime), utils.Str2Time(toTime), pageSize, offset)
}