|
|
@@ -38,10 +38,9 @@ class ControlPanelController extends Controller
|
|
|
$warehousesOrders = $realtimePendingOrdersService->warehousesOrders();
|
|
|
$orderCountingRecordService = app(NewOrderCountingRecordService::class);
|
|
|
//默认查询一个月的数据
|
|
|
- $start = (new Carbon())->subMonth()->addDay()->toDateString();
|
|
|
+ $start = (new Carbon())->subMonth()->toDateString();
|
|
|
$end = (new Carbon())->toDateString();
|
|
|
$ownerIds = $this->getCountingOwnerIds(null);
|
|
|
-
|
|
|
$unit = '日';
|
|
|
$orderCountingRecords = $orderCountingRecordService->orderCountingRecords($start, $end, $unit, $ownerIds);
|
|
|
$logisticsCountingRecords = $orderCountingRecordService->logisticsCountingRecords($start, $end, $ownerIds);
|
|
|
@@ -55,28 +54,40 @@ class ControlPanelController extends Controller
|
|
|
|
|
|
public function orderCountingRecordsApi(Request $request)
|
|
|
{
|
|
|
- $orderCountingRecordService = app(OrderCountingRecordService::class);
|
|
|
+ /**
|
|
|
+ * @var $orderCountingRecordService NewOrderCountingRecordService
|
|
|
+ */
|
|
|
+ $orderCountingRecordService = app(NewOrderCountingRecordService::class);
|
|
|
$start = Carbon::parse($request->start)->gt(Carbon::now()) ? Carbon::now()->toDateString() : $request->start;
|
|
|
$end = Carbon::parse($request->end)->gt(Carbon::now()) ? Carbon::now()->toDateString() : $request->end;
|
|
|
- $orderCountingRecords = $orderCountingRecordService->orderCountingRecords($start, $end, null, $request->unit, null);
|
|
|
+ $ownerIds = $this->getCountingOwnerIds(null);
|
|
|
+ $orderCountingRecords = $orderCountingRecordService->orderCountingRecords($start, $end, $request->unit, $ownerIds);
|
|
|
return compact('orderCountingRecords');
|
|
|
}
|
|
|
|
|
|
public function logisticsCountingRecordsApi(Request $request)
|
|
|
{
|
|
|
- $orderCountingRecordService = app(OrderCountingRecordService::class);
|
|
|
+ /**
|
|
|
+ * @var $orderCountingRecordService NewOrderCountingRecordService
|
|
|
+ */
|
|
|
+ $orderCountingRecordService = app(NewOrderCountingRecordService::class);
|
|
|
$start = Carbon::parse($request->start)->gt(Carbon::now()) ? Carbon::now()->toDateString() : $request->start;
|
|
|
$end = Carbon::parse($request->end)->gt(Carbon::now()) ? Carbon::now()->toDateString() : $request->end;
|
|
|
- $logisticsCountingRecords = $orderCountingRecordService->logisticsCountingRecords($start, $end);
|
|
|
+ $ownerIds = $this->getCountingOwnerIds(null);
|
|
|
+ $logisticsCountingRecords = $orderCountingRecordService->logisticsCountingRecords($start, $end, $ownerIds);
|
|
|
return compact('logisticsCountingRecords');
|
|
|
}
|
|
|
|
|
|
public function warehouseCountingRecordsApi(Request $request)
|
|
|
{
|
|
|
- $orderCountingRecordService = app(OrderCountingRecordService::class);
|
|
|
+ /**
|
|
|
+ * @var $orderCountingRecordService NewOrderCountingRecordService
|
|
|
+ */
|
|
|
+ $orderCountingRecordService = app(NewOrderCountingRecordService::class);
|
|
|
$start = Carbon::parse($request->start)->gt(Carbon::now()) ? Carbon::now()->toDateString() : $request->start;
|
|
|
$end = Carbon::parse($request->end)->gt(Carbon::now()) ? Carbon::now()->toDateString() : $request->end;
|
|
|
- $warehouseCountingRecords = $orderCountingRecordService->warehouseCountingRecords($start, $end);
|
|
|
+ $ownerIds = $this->getCountingOwnerIds(null);
|
|
|
+ $warehouseCountingRecords = $orderCountingRecordService->warehouseCountingRecords($start, $end, $ownerIds);
|
|
|
return compact('warehouseCountingRecords');
|
|
|
}
|
|
|
|