|
@@ -2000,11 +2000,11 @@ class BiAuditRelations {
|
|
|
if ($refTable = $this->refTables->getRefTable($fromTable, $toTable)) {
|
|
if ($refTable = $this->refTables->getRefTable($fromTable, $toTable)) {
|
|
|
if (!DB::getPDO()->fetchValue("select count(*) from `{$refTable}` where `PRIMARY_KEY` = '{$fromID}' and `REMOTE_PRIMARY_KEY` = '{$toID}' and `A_STATUS` != 'DELETED'")) {
|
|
if (!DB::getPDO()->fetchValue("select count(*) from `{$refTable}` where `PRIMARY_KEY` = '{$fromID}' and `REMOTE_PRIMARY_KEY` = '{$toID}' and `A_STATUS` != 'DELETED'")) {
|
|
|
DB::getPDO()->insert($refTable, ['PRIMARY_KEY' => $fromID, 'REMOTE_PRIMARY_KEY' => $toID, 'A_STATUS' => 'NORMAL', 'TRANSACTION_ID' => '-1']);
|
|
DB::getPDO()->insert($refTable, ['PRIMARY_KEY' => $fromID, 'REMOTE_PRIMARY_KEY' => $toID, 'A_STATUS' => 'NORMAL', 'TRANSACTION_ID' => '-1']);
|
|
|
- } else { error_log('#2000 DEBUG found some records in REFs for table fromTable:'.$fromTable.' toTable:'.$toTable);
|
|
|
|
|
- echo '#2000 DEBUG found some records in REFs for table fromTable:'.$fromTable.' toTable:'.$toTable;
|
|
|
|
|
|
|
+ } else { error_log('\n#2000 DEBUG found some records in REFs for table fromTable:'.$fromTable.' toTable:'.$toTable);
|
|
|
|
|
+ echo '\n#2000 DEBUG found some records in REFs for table fromTable:'.$fromTable.' toTable:'.$toTable;
|
|
|
}
|
|
}
|
|
|
- } else { error_log('#2001 DEBUG not found ref table fromTable:'.$fromTable.' toTable:'.$toTable);
|
|
|
|
|
- echo '#2001 DEBUG not found ref table fromTable:'.$fromTable.' toTable:'.$toTable ;
|
|
|
|
|
|
|
+ } else { error_log('\n#2001 DEBUG not found ref table fromTable:'.$fromTable.' toTable:'.$toTable);
|
|
|
|
|
+ echo '\n#2001 DEBUG not found ref table fromTable:'.$fromTable.' toTable:'.$toTable ;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2028,7 +2028,10 @@ class BiAuditRelations {
|
|
|
$items .= ", if(" . implode(" and ", $join) . ", 1, 0) as {$name}";
|
|
$items .= ", if(" . implode(" and ", $join) . ", 1, 0) as {$name}";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (!$joins) return false;
|
|
|
|
|
|
|
+ if (!$joins) {
|
|
|
|
|
+ //error_log('#2032 not found joins for ');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$query = "select t2.ID as ID, t1.REMOTE_TABLE as REMOTE_TABLE_1, t2.REMOTE_TABLE as REMOTE_TABLE_2 {$items}, t1.BASE * t2.BASE as BASE " .
|
|
$query = "select t2.ID as ID, t1.REMOTE_TABLE as REMOTE_TABLE_1, t2.REMOTE_TABLE as REMOTE_TABLE_2 {$items}, t1.BASE * t2.BASE as BASE " .
|
|
|
"from BI_audit_ALL t1 join BI_audit_ALL t2 on " . implode(" or ", $joins) . " where t1.ID = {$ID} and (t2.reffed = 1 or t2.ID > {$ID})";
|
|
"from BI_audit_ALL t1 join BI_audit_ALL t2 on " . implode(" or ", $joins) . " where t1.ID = {$ID} and (t2.reffed = 1 or t2.ID > {$ID})";
|