|
|
@@ -80,7 +80,10 @@ class BxNtfsDb extends BxBaseModNotificationsDb
|
|
|
$oConnection = BxDolConnection::getObjectInstance($this->_oConfig->getObject('conn_subscriptions'));
|
|
|
|
|
|
$aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sPrefix . "events", 'owner_id', $aParams['owner_id']);
|
|
|
- $sJoinClause .= ' ' . $aQueryParts['join'];
|
|
|
+ if(!empty($aQueryParts['join']))
|
|
|
+ $sJoinClause .= ' ' . $aQueryParts['join'];
|
|
|
+ if(!empty($aQueryParts['fields']['added']))
|
|
|
+ $sWhereClause .= "AND `{$this->_sTable}`.`date` > " . $aQueryParts['fields']['added'];
|
|
|
|
|
|
$sWhereClause .= "AND `{$this->_sTable}`.`action` <> 'replyPost' ";
|
|
|
break;
|
|
|
@@ -89,7 +92,10 @@ class BxNtfsDb extends BxBaseModNotificationsDb
|
|
|
$oConnection = BxDolConnection::getObjectInstance($this->_oConfig->getObject('conn_subscriptions'));
|
|
|
|
|
|
$aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sPrefix . "events", 'owner_id', $aParams['owner_id']);
|
|
|
- $sJoinClause .= ' ' . str_replace('INNER', 'LEFT', $aQueryParts['join']);
|
|
|
+ if(!empty($aQueryParts['join']))
|
|
|
+ $sJoinClause .= ' ' . str_replace('INNER', 'LEFT', $aQueryParts['join']);
|
|
|
+ if(!empty($aQueryParts['fields']['added']))
|
|
|
+ $sWhereClause .= "AND `{$this->_sTable}`.`date` > " . $aQueryParts['fields']['added'];
|
|
|
|
|
|
$sWhereClause .= $this->prepareAsString("AND ((NOT ISNULL(`c`.`content`) AND `{$this->_sTable}`.`action` <> 'replyPost') || (`{$this->_sTable}`.`owner_id` <> `{$this->_sTable}`.`object_owner_id` AND `{$this->_sTable}`.`object_owner_id`=?)) ", $aParams['owner_id']);
|
|
|
break;
|