create temp table ttreceiptid before using it

This commit is contained in:
Uwe Steinmann 2018-02-13 18:32:01 +01:00
parent 6ad630edf4
commit 795ca98b8f

View File

@ -3894,6 +3894,9 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* of records and join the other tables. ttreceiptid join tblDocumentRecipients
* is faster than tblDocumentRecipients join ttreceiptid
*/
if (!$db->createTemporaryTable("ttreceiptid")) {
return false;
}
$queryStr=
"SELECT `tblDocumentRecipients`.*, `tblDocumentReceiptLog`.`receiptLogID`, `tblDocumentReceiptLog`.`status`, `tblDocumentReceiptLog`.`comment`, `tblDocumentReceiptLog`.`date`, `tblDocumentReceiptLog`.`userID`, `tblUsers`.`fullName`, `tblGroups`.`name` FROM `ttreceiptid` LEFT JOIN `tblDocumentRecipients` ON `tblDocumentRecipients`.`receiptID`=`ttreceiptid`.`receiptID` LEFT JOIN `tblDocumentReceiptLog` ON `ttreceiptid`.`maxLogID`=`tblDocumentReceiptLog`.`receiptLogID` LEFT JOIN `tblUsers` ON `tblDocumentRecipients`.`required`=`tblUsers`.`id` LEFT JOIN `tblGroups` ON `tblDocumentRecipients`.`required`=`tblGroups`.`id` WHERE `version`='".$this->_version
."' AND `documentID` = '". $this->_document->getID() ."' ";