Ver Fonte

bug fix

Mariusz Muszyński há 8 anos atrás
pai
commit
fa4ced763d
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      SE/se-lib/Route/UrlAction/BiAuditGenerate.php

+ 3 - 3
SE/se-lib/Route/UrlAction/BiAuditGenerate.php

@@ -2267,8 +2267,8 @@ class BiAuditPowiazania {
 
 		$this->progressFile = "{$this->tasksDirLocation}/generatePowiazania-{$this->ID}.progress";
 		$refPowiazaniaToPracownicy = BiAuditRefTables::getRefTable('BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA', 'BI_audit_ENERGA_PRACOWNICY', true);
-		$query = "select `all`.ID as ID from BI_audit_ALL `all` join `{$refPowiazaniaToPracownicy}` ref
-			on `all`.REMOTE_TABLE = 'BI_audit_ENERGA_PRACOWNICY' and `all`.REMOTE_ID = ref.REMOTE_PRIMARY_KEY and ref.PRIMARY_KEY = '{$this->ID}' order by `all`.`ID` asc";
+		$query = "select `all`.`ID` from `BI_audit_ALL` `all` join `{$refPowiazaniaToPracownicy}` `ref`
+			on `all`.`REMOTE_TABLE` = 'BI_audit_ENERGA_PRACOWNICY' and `all`.`REMOTE_ID` = `ref`.`REMOTE_PRIMARY_KEY` and `ref`.`PRIMARY_KEY` = '{$this->ID}' order by `all`.`ID` asc";
 		$result = DB::getPDO()->fetchAll($query);
 		$this->count = count($result);
 		$this->progress['summary']['count'] = $this->count;
@@ -2277,7 +2277,7 @@ class BiAuditPowiazania {
 		try {
 			foreach ($result as $i => $row) {
 				$this->i = $i + 1;
-				$this->pracownikID = $row['ID'];
+				$this->pracownikID = DB::getPDO()->fetchValue("select `REMOTE_ID` from `BI_AUDIT_ALL` where `ID` = :ID", [":ID" => $row['ID']]);
 				$this->startTimestamp = microtime(true);
 				$this->lastProgress = 0;
 				$this->saveProgress(0, "Wyszukiwanie powiązań dla obiektu {$this->i}/{$this->count}");