Add Filter Sales Metric
This commit is contained in:
@@ -282,9 +282,11 @@ func (h *Handler) toDailySales(resp []entity.ProductDailySales) []response.Produ
|
||||
var dailySales []response.ProductDailySales
|
||||
for _, b := range resp {
|
||||
dailySales = append(dailySales, response.ProductDailySales{
|
||||
Day: b.Day,
|
||||
ProductID: b.ProductID,
|
||||
TotalQuantity: b.TotalQuantity,
|
||||
Day: b.Day,
|
||||
SiteID: b.SiteID,
|
||||
Total: b.Total,
|
||||
SiteName: b.SiteName,
|
||||
PaymentType: b.PaymentType,
|
||||
})
|
||||
}
|
||||
return dailySales
|
||||
|
||||
@@ -19,6 +19,7 @@ type OrderParam struct {
|
||||
Status string `form:"status" json:"status"`
|
||||
Limit int `form:"limit" json:"limit" example:"10"`
|
||||
Offset int `form:"offset" json:"offset" example:"0"`
|
||||
Period string `form:"period" json:"period" example:"1d,7d,1m"`
|
||||
}
|
||||
|
||||
func (o *OrderParam) ToOrderEntity(ctx mycontext.Context) entity.OrderSearch {
|
||||
@@ -32,6 +33,7 @@ func (o *OrderParam) ToOrderEntity(ctx mycontext.Context) entity.OrderSearch {
|
||||
StartDate: o.StartDate,
|
||||
EndDate: o.EndDate,
|
||||
Status: o.Status,
|
||||
Period: o.Period,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,9 @@ type CreateOrderItemResponse struct {
|
||||
}
|
||||
|
||||
type ProductDailySales struct {
|
||||
Day time.Time
|
||||
ProductID int64
|
||||
TotalQuantity int
|
||||
Day time.Time `json:"day"`
|
||||
SiteID int64 `json:"site_id"`
|
||||
SiteName string `json:"site_name"`
|
||||
PaymentType string `json:"payment_type"`
|
||||
Total float64 `json:"total"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user