订单列表--完善

This commit is contained in:
Hiven 2023-07-24 18:04:24 +08:00
parent 95e6491de5
commit fd9e30ea74
7 changed files with 217 additions and 98 deletions

View File

@ -25,3 +25,7 @@ func (dt *FsOrderDetailTemplateModel) FindOne(ctx context.Context, id int64) (re
err = dt.db.WithContext(ctx).Model(&FsOrderDetailTemplate{}).Where("`id` = ?", id).Take(&resp).Error err = dt.db.WithContext(ctx).Model(&FsOrderDetailTemplate{}).Where("`id` = ?", id).Take(&resp).Error
return resp, err return resp, err
} }
func (m *FsOrderDetailTemplateModel) TableName() string {
return m.name
}

View File

@ -77,7 +77,7 @@ func (o *FsOrderModel) FindPageListByPage(ctx context.Context, rowBuilder *gorm.
rowBuilder = rowBuilder.Scopes(handler.Paginate(page, pageSize)) rowBuilder = rowBuilder.Scopes(handler.Paginate(page, pageSize))
// 结果 // 结果
result := rowBuilder.WithContext(ctx).Find(&resp) result := rowBuilder.Debug().WithContext(ctx).Find(&resp)
if result.Error != nil { if result.Error != nil {
return nil, result.Error return nil, result.Error
} else { } else {
@ -93,8 +93,20 @@ type FsOrderRel struct {
type FsOrderDetails struct { type FsOrderDetails struct {
FsOrderDetail FsOrderDetail
FsOrderDetailTemplateInfo FsOrderDetailTemplate `gorm:"foreignKey:id;references:order_detail_template_id"` FsOrderDetailTemplateInfo FsOrderDetailTemplateInfo `gorm:"foreignKey:id;references:order_detail_template_id"`
FsProductInfo FsProduct `gorm:"foreignKey:id;references:product_id"` FsProductInfo FsProduct `gorm:"foreignKey:id;references:product_id"`
}
type FsOrderDetailTemplateInfo struct {
FsOrderDetailTemplate
FsProductDesignInfo FsProductDesignInfo `gorm:"foreignKey:id;references:design_id"` //获取设计数据
FsProductSizeInfo FsProductSize `gorm:"foreignKey:id;references:size_id"`
}
type FsProductDesignInfo struct {
FsProductDesign
OptionData FsProduct `gorm:"foreignKey:id;references:optional_id"` //获取配件信息
TemplateData FsProductTemplateV2 `gorm:"foreignKey:id;references:template_id"` //获取模板信息
} }
func (m *FsOrderModel) RowSelectBuilder(selectData []string) *gorm.DB { func (m *FsOrderModel) RowSelectBuilder(selectData []string) *gorm.DB {

View File

@ -34,3 +34,7 @@ func (d *FsProductDesignModel) Create(ctx context.Context, data *FsProductDesign
func (d *FsProductDesignModel) UpdateBySn(ctx context.Context, sn string, data *FsProductDesign) error { func (d *FsProductDesignModel) UpdateBySn(ctx context.Context, sn string, data *FsProductDesign) error {
return d.db.WithContext(ctx).Model(&FsProductDesign{}).Where("`sn` = ?", sn).Updates(&data).Error return d.db.WithContext(ctx).Model(&FsProductDesign{}).Where("`sn` = ?", sn).Updates(&data).Error
} }
func (m *FsProductDesignModel) TableName() string {
return m.name
}

View File

@ -8,6 +8,8 @@ import (
"fusenapi/utils/auth" "fusenapi/utils/auth"
"fusenapi/utils/basic" "fusenapi/utils/basic"
"fusenapi/utils/configs" "fusenapi/utils/configs"
"fusenapi/utils/image"
"strings"
"fusenapi/utils/format" "fusenapi/utils/format"
"fusenapi/utils/order" "fusenapi/utils/order"
@ -41,10 +43,15 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data) // 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
// userinfo 传入值时, 一定不为null // userinfo 传入值时, 一定不为null
// 测试 size := req.Size
userinfo.UserId = 39
if size > 0 {
size = int64(image.GetCurrentSize(uint32(size)))
}
orderDetailModel := gmodel.NewFsOrderDetailModel(l.svcCtx.MysqlConn) orderDetailModel := gmodel.NewFsOrderDetailModel(l.svcCtx.MysqlConn)
orderDetailTemplateModel := gmodel.NewFsOrderDetailTemplateModel(l.svcCtx.MysqlConn)
fsProductDesignModel := gmodel.NewFsProductDesignModel(l.svcCtx.MysqlConn)
orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn) orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn)
rowBuilder := orderModel.RowSelectBuilder(nil) rowBuilder := orderModel.RowSelectBuilder(nil)
if userinfo == nil || userinfo.UserId == 0 { if userinfo == nil || userinfo.UserId == 0 {
@ -55,10 +62,39 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
var page = req.Page var page = req.Page
var pageSize = req.PageSize var pageSize = req.PageSize
var listRes []*gmodel.FsOrderRel var listRes []*gmodel.FsOrderRel
rowBuilder = rowBuilder.Where("user_id =?", userinfo.UserId) rowBuilder = rowBuilder.Where("user_id =?", userinfo.UserId).Where("status <> ?", constants.STATUS_NEW_NOT_PAY).Where("status <>?", constants.STATUS_NEW_DELETE)
// 根据时间来查询不同范围的订单
switch req.Time {
case 1:
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(0, -1, 0).Unix())
case 2:
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(0, -3, 0).Unix())
case 3:
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(0, -6, 0).Unix())
case 4:
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(-1, 0, 0).Unix())
default:
}
//按照订单状态查询不同的订单
if req.Status != -1 { if req.Status != -1 {
rowBuilder = rowBuilder.Where("status = ?", req.Status) switch req.Status {
case 1:
rowBuilder = rowBuilder.Where("status in ?", [3]constants.Order{constants.STATUS_NEW_PART_PAY, constants.STATUS_NEW_PAY_COMPLETED, constants.STATUS_NEW_SURE})
case 2:
rowBuilder = rowBuilder.Where("status in ?", [2]constants.Order{constants.STATUS_NEW_PRODUTING, constants.STATUS_NEW_PRODUT_COMPLETED})
case 3:
rowBuilder = rowBuilder.Where("status in ?", [2]constants.Order{constants.STATUS_NEW_DELIVER, constants.STATUS_NEW_UPS})
case 4:
rowBuilder = rowBuilder.Where("status =?", constants.STATUS_NEW_ARRIVAL)
case 5:
rowBuilder = rowBuilder.Where("status =?", constants.STATUS_NEW_COMPLETED).Where("delivery_method =?", constants.DELIVERY_METHOD_ADDRESS)
case 7:
rowBuilder = rowBuilder.Where("status in ?", [3]constants.Order{constants.STATUS_NEW_CANCEL, constants.STATUS_NEW_REFUNDED, constants.STATUS_NEW_REFUNDING})
case 8:
rowBuilder = rowBuilder.Where("status =?", constants.STATUS_NEW_COMPLETED).Where("delivery_method =?", constants.DELIVERY_METHOD_CLOUD)
}
} }
// 查询总数 // 查询总数
@ -74,7 +110,11 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
// 查询数据 // 查询数据
if total > 0 { if total > 0 {
rowBuilder = rowBuilder.Preload("FsOrderAffiliateInfo").Preload("FsOrderDetails", func(dbPreload *gorm.DB) *gorm.DB { rowBuilder = rowBuilder.Preload("FsOrderAffiliateInfo").Preload("FsOrderDetails", func(dbPreload *gorm.DB) *gorm.DB {
return dbPreload.Table(orderDetailModel.TableName()).Preload("FsOrderDetailTemplateInfo").Preload("FsProductInfo") return dbPreload.Table(orderDetailModel.TableName()).Preload("FsOrderDetailTemplateInfo", func(dbPreload *gorm.DB) *gorm.DB {
return dbPreload.Table(orderDetailTemplateModel.TableName()).Preload("FsProductDesignInfo", func(dbPreload *gorm.DB) *gorm.DB {
return dbPreload.Table(fsProductDesignModel.TableName()).Preload("OptionData").Preload("TemplateData")
}).Preload("FsProductSizeInfo")
}).Preload("FsProductInfo")
}) })
listRes, err = orderModel.FindPageListByPage(l.ctx, rowBuilder, &page, &pageSize, nil, "") listRes, err = orderModel.FindPageListByPage(l.ctx, rowBuilder, &page, &pageSize, nil, "")
} }
@ -112,7 +152,7 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
var pcsBox int64 var pcsBox int64
var pcs int64 var pcs int64
var productList []*types.Product var productList []types.Product
var surplusAt int64 var surplusAt int64
@ -124,31 +164,51 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
} }
} }
//fsOrderAffiliateInfo := item.FsOrderAffiliateInfo fsOrderAffiliateInfo := item.FsOrderAffiliateInfo
fmt.Println(orderTimeConfig)
var getOrderStatusAndLogisticsReq = order.GetOrderStatusAndLogisticsReq{
OrderStatus: 1,
DeliveryMethod: 1,
// IsPayCompleted: *item.IsAllProductCompleted,
// SureTime: *fsOrderAffiliateInfo.SureTime,
// ProductTime: *fsOrderAffiliateInfo.SureTime,
// ProductEndtime: *fsOrderAffiliateInfo.SureTime,
// DeliverTime: *fsOrderAffiliateInfo.SureTime,
// UpsDeliverTime: *fsOrderAffiliateInfo.SureTime,
// UpsTime: *fsOrderAffiliateInfo.SureTime,
// ArrivalTime: *fsOrderAffiliateInfo.SureTime,
// RecevieTime: *fsOrderAffiliateInfo.SureTime,
// // OrderCtime: *item.Ctime, var sureTime int64
// WebSetTimeInfo: orderTimeConfig, var productTime int64
var ProductEndtime int64
var deliverTime int64
var upsDeliverTime int64
var upsTime int64
var arrivalTime int64
var recevieTime int64
if fsOrderAffiliateInfo.Id > 0 {
sureTime = *fsOrderAffiliateInfo.SureTime
productTime = *fsOrderAffiliateInfo.ProductTime
ProductEndtime = *fsOrderAffiliateInfo.ProductEndtime
deliverTime = *fsOrderAffiliateInfo.DeliverTime
upsDeliverTime = *fsOrderAffiliateInfo.UpsDeliverTime
upsTime = *fsOrderAffiliateInfo.UpsTime
arrivalTime = *fsOrderAffiliateInfo.ArrivalTime
recevieTime = *fsOrderAffiliateInfo.RecevieTime
}
var getOrderStatusAndLogisticsReq = order.GetOrderStatusAndLogisticsReq{
OrderStatus: constants.Order(*item.Status),
DeliveryMethod: constants.DeliveryMethod(*item.DeliveryMethod),
IsPayCompleted: *item.IsAllProductCompleted,
OrderCtime: *item.Ctime,
SureTime: sureTime,
ProductTime: productTime,
ProductEndtime: ProductEndtime,
DeliverTime: deliverTime,
UpsDeliverTime: upsDeliverTime,
UpsTime: upsTime,
ArrivalTime: arrivalTime,
RecevieTime: recevieTime,
WebSetTimeInfo: orderTimeConfig,
} }
statusAndLogisticsRes := order.GetOrderStatusAndLogistics(getOrderStatusAndLogisticsReq) statusAndLogisticsRes := order.GetOrderStatusAndLogistics(getOrderStatusAndLogisticsReq)
// 流程控制 // 流程控制
statusTime := make([]*types.StatusTime, 5) var statusTime []types.StatusTime
for _, itemTimes := range statusAndLogisticsRes.Times { for _, itemTimes := range statusAndLogisticsRes.Times {
statusTime = append(statusTime, &types.StatusTime{ statusTime = append(statusTime, types.StatusTime{
Key: itemTimes.Key, Key: itemTimes.Key,
Time: itemTimes.Time, Time: itemTimes.Time,
}) })
@ -157,8 +217,10 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
pbData.LogisticsStatus = int64(statusAndLogisticsRes.LogisticsStatus) pbData.LogisticsStatus = int64(statusAndLogisticsRes.LogisticsStatus)
pbData.Status = int64(statusAndLogisticsRes.OrderStatus) pbData.Status = int64(statusAndLogisticsRes.OrderStatus)
var isStopMax int64
if len(item.FsOrderDetails) > 0 { if len(item.FsOrderDetails) > 0 {
for _, fsOrderDetailItem := range item.FsOrderDetails { for _, fsOrderDetailItem := range item.FsOrderDetails {
fsOrderDetailBuyNum := *fsOrderDetailItem.FsOrderDetail.BuyNum fsOrderDetailBuyNum := *fsOrderDetailItem.FsOrderDetail.BuyNum
fsOrderDetailEachBoxNum := *fsOrderDetailItem.FsOrderDetailTemplateInfo.EachBoxNum fsOrderDetailEachBoxNum := *fsOrderDetailItem.FsOrderDetailTemplateInfo.EachBoxNum
pcs = pcs + fsOrderDetailBuyNum pcs = pcs + fsOrderDetailBuyNum
@ -169,23 +231,58 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
} }
pcsBox = pcsBox + pcsBoxNum + csBoxNumF pcsBox = pcsBox + pcsBoxNum + csBoxNumF
var product types.Product productCover := *fsOrderDetailItem.Cover
product.Cover = *fsOrderDetailItem.Cover // 尺寸
product.Fitting = *fsOrderDetailItem.OptionalTitle if size >= 200 {
product.OptionPrice = *fsOrderDetailItem.OptionPrice coverArr := strings.Split(*fsOrderDetailItem.Cover, ".")
product.OrderDetailTemplateId = *fsOrderDetailItem.OrderDetailTemplateId if len(coverArr) < 2 {
product.OrderId = *fsOrderDetailItem.OrderId return resp.SetStatusWithMessage(basic.CodeServiceErr, "cover split slice item count is less than 2")
product.Pcs = fsOrderDetailBuyNum }
product.PcsBox = pcsBox productCover = fmt.Sprintf("%s_%d.%s", coverArr[0], req.Size, coverArr[1])
product.Price = *fsOrderDetailItem.FsOrderDetail.Amount }
product.ProductId = *fsOrderDetailItem.OptionPrice
product.Title = *fsOrderDetailItem.FsProductInfo.Title
productList = append(productList, &product) // 判断stop
var isStop int64
if fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductDesignInfo.OptionData.Id != 0 {
// 尺寸或者模板下架
if fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductDesignInfo.Id != 0 {
isStop = 1
} else {
isStop = 3
}
} else {
if fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductDesignInfo.Id != 0 {
isStop = 1
}
}
// 判断产品是否下架
if *fsOrderDetailItem.FsProductInfo.IsShelf == 0 || *fsOrderDetailItem.FsProductInfo.IsDel == 1 {
isStop = 2
}
if isStop > isStopMax {
isStopMax = isStop
}
productList = append(productList, types.Product{
Cover: productCover,
Fitting: *fsOrderDetailItem.OptionalTitle,
OptionPrice: *fsOrderDetailItem.OptionPrice,
OrderDetailTemplateId: *fsOrderDetailItem.OrderDetailTemplateId,
OrderId: *fsOrderDetailItem.OrderId,
Pcs: fsOrderDetailBuyNum,
PcsBox: pcsBox,
Price: *fsOrderDetailItem.FsOrderDetail.Amount,
ProductId: *fsOrderDetailItem.OptionPrice,
Title: *fsOrderDetailItem.FsProductInfo.Title,
Size: *fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductSizeInfo.Capacity,
IsStop: isStop,
})
} }
pbData.ProductList = productList pbData.ProductList = productList
} }
pbData.IsStop = isStopMax
pbData.PcsBox = pcsBox pbData.PcsBox = pcsBox
pbData.Pcs = pcs pbData.Pcs = pcs
pbData.SurplusAt = surplusAt pbData.SurplusAt = surplusAt

