Mariusz Muszyński 8 年之前
父节点
当前提交
7ea45472d4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      SE/se-lib/Route/UrlAction/BiAuditGenerate.php

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

@@ -1844,7 +1844,7 @@ SQL;
 					if ($refTable = BiAuditRefTables::getRefTable($refTableFrom, $refTableTo, false)) {
 						$queries[] = "delete from `{$refTable}` where `TRANSACTION_ID` = '-1'";
 						$queries[] = "optimize table `{$refTable}`";
-						$queries[] = "insert into `{$refTable}` (`PRIMARY_KEY`, `REMOTE_PRIMARY_KEY`, `TRANSACTION_ID`, `A_STATUS`) select `all1`.`ID`, `all2`.`ID`, '-1', 'NORMAL' from `BI_audit_ALL` as `all1` join `BI_audit_ALL_ref` as `ref` on `all1`.`ID` = `ref`.`ID1` join `BI_audit_ALL` as `all2` on `ref`.`ID2` = `all2`.`ID` left join `${refTable}` as `ref2` on `all1`.`ID` = `ref2`.`PRIMARY_KEY` and `all2`.`ID` = `ref2`.`REMOTE_PRIMARY_KEY` where `all1`.`REMOTE_TABLE` = '{$refTableFrom}' and `all2`.`REMOTE_TABLE` = '{$refTableTo}' and `ref2`.`PRIMARY_KEY` is null";
+						$queries[] = "insert into `{$refTable}` (`PRIMARY_KEY`, `REMOTE_PRIMARY_KEY`, `TRANSACTION_ID`, `A_STATUS`) select `all1`.`REMOTE_ID`, `all2`.`REMOTE_ID`, '-1', 'NORMAL' from `BI_audit_ALL` as `all1` join `BI_audit_ALL_ref` as `ref` on `all1`.`ID` = `ref`.`ID1` join `BI_audit_ALL` as `all2` on `ref`.`ID2` = `all2`.`ID` left join `${refTable}` as `ref2` on `all1`.`REMOTE_ID` = `ref2`.`PRIMARY_KEY` and `all2`.`REMOTE_ID` = `ref2`.`REMOTE_PRIMARY_KEY` where `all1`.`REMOTE_TABLE` = '{$refTableFrom}' and `all2`.`REMOTE_TABLE` = '{$refTableTo}' and `ref2`.`PRIMARY_KEY` is null";
 					}
 				}
 			}