This commit is contained in:
邹宗楠
2023-09-14 11:33:12 +08:00
parent 8f6bdaa68e
commit 9e33517dcb
3 changed files with 63 additions and 17 deletions

View File

@@ -876,7 +876,7 @@ func (c *OrderManager) GetStoresOrderSaleInfo(ctx *jxcontext.Context, storeIDLis
return c.GetStoresOrderSaleInfoNew(ctx, storeIDList, fromTime, toTime, statusList)
}
func (c *OrderManager) GetStoresOrderSaleInfo2(ctx *jxcontext.Context, fromTime time.Time, toTime time.Time, storeId int) (map[string]interface{}, error) {
func (c *OrderManager) GetStoresOrderSaleInfo2(ctx *jxcontext.Context, fromTime time.Time, toTime time.Time, storeId int, brandId, vendorId []int) (map[string]interface{}, error) {
year, month, day := time.Now().Date()
if fromTime.IsZero() {
fromTime = time.Date(year, month, day, 0, 0, 0, 0, time.Local)
@@ -887,19 +887,19 @@ func (c *OrderManager) GetStoresOrderSaleInfo2(ctx *jxcontext.Context, fromTime
db := dao.GetDB()
// 门店统计
storeStatus, err := dao.StatisticsStoreInfo(db)
storeStatus, err := dao.StatisticsStoreInfo(db, brandId, vendorId)
if err != nil {
return nil, err
}
// 订单统计
orderStatus, err := dao.StatisticsOrderInfo(db, fromTime, toTime, storeId)
orderStatus, err := dao.StatisticsOrderInfo(db, fromTime, toTime, storeId, brandId, vendorId)
if err != nil {
return nil, err
}
// 售后单统计
afsOrderStatus, err := dao.StatisticsAfsOrderInfo(db, fromTime, toTime, storeId)
afsOrderStatus, err := dao.StatisticsAfsOrderInfo(db, fromTime, toTime, storeId, brandId, vendorId)
if err != nil {
return nil, err
}