作者 陈志颖

refactor:返回订单区域字段C

... ... @@ -248,13 +248,17 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
func DomainOrderToOrderListItem(order *domain.OrderBase) *protocol.OrderListItem {
bonusStatic := order.OrderBonusStatic()
return &protocol.OrderListItem{
Id: order.Id,
OrderType: order.OrderType,
OrderNo: order.OrderCode,
DeliveryNo: order.DeliveryCode,
OrderAmount: order.PlanOrderAmount,
UpdateTime: order.UpdateTime.Unix() * 1000,
MyDividend: bonusStatic.OrderTotalReceivable(),
IsRead: order.IsRead(),
Id: order.Id,
OrderType: order.OrderType,
OrderNo: order.OrderCode,
DeliveryNo: order.DeliveryCode,
OrderDistrict: map[string]interface{}{
"id": order.RegionInfo.RegionId,
"name": order.RegionInfo.RegionName,
},
OrderAmount: order.PlanOrderAmount,
UpdateTime: order.UpdateTime.Unix() * 1000,
MyDividend: bonusStatic.OrderTotalReceivable(),
IsRead: order.IsRead(),
}
}
... ...
... ... @@ -77,8 +77,7 @@ func (repository *OrderBaseRepository) Find(queryOptions map[string]interface{})
var OrderBaseModels []*models.OrderBase
OrderBases := make([]*domain.OrderBase, 0)
query := NewQuery(tx.Model(&OrderBaseModels), queryOptions)
query.
SetWhere(`"order_base".partner_id= ?`, "partnerId").
query.SetWhere(`"order_base".partner_id= ?`, "partnerId").
SetWhere(`"order_base".order_type= ?`, "orderType").
SetWhere(`"order_base".create_time >= ?`, "beginTime").
SetWhere(`"order_base".create_time < ?`, "endTime").
... ...
... ... @@ -24,6 +24,7 @@ type OrderDetailResponse struct {
// MyDividend float64 `json:"myDividend"`
// MyDividendPercent float64 `json:"myDividendPercent"`
//}
type OrderDetail struct {
Id int64 `json:"id"`
OrderNo string `json:"orderNo"` //订单号
... ... @@ -36,6 +37,7 @@ type OrderDetail struct {
Products interface{} `json:"products"`
Total interface{} `json:"total"`
}
type Customer struct {
Uname string `json:"uname"`
Phone string `json:"phone"`
... ... @@ -110,8 +112,11 @@ type OrderListItem struct {
OrderStatus int `json:"-"`
//实际订单数量
OrderActualCount int `json:"-"`
// 订单区域
OrderDistrict map[string]interface{} `json:"orderDistrict"`
//订单金额
OrderAmount float64 `json:"orderAmount"`
// 订单更新时间
UpdateTime int64 `json:"updateTime"`
//我的分红
MyDividend float64 `json:"dividendReceivable"`
... ...