|
|
@@ -382,33 +382,30 @@ function tblMsgsLoadMoreRows(n) {
|
|
|
break;
|
|
|
default: throw new Exception("Unknown filter type");
|
|
|
}
|
|
|
- $db = DB::getDB();
|
|
|
- $tableName = $db->_($tableName);
|
|
|
-
|
|
|
if ($lastMsgId > 0) {
|
|
|
$sqlWhereAddFilter .= "\n and m.`ID`<{$lastMsgId}";
|
|
|
}
|
|
|
$sqlLimit = $this->_listLimit + 1;
|
|
|
- $sql = "select m.*
|
|
|
+ $rawMsgs = DB::getPDO()->fetchAllByKey("
|
|
|
+ select m.*
|
|
|
from `CRM_UI_MSGS` m
|
|
|
- where m.`uiTargetType`='default_db_table_record'
|
|
|
- and m.`uiTargetName`='{$tableName}.{$idRow}'
|
|
|
+ where m.`uiTargetType` = 'default_db_table_record'
|
|
|
+ and m.`uiTargetName` = :feature_id
|
|
|
{$sqlWhereAddFilter}
|
|
|
order by m.`ID` DESC
|
|
|
limit {$sqlLimit}
|
|
|
- ";
|
|
|
- //DBG::_('DBG_MSGS', '>1', "sql", $sql, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
- $db = DB::getDB();
|
|
|
- $res = $db->query($sql);
|
|
|
- while ($r = $db->fetch($res)) {
|
|
|
- $msg['message'] = $r->msg;
|
|
|
- $msg['type'] = $r->msgType;
|
|
|
- $msg['_raw'] = $r;
|
|
|
- $msg['_read'] = ('WAITING' != $r->A_STATUS);
|
|
|
- $msg['_readDate'] = $r->actionExecutedTime;
|
|
|
- $msgsList[$r->ID] = $msg;
|
|
|
- }
|
|
|
- return $msgsList;
|
|
|
+ ", 'ID', [
|
|
|
+ ':feature_id' => "{$tableName}.{$idRow}"
|
|
|
+ ]);
|
|
|
+ return array_map(function ($msg) {
|
|
|
+ return [
|
|
|
+ 'message' => $msg['msg'],
|
|
|
+ 'type' => $msg['msgType'],
|
|
|
+ '_raw' => (object)$msg,
|
|
|
+ '_read' => ('WAITING' != $msg['A_STATUS']),
|
|
|
+ '_readDate' => $msg['actionExecutedTime'],
|
|
|
+ ];
|
|
|
+ }, $rawMsgs);
|
|
|
}
|
|
|
|
|
|
public function _validate($args) {
|