Skip to content

Commit

Permalink
set the table for the id column
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Dec 11, 2024
1 parent 4ec3748 commit 74a5a73
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Controller/Admin/CustomersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ public function exportAction(Request $request): JsonResponse
$listing = $this->buildListing($filters);

$idField = Service::getVersionDependentDatabaseColumnName('id');
$fromTable = $listing->getQueryBuilder()->getQueryPart('from')[0]['table'];
$query = $listing->getQueryBuilder()
->resetQueryPart('select')
->select($idField);
->select($fromTable . '.' . $idField);
$ids = Db::get()->fetchFirstColumn((string)$query);

$jobId = uniqid();
Expand Down Expand Up @@ -218,7 +219,9 @@ public function exportStepAction(Request $request): JsonResponse

$idField = Service::getVersionDependentDatabaseColumnName('id');
$listing = $this->buildListing();
$listing->addConditionParam($idField . ' in ('.implode(', ', $ids).')');

$fromTable = $listing->getQueryBuilder()->getQueryPart('from')[0]['table'];
$listing->addConditionParam($fromTable . '.' . $idField . ' in ('.implode(', ', $ids).')');

$exporter = $this->getExporter($listing, $data['exporter']);
$exportData = $exporter->getExportData();
Expand Down

0 comments on commit 74a5a73

Please sign in to comment.