add new blade for reports
This commit is contained in:
@@ -100,7 +100,7 @@ class RoadItemsProjectController extends Controller
|
||||
{
|
||||
$name = 'گزارش از کارتابل ارزیابی فعالیت روزانه ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadItemReportService->supervisorCartableReport($request);
|
||||
return Excel::download(new SupervisorCartableReport($data), $name);
|
||||
return Excel::download(new SupervisorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
public function operatorIndex(Request $request, RoadItemReportService $roadItemReportService): JsonResponse
|
||||
@@ -268,6 +268,6 @@ class RoadItemsProjectController extends Controller
|
||||
{
|
||||
$name = 'گزارش از کارتابل عملیات فعالیت روزانه ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadItemReportService->operatorCartableReport($request);
|
||||
return Excel::download(new OperatorCartableReport($data), $name);
|
||||
return Excel::download(new OperatorCartableReport($data['data']), $name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ class DataTableInput
|
||||
* @param array $rels
|
||||
*/
|
||||
public function __construct(
|
||||
private int $start,
|
||||
private ?int $start,
|
||||
private ?int $size,
|
||||
private array $filters,
|
||||
private array $sorting,
|
||||
private ?array $sorting,
|
||||
private array $rels,
|
||||
private array $allowedFilters,
|
||||
private array $allowedSortings,
|
||||
@@ -74,6 +74,4 @@ class DataTableInput
|
||||
{
|
||||
return $this->rels;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,9 @@ class DataTableService
|
||||
|
||||
$this->totalRowCount = $query->count();
|
||||
|
||||
$query->offset($this->dataTableInput->getStart());
|
||||
if (!is_null($this->dataTableInput->getStart())) {
|
||||
$query->offset($this->dataTableInput->getStart());
|
||||
}
|
||||
|
||||
if(!is_null($this->dataTableInput->getSize())){
|
||||
$query->limit($this->dataTableInput->getSize());
|
||||
|
||||
@@ -50,7 +50,7 @@ class FilterValidator
|
||||
|
||||
protected function isAllowed(Filter $filter, array $allowedFilters): bool
|
||||
{
|
||||
return in_array($filter->getId(), $allowedFilters);
|
||||
return $allowedFilters == ['*'] || in_array($filter->getId(), $allowedFilters);
|
||||
}
|
||||
|
||||
protected function isValidSearchFunction(Filter $filter): bool
|
||||
|
||||
@@ -34,6 +34,6 @@ class SortingValidator
|
||||
|
||||
protected function isAllowed(Sort $sorting, array $allowedSortings): bool
|
||||
{
|
||||
return in_array($sorting->getId(), $allowedSortings);
|
||||
return $allowedSortings == ['*'] || in_array($sorting->getId(), $allowedSortings);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user