View File

@ -29,25 +29,25 @@ type UserOrderListRsp struct {
} }
type Items struct { type Items struct {
ID int64 `json:"id"` ID int64 `json:"id"`
Sn string `json:"sn"` Sn string `json:"sn"`
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
TotalAmount int64 `json:"total_amount"` TotalAmount int64 `json:"total_amount"`
Ctime string `json:"ctime"` Ctime string `json:"ctime"`
Status int64 `json:"status"` Status int64 `json:"status"`
DeliveryMethod int64 `json:"delivery_method"` DeliveryMethod int64 `json:"delivery_method"`
TsTime string `json:"ts_time"` TsTime string `json:"ts_time"`
IsPayCompleted int64 `json:"is_pay_completed"` IsPayCompleted int64 `json:"is_pay_completed"`
DeliverSn string `json:"deliver_sn"` DeliverSn string `json:"deliver_sn"`
PcsBox int64 `json:"pcs_box"` PcsBox int64 `json:"pcs_box"`
Pcs int64 `json:"pcs"` Pcs int64 `json:"pcs"`
SurplusAt int64 `json:"surplus_at"` SurplusAt int64 `json:"surplus_at"`
LogisticsStatus int64 `json:"logistics_status"` LogisticsStatus int64 `json:"logistics_status"`
StatusTimes []*StatusTime `json:"status_times"` StatusTimes []StatusTime `json:"status_times"`
Deposit int64 `json:"deposit"` Deposit int64 `json:"deposit"`
Remaining int64 `json:"remaining"` Remaining int64 `json:"remaining"`
ProductList []*Product `json:"productList"` ProductList []Product `json:"productList"`
IsStop int64 `json:"is_stop"` IsStop int64 `json:"is_stop"`
} }
type StatusTime struct { type StatusTime struct {

View File

@ -10,60 +10,60 @@ info (
import "basic.api" import "basic.api"
service home-user-auth { service home-user-auth {
// @handler UserRegisterHandler // @handler UserRegisterHandler
// post /api/user/register(RequestUserRegister) returns (response); // post /api/user/register(RequestUserRegister) returns (response);
@handler UserLoginHandler @handler UserLoginHandler
post /api/user/login(RequestUserLogin) returns (response); post /api/user/login(RequestUserLogin) returns (response);
@handler AcceptCookieHandler @handler AcceptCookieHandler
post /api/user/accept-cookie(request) returns (response); post /api/user/accept-cookie(request) returns (response);
@handler UserFontsHandler @handler UserFontsHandler
get /api/user/fonts(request) returns (response); get /api/user/fonts(request) returns (response);
@handler UserGetTypeHandler @handler UserGetTypeHandler
get /api/user/get-type(request) returns (response); get /api/user/get-type(request) returns (response);
@handler UserSaveBasicInfoHandler @handler UserSaveBasicInfoHandler
post /api/user/basic-info(RequestBasicInfoForm) returns (response); post /api/user/basic-info(RequestBasicInfoForm) returns (response);
@handler UserStatusConfigHandler @handler UserStatusConfigHandler
get /api/user/status-config(request) returns (response); get /api/user/status-config(request) returns (response);
@handler UserBasicInfoHandler @handler UserBasicInfoHandler
get /api/user/basic-info(request) returns (response); get /api/user/basic-info(request) returns (response);
@handler UserAddressListHandler @handler UserAddressListHandler
get /api/user/address-list(request) returns (response); get /api/user/address-list(request) returns (response);
@handler UserAddAddressHandler @handler UserAddAddressHandler
post /api/user/add-address(RequestAddAddress) returns (response); post /api/user/add-address(RequestAddAddress) returns (response);
@handler UserContactServiceHandler @handler UserContactServiceHandler
post /api/user/contact-service (RequestContactService) returns (response); post /api/user/contact-service (RequestContactService) returns (response);
// @handler UserOderListHandler // @handler UserOderListHandler
// get /api/user/order-list(RequestOrderId) returns (response); // get /api/user/order-list(RequestOrderId) returns (response);
@handler UserOderDeleteHandler @handler UserOderDeleteHandler
post /api/user/order-delete(RequestOrderId) returns (response); post /api/user/order-delete(RequestOrderId) returns (response);
@handler UserGoogleLoginHandler @handler UserGoogleLoginHandler
get /api/user/oauth2/login/google(RequestGoogleLogin) returns (response); get /api/user/oauth2/login/google(RequestGoogleLogin) returns (response);
@handler UserEmailRegisterHandler @handler UserEmailRegisterHandler
get /api/user/oauth2/login/register(RequestEmailRegister) returns (response); get /api/user/oauth2/login/register(RequestEmailRegister) returns (response);
//订单列表 //订单列表
@handler UserOrderListHandler @handler UserOrderListHandler
get /api/user/order-list (UserOrderListReq) returns (response); get /api/user/order-list (UserOrderListReq) returns (response);
//取消订单 //取消订单
@handler UserOrderCancelHandler @handler UserOrderCancelHandler
get /api/user/order-cancel (UserOrderCancelReq) returns (response); get /api/user/order-cancel (UserOrderCancelReq) returns (response);
} }
//取消订单 //取消订单
@ -95,25 +95,25 @@ type (
) )
type Items { type Items {
ID int64 `json:"id"` ID int64 `json:"id"`
Sn string `json:"sn"` Sn string `json:"sn"`
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
TotalAmount int64 `json:"total_amount"` TotalAmount int64 `json:"total_amount"`
Ctime string `json:"ctime"` Ctime string `json:"ctime"`
Status int64 `json:"status"` Status int64 `json:"status"`
DeliveryMethod int64 `json:"delivery_method"` DeliveryMethod int64 `json:"delivery_method"`
TsTime string `json:"ts_time"` TsTime string `json:"ts_time"`
IsPayCompleted int64 `json:"is_pay_completed"` IsPayCompleted int64 `json:"is_pay_completed"`
DeliverSn string `json:"deliver_sn"` DeliverSn string `json:"deliver_sn"`
PcsBox int64 `json:"pcs_box"` PcsBox int64 `json:"pcs_box"`
Pcs int64 `json:"pcs"` Pcs int64 `json:"pcs"`
SurplusAt int64 `json:"surplus_at"` SurplusAt int64 `json:"surplus_at"`
LogisticsStatus int64 `json:"logistics_status"` LogisticsStatus int64 `json:"logistics_status"`
StatusTimes []*StatusTime `json:"status_times"` StatusTimes []StatusTime `json:"status_times"`
Deposit int64 `json:"deposit"` Deposit int64 `json:"deposit"`
Remaining int64 `json:"remaining"` Remaining int64 `json:"remaining"`
ProductList []*Product `json:"productList"` ProductList []Product `json:"productList"`
IsStop int64 `json:"is_stop"` IsStop int64 `json:"is_stop"`
} }
type StatusTime { type StatusTime {

View File

@ -38,7 +38,7 @@ type GetOrderStatusAndLogisticsReq struct {
DeliveryMethod constants.DeliveryMethod DeliveryMethod constants.DeliveryMethod
IsPayCompleted int64 IsPayCompleted int64
OrderCtime int64 OrderCtime int64
SureTime int64 SureTime int64
ProductTime int64 ProductTime int64
ProductEndtime int64 ProductEndtime int64
@ -48,7 +48,6 @@ type GetOrderStatusAndLogisticsReq struct {
ArrivalTime int64 ArrivalTime int64
RecevieTime int64 RecevieTime int64
WebSetTimeInfo configs.WebSetTimeInfo WebSetTimeInfo configs.WebSetTimeInfo
} }
@ -72,11 +71,11 @@ func GetOrderStatusAndLogistics(req GetOrderStatusAndLogisticsReq) (res GetOrder
times := make([]GetOrderStatusAndLogisticsResTimes, 5) times := make([]GetOrderStatusAndLogisticsResTimes, 5)
m := 1 m := 1
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
m++
times[i] = GetOrderStatusAndLogisticsResTimes{ times[i] = GetOrderStatusAndLogisticsResTimes{
Key: m, Key: m,
Time: "", Time: "",
} }
m++
} }
switch req.OrderStatus { switch req.OrderStatus {
@ -162,6 +161,9 @@ func GetOrderStatusAndLogistics(req GetOrderStatusAndLogisticsReq) (res GetOrder
res.Times = times res.Times = times
} else { } else {
timesData := times[0:3] timesData := times[0:3]
if logisticsStatus == constants.LOGISTICS_STATUS_DRAW {
timesData[1].Time = format.TimeIntToFormat(req.OrderCtime + req.WebSetTimeInfo.ProductDay*daySecond)
}
res.Times = timesData res.Times = timesData
} }
return res return res