File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ public function getNbResults(): int
57
57
*/
58
58
public function getSlice (int $ offset , int $ length ): iterable
59
59
{
60
- $ sql = 'SELECT * FROM ( ' . $ this ->getConversationsQuery () . ') m ' ;
60
+ $ sql = 'SELECT *, i.id, r.id, s.id FROM ( ' . $ this ->getConversationsQuery () . ') m ' ;
61
+ $ sql .= ' JOIN members i ON m.initiator_id = i.id ' ;
62
+ $ sql .= ' JOIN members r ON m.IdReceiver = r.id ' ;
63
+ $ sql .= ' JOIN members s ON m.IdSender = s.id ' ;
61
64
$ sql .= ' ORDER BY `m`.`created` DESC LIMIT ' . $ length . ' OFFSET ' . $ offset ;
62
65
63
66
$ query = $ this ->entityManager ->createNativeQuery ($ sql , new MessageResultSetMapping ())
@@ -121,7 +124,7 @@ protected function getInitiatorCondition(): string
121
124
122
125
protected function getNotSpamCondition (): string
123
126
{
124
- return 'InFolder <> \'' . InFolderType::SPAM . '\'' ;
127
+ return '(m.initiator_id <> :memberId AND InFolder <> \'' . InFolderType::SPAM . '\') ' ;
125
128
}
126
129
127
130
abstract protected function getConversationsQuery (): string ;
Original file line number Diff line number Diff line change @@ -42,6 +42,6 @@ protected function getConversationsQuery(): string
42
42
43
43
private function getSpamCondition (): string
44
44
{
45
- return 'SpamInfo LIKE \'% ' . SpamInfoType::MEMBER_SAYS_SPAM . '% \' AND InFolder = \'' . InFolderType::SPAM . '\'' ;
45
+ return '( SpamInfo LIKE \'% ' . SpamInfoType::MEMBER_SAYS_SPAM . '% \'SpamInfo LIKE \' % ' . SpamInfoType:: SPAM_BLOCKED_WORD . ' % \' ) OR AND InFolder = \'' . InFolderType::SPAM . '\'' ;
46
46
}
47
47
}
You can’t perform that action at this time.
0 commit comments