|
@@ -730,7 +730,7 @@ class Data_Source {
|
|
|
|
|
|
|
|
public function getHistItems($id, $params = array()) {
|
|
public function getHistItems($id, $params = array()) {
|
|
|
$ret = array();
|
|
$ret = array();
|
|
|
- DBG::_('DBG_DS', '>1', "params", $params, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
|
|
+ DBG::log($params, 'array', "getHistItems({$id}, \$params)");
|
|
|
$sql_tbl = $this->_tbl . "_HIST";
|
|
$sql_tbl = $this->_tbl . "_HIST";
|
|
|
$sql_cols = $this->_getSqlCols();
|
|
$sql_cols = $this->_getSqlCols();
|
|
|
$sql_where = "t.`ID_USERS2`='{$id}'";
|
|
$sql_where = "t.`ID_USERS2`='{$id}'";
|
|
@@ -755,23 +755,19 @@ class Data_Source {
|
|
|
where {$sql_where}
|
|
where {$sql_where}
|
|
|
order by ID DESC
|
|
order by ID DESC
|
|
|
";
|
|
";
|
|
|
- DBG::_('DBG_DS', '>1', "sql", $sql, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
- $res = $this->getDB()->query($sql);
|
|
|
|
|
- while ($r = $this->getDB()->fetch($res)) {
|
|
|
|
|
- $r->_author = $r->A_RECORD_UPDATE_AUTHOR;
|
|
|
|
|
- $r->_created = $r->A_RECORD_UPDATE_DATE;
|
|
|
|
|
|
|
+ return array_map(function ($histRow) {
|
|
|
|
|
+ $histItem = (object)$histRow;
|
|
|
|
|
+ $histItem->_author = $histItem->A_RECORD_UPDATE_AUTHOR;
|
|
|
|
|
+ $histItem->_created = $histItem->A_RECORD_UPDATE_DATE;
|
|
|
|
|
|
|
|
- if (!$r->_author || $r->_author == 'N/S;') {
|
|
|
|
|
- $r->_author = $r->A_RECORD_CREATE_AUTHOR;
|
|
|
|
|
|
|
+ if (!$histItem->_author || $histItem->_author == 'N/S;') {
|
|
|
|
|
+ $histItem->_author = $histItem->A_RECORD_CREATE_AUTHOR;
|
|
|
}
|
|
}
|
|
|
- if (!$r->_created || $r->_created == 'N/S;') {
|
|
|
|
|
- $r->_created = $r->A_RECORD_CREATE_DATE;
|
|
|
|
|
|
|
+ if (!$histItem->_created || $histItem->_created == 'N/S;') {
|
|
|
|
|
+ $histItem->_created = $histItem->A_RECORD_CREATE_DATE;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- $ret[$r->ID] = $r;
|
|
|
|
|
- }
|
|
|
|
|
- DBG::_('DBG_DS', '>2', "ret", $ret, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
- return $ret;
|
|
|
|
|
|
|
+ return $histItem;
|
|
|
|
|
+ }, DB::getPDO()->fetchAllByKey($sql, $key = 'ID'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function get_total($params = array()) {// TODO: RMME
|
|
function get_total($params = array()) {// TODO: RMME
|