mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-01-27 11:39:15 +00:00
create temp table ttreceiptid
This commit is contained in:
parent
3e777f987d
commit
88d7f252b6
|
|
@ -434,6 +434,39 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
}
|
||||
return $this->_ttcontentid;
|
||||
}
|
||||
elseif (!strcasecmp($tableName, "ttreceiptid")) {
|
||||
switch($this->_driver) {
|
||||
case 'sqlite':
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttreceiptid` AS ".
|
||||
"SELECT `tblDocumentReceiptLog`.`receiptID`, ".
|
||||
"MAX(`tblDocumentReceiptLog`.`receiptLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentReceiptLog` ".
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
break;
|
||||
default:
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttreceiptid` (PRIMARY KEY (`receiptID`), INDEX (`maxLogID`)) ".
|
||||
"SELECT `tblDocumentReceiptLog`.`receiptID`, ".
|
||||
"MAX(`tblDocumentReceiptLog`.`receiptLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentReceiptLog` ".
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
}
|
||||
if (!$this->_ttreceiptid) {
|
||||
if (!$this->getResult($queryStr))
|
||||
return false;
|
||||
$this->_ttreceiptid=true;
|
||||
}
|
||||
else {
|
||||
if (is_bool($override) && $override) {
|
||||
if (!$this->getResult("DELETE FROM `ttreceiptid`"))
|
||||
return false;
|
||||
if (!$this->getResult($queryStr))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $this->_ttreceiptid;
|
||||
}
|
||||
return false;
|
||||
} /* }}} */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user