正在显示
5 个修改的文件
包含
39 行增加
和
28 行删除
@@ -38,6 +38,7 @@ func Detail(header *protocol.RequestHeader, request *protocol.OrderDetailRequest | @@ -38,6 +38,7 @@ func Detail(header *protocol.RequestHeader, request *protocol.OrderDetailRequest | ||
38 | OrderStatus: orderStatus(order), | 38 | OrderStatus: orderStatus(order), |
39 | CreateTime: order.CreateTime.Unix() * 1000, | 39 | CreateTime: order.CreateTime.Unix() * 1000, |
40 | UpdateTime: order.UpdateTime.Unix() * 1000, | 40 | UpdateTime: order.UpdateTime.Unix() * 1000, |
41 | + SalesTime: order.SaleDate.Unix() * 1000, | ||
41 | OrderDistrict: map[string]interface{}{"id": order.RegionInfo.RegionId, "name": order.RegionInfo.RegionName}, | 42 | OrderDistrict: map[string]interface{}{"id": order.RegionInfo.RegionId, "name": order.RegionInfo.RegionName}, |
42 | Customer: protocol.Customer{Uname: order.Buyer.BuyerName, Phone: order.Buyer.ContactInfo}, | 43 | Customer: protocol.Customer{Uname: order.Buyer.BuyerName, Phone: order.Buyer.ContactInfo}, |
43 | Products: orderProducts(order), | 44 | Products: orderProducts(order), |
@@ -195,8 +196,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r | @@ -195,8 +196,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r | ||
195 | 196 | ||
196 | // 查询订单列表 | 197 | // 查询订单列表 |
197 | queryOption := &domain.OrderQueryOption{ | 198 | queryOption := &domain.OrderQueryOption{ |
198 | - Limit: request.PageSize, | ||
199 | - Offset: request.PageSize * request.PageIndex, | 199 | + Limit: request.PageSize, |
200 | + Offset: request.PageSize * request.PageIndex, | ||
200 | //SortByUpdateTime: domain.DESC, | 201 | //SortByUpdateTime: domain.DESC, |
201 | SortByCreateTime: domain.DESC, | 202 | SortByCreateTime: domain.DESC, |
202 | PartnerId: request.PartnerId, | 203 | PartnerId: request.PartnerId, |
@@ -234,6 +235,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r | @@ -234,6 +235,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r | ||
234 | PartnerCategoryId: request.JoinWay, | 235 | PartnerCategoryId: request.JoinWay, |
235 | }) | 236 | }) |
236 | rsp.Total = cumulativeQuantity | 237 | rsp.Total = cumulativeQuantity |
238 | + rsp.Timestamp = time.Now().Unix() * 1000 | ||
237 | } | 239 | } |
238 | //【特殊处理2】 今天累计数量特殊处理 当前查询时间段内所有订单总数(复用rsp.Total字段) | 240 | //【特殊处理2】 今天累计数量特殊处理 当前查询时间段内所有订单总数(复用rsp.Total字段) |
239 | if request.StartTime > 0 && request.EndTime > 0 { | 241 | if request.StartTime > 0 && request.EndTime > 0 { |
@@ -249,17 +251,18 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r | @@ -249,17 +251,18 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r | ||
249 | func DomainOrderToOrderListItem(order *domain.OrderBase) *protocol.OrderListItem { | 251 | func DomainOrderToOrderListItem(order *domain.OrderBase) *protocol.OrderListItem { |
250 | bonusStatic := order.OrderBonusStatic() | 252 | bonusStatic := order.OrderBonusStatic() |
251 | return &protocol.OrderListItem{ | 253 | return &protocol.OrderListItem{ |
252 | - Id: order.Id, | ||
253 | - OrderType: order.OrderType, | ||
254 | - OrderNo: order.OrderCode, | ||
255 | - DeliveryNo: order.DeliveryCode, | ||
256 | - OrderDistrict: map[string]interface{}{ | ||
257 | - "id": order.RegionInfo.RegionId, | 254 | + Id: order.Id, |
255 | + OrderType: order.OrderType, | ||
256 | + OrderNo: order.OrderCode, | ||
257 | + DeliveryNo: order.DeliveryCode, | ||
258 | + OrderDistrict: map[string]interface{}{ | ||
259 | + "id": order.RegionInfo.RegionId, | ||
258 | "name": order.RegionInfo.RegionName, | 260 | "name": order.RegionInfo.RegionName, |
259 | }, | 261 | }, |
260 | - OrderAmount: order.PlanOrderAmount, | ||
261 | - UpdateTime: order.UpdateTime.Unix() * 1000, | ||
262 | - MyDividend: bonusStatic.OrderTotalReceivable(), | ||
263 | - IsRead: order.IsRead(), | 262 | + OrderAmount: order.PlanOrderAmount, |
263 | + UpdateTime: order.UpdateTime.Unix() * 1000, | ||
264 | + SalesTime: order.SaleDate.Unix() * 1000, | ||
265 | + MyDividend: bonusStatic.OrderTotalReceivable(), | ||
266 | + IsRead: order.IsRead(), | ||
264 | } | 267 | } |
265 | } | 268 | } |
@@ -2,9 +2,9 @@ package constant | @@ -2,9 +2,9 @@ package constant | ||
2 | 2 | ||
3 | import "os" | 3 | import "os" |
4 | 4 | ||
5 | -var REDIS_HOST = "192.168.100.6" | 5 | +var REDIS_HOST = "127.0.0.1" |
6 | var REDIS_PORT = "6379" | 6 | var REDIS_PORT = "6379" |
7 | -var REDIS_AUTH = "1993618@jack" | 7 | +var REDIS_AUTH = "" // 1993618@jack |
8 | 8 | ||
9 | func init() { | 9 | func init() { |
10 | if os.Getenv("REDIS_HOST") != "" { | 10 | if os.Getenv("REDIS_HOST") != "" { |
@@ -42,6 +42,8 @@ type OrderBase struct { | @@ -42,6 +42,8 @@ type OrderBase struct { | ||
42 | DeliveryTime time.Time | 42 | DeliveryTime time.Time |
43 | //更新时间 | 43 | //更新时间 |
44 | UpdateTime time.Time | 44 | UpdateTime time.Time |
45 | + //销售日期 | ||
46 | + SaleDate time.Time | ||
45 | //上一次查看时间 已读情况 | 47 | //上一次查看时间 已读情况 |
46 | LastViewTime time.Time | 48 | LastViewTime time.Time |
47 | //合伙人应收分红 | 49 | //合伙人应收分红 |
@@ -163,19 +165,19 @@ type OrderQueryOption struct { | @@ -163,19 +165,19 @@ type OrderQueryOption struct { | ||
163 | } | 165 | } |
164 | 166 | ||
165 | type DividendOrdersQueryOption struct { | 167 | type DividendOrdersQueryOption struct { |
166 | - PartnerId int64 `json:"partnerId"` | ||
167 | - OrderType int `json:"orderType"` //订单类型 | ||
168 | - OrderTypes []int `json:"orderTypes,omitempty"` | ||
169 | - DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细) | ||
170 | - DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出) | ||
171 | - IsDisable string `json:"isDisable,omitempty"` | ||
172 | - StartTime int64 `json:"startTime" ` | ||
173 | - EndTime int64 `json:"endTime"` | ||
174 | - Offset int `json:"offset,omitempty"` | ||
175 | - Limit int `json:"limit,omitempty"` | ||
176 | - SortByUpdateTime string `json:"sortByUpdateTime,omitempty"` | ||
177 | - SortByCreateTime string `json:"sortByCreateTime,omitempty"` | ||
178 | - JoinWays []*company.JoinWays `json:"joinWays,omitempty"` // 合伙类型 | 168 | + PartnerId int64 `json:"partnerId"` |
169 | + OrderType int `json:"orderType"` //订单类型 | ||
170 | + OrderTypes []int `json:"orderTypes,omitempty"` | ||
171 | + DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细) | ||
172 | + DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出) | ||
173 | + IsDisable string `json:"isDisable,omitempty"` | ||
174 | + StartTime int64 `json:"startTime" ` | ||
175 | + EndTime int64 `json:"endTime"` | ||
176 | + Offset int `json:"offset,omitempty"` | ||
177 | + Limit int `json:"limit,omitempty"` | ||
178 | + SortByUpdateTime string `json:"sortByUpdateTime,omitempty"` | ||
179 | + SortByCreateTime string `json:"sortByCreateTime,omitempty"` | ||
180 | + JoinWays []*company.JoinWays `json:"joinWays,omitempty"` // 合伙类型 | ||
179 | } | 181 | } |
180 | 182 | ||
181 | //买家 | 183 | //买家 |
@@ -42,6 +42,8 @@ type OrderBase struct { | @@ -42,6 +42,8 @@ type OrderBase struct { | ||
42 | DeliveryTime time.Time | 42 | DeliveryTime time.Time |
43 | //更新时间 | 43 | //更新时间 |
44 | UpdateTime time.Time | 44 | UpdateTime time.Time |
45 | + //销售日期 | ||
46 | + SaleDate time.Time | ||
45 | //上一次查看时间 已读情况 | 47 | //上一次查看时间 已读情况 |
46 | LastViewTime time.Time | 48 | LastViewTime time.Time |
47 | //合伙人应收分红 | 49 | //合伙人应收分红 |
@@ -32,6 +32,7 @@ type OrderDetail struct { | @@ -32,6 +32,7 @@ type OrderDetail struct { | ||
32 | OrderStatus int `json:"orderStatus"` //订单状态 1.待支付 2.已支付 3.已支付退货 4待支付退货 | 32 | OrderStatus int `json:"orderStatus"` //订单状态 1.待支付 2.已支付 3.已支付退货 4待支付退货 |
33 | CreateTime int64 `json:"createTime"` | 33 | CreateTime int64 `json:"createTime"` |
34 | UpdateTime int64 `json:"updateTime"` | 34 | UpdateTime int64 `json:"updateTime"` |
35 | + SalesTime int64 `json:"salesTime"` // 销售日期 | ||
35 | OrderDistrict interface{} `json:"orderDistrict"` | 36 | OrderDistrict interface{} `json:"orderDistrict"` |
36 | Customer Customer `json:"customer"` | 37 | Customer Customer `json:"customer"` |
37 | Products interface{} `json:"products"` | 38 | Products interface{} `json:"products"` |
@@ -95,6 +96,7 @@ type OrderListResponse struct { | @@ -95,6 +96,7 @@ type OrderListResponse struct { | ||
95 | List []*OrderListItem `json:"list"` | 96 | List []*OrderListItem `json:"list"` |
96 | Statistics map[string]interface{} `json:"-"` | 97 | Statistics map[string]interface{} `json:"-"` |
97 | Total int `json:"total"` | 98 | Total int `json:"total"` |
99 | + Timestamp int64 `json:"timestamp"` | ||
98 | } | 100 | } |
99 | 101 | ||
100 | type OrderListItem struct { | 102 | type OrderListItem struct { |
@@ -117,7 +119,9 @@ type OrderListItem struct { | @@ -117,7 +119,9 @@ type OrderListItem struct { | ||
117 | //订单金额 | 119 | //订单金额 |
118 | OrderAmount float64 `json:"orderAmount"` | 120 | OrderAmount float64 `json:"orderAmount"` |
119 | // 订单更新时间 | 121 | // 订单更新时间 |
120 | - UpdateTime int64 `json:"updateTime"` | 122 | + UpdateTime int64 `json:"updateTime"` |
123 | + //销售时间 | ||
124 | + SalesTime int64 `json:"salesTime"` | ||
121 | //我的分红 | 125 | //我的分红 |
122 | MyDividend float64 `json:"dividendReceivable"` | 126 | MyDividend float64 `json:"dividendReceivable"` |
123 | //是否已读(0未读,1已读) | 127 | //是否已读(0未读,1已读) |
-
请 注册 或 登录 后发表评论