From e7bc8bbe2fd47b348090552665233731d98fbaec Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 04 七月 2024 23:08:39 +0800 Subject: [PATCH] fix --- service/warehouse_month_forms.go | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/service/warehouse_month_forms.go b/service/warehouse_month_forms.go index 19402ca..9af8677 100644 --- a/service/warehouse_month_forms.go +++ b/service/warehouse_month_forms.go @@ -162,7 +162,7 @@ return } -func GetCurrentWarehouseStats(date string, warehouseId int, productIds []string) (statRecords []*models.WarehouseMonthStats, err error) { +func GetCurrentWarehouseStats(date string, warehouseId int, productIds []string, realTime bool) (statRecords []*models.WarehouseMonthStats, err error) { //鏈湀鏈熷垵鏁伴噺/涓婃湀缁撲綑鏁伴噺 groupSumList, err := models.NewLocationProductAmountSearch().SetProductIds(productIds).GroupSum("product_id", "amount") productIds = make([]string, 0, len(groupSumList)) @@ -178,6 +178,10 @@ //鎸夐厤缃彇寮�濮嬫椂闂村拰缁撴潫鏃堕棿 beginTime, endTime, err := NewSystemConfigService().GetInventoryCutOffTime() + if realTime { + beginTime = endTime + endTime = time.Now() + } if err != nil { logx.Errorf("MonthStats GetCurrentStats get GetInventoryCutOffTime err:%v", err) return -- Gitblit v1.8.0