mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
fix sql to retrieve attachments
This commit is contained in:
parent
32d484a924
commit
606effb759
|
@ -1769,7 +1769,15 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
if (!isset($this->_documentFiles)) {
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id." ORDER BY `date` DESC";
|
||||
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id;
|
||||
if($version) {
|
||||
$queryStr .= " AND (`version`=0 OR `version`=".(int) $version.")";
|
||||
}
|
||||
$queryStr .= " ORDER BY ";
|
||||
if($version) {
|
||||
$queryStr .= "`version` DESC,";
|
||||
}
|
||||
$queryStr .= "`date` DESC";
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && !$resArr) return false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user