This commit is contained in:
邹宗楠
2024-01-16 16:24:50 +08:00
parent e3eff8739b
commit 1fe0ca13b0
7 changed files with 85 additions and 41 deletions

View File

@@ -876,7 +876,11 @@ 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, brandId, vendorId []int) (map[string]interface{}, error) {
func (c *OrderManager) GetStoresOrderSaleInfo2(ctx *jxcontext.Context, fromTime time.Time, toTime time.Time, storeId int, brandId, vendorId, storeList []int, mapStoreData map[int]int) (map[string]interface{}, error) {
var (
db = dao.GetDB()
)
year, month, day := time.Now().Date()
if fromTime.IsZero() {
fromTime = time.Date(year, month, day, 0, 0, 0, 0, time.Local)
@@ -885,21 +889,20 @@ func (c *OrderManager) GetStoresOrderSaleInfo2(ctx *jxcontext.Context, fromTime
toTime = time.Date(year, month, day, 23, 59, 59, 0, time.Local)
}
db := dao.GetDB()
// 门店统计
storeStatus, err := dao.StatisticsStoreInfo(db, brandId, vendorId)
storeStatus, err := dao.StatisticsStoreInfo(db, brandId, vendorId, storeList)
if err != nil {
return nil, err
}
// 订单统计
orderStatus, err := dao.StatisticsOrderInfo(db, fromTime, toTime, storeId, brandId, vendorId)
orderStatus, err := dao.StatisticsOrderInfo(db, fromTime, toTime, storeId, brandId, vendorId, storeList)
if err != nil {
return nil, err
}
// 售后单统计
afsOrderStatus, err := dao.StatisticsAfsOrderInfo(db, fromTime, toTime, storeId, brandId, vendorId)
afsOrderStatus, err := dao.StatisticsAfsOrderInfo(db, fromTime, toTime, storeId, brandId, vendorId, storeList)
if err != nil {
return nil, err
}