mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 23:00:51 +03:00
fix #470 - В поиск по личке кроме поля "Отправитель" добавить поле "Получатель"
This commit is contained in:
parent
3a51459ab7
commit
222d9ba80f
|
@ -291,6 +291,12 @@ class ActionTalk extends Action {
|
|||
if($sender=getRequest('sender') and is_string($sender)){
|
||||
$aFilter['user_login']=urldecode($sender);
|
||||
}
|
||||
/**
|
||||
* Отправитель
|
||||
*/
|
||||
if($sReceiver=urldecode(getRequestStr('receiver')) and $oUserReceiver=$this->User_GetUserByLogin($sReceiver)){
|
||||
$aFilter['receiver_user_id']=$oUserReceiver->getId();
|
||||
}
|
||||
/**
|
||||
* Искать только в избранных письмах
|
||||
*/
|
||||
|
|
|
@ -424,6 +424,16 @@ class ModuleTalk_MapperTalk extends Mapper {
|
|||
{ AND t.talk_text LIKE ? }
|
||||
{ AND u.user_login = ? }
|
||||
{ AND t.user_id = ? }
|
||||
{ AND tu.talk_id IN (
|
||||
SELECT stu.talk_id
|
||||
FROM
|
||||
".Config::Get('db.table.talk_user')." as stu,
|
||||
".Config::Get('db.table.talk')." as st
|
||||
WHERE
|
||||
stu.user_id = ?d
|
||||
AND stu.talk_id = st.talk_id
|
||||
AND st.user_id != stu.user_id
|
||||
) }
|
||||
ORDER BY t.talk_date_last desc, t.talk_date desc
|
||||
LIMIT ?d, ?d
|
||||
";
|
||||
|
@ -443,6 +453,7 @@ class ModuleTalk_MapperTalk extends Mapper {
|
|||
(!empty($aFilter['text_like']) ? $aFilter['text_like'] : DBSIMPLE_SKIP),
|
||||
(!empty($aFilter['user_login']) ? $aFilter['user_login'] : DBSIMPLE_SKIP),
|
||||
(!empty($aFilter['sender_id']) ? $aFilter['sender_id'] : DBSIMPLE_SKIP),
|
||||
(!empty($aFilter['receiver_user_id']) ? $aFilter['receiver_user_id'] : DBSIMPLE_SKIP),
|
||||
($iCurrPage-1)*$iPerPage,
|
||||
$iPerPage
|
||||
)
|
||||
|
|
|
@ -374,6 +374,10 @@ return array(
|
|||
'label' => 'Отправитель',
|
||||
'note' => 'Укажите логин отправителя'
|
||||
),
|
||||
'receiver' => array(
|
||||
'label' => 'Получатель',
|
||||
'note' => 'Укажите логин получателя'
|
||||
),
|
||||
'keyword' => array(
|
||||
'label' => 'Искать в заголовке',
|
||||
),
|
||||
|
|
|
@ -12,7 +12,14 @@
|
|||
sName = 'sender'
|
||||
sLabel = $aLang.messages.search.fields.sender.label
|
||||
sNote = $aLang.messages.search.fields.sender.note
|
||||
sClasses = 'width-full autocomplete-users-sep'}
|
||||
sInputClasses = 'width-full autocomplete-users'}
|
||||
|
||||
{* Получатель *}
|
||||
{include 'components/field/field.text.tpl'
|
||||
sName = 'receiver'
|
||||
sLabel = $aLang.messages.search.fields.receiver.label
|
||||
sNote = $aLang.messages.search.fields.receiver.note
|
||||
sInputClasses = 'width-full autocomplete-users'}
|
||||
|
||||
{* Искать в заголовке *}
|
||||
{include 'components/field/field.text.tpl'
|
||||
|
|
Loading…
Reference in a new issue