mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
휴지통으로 이동시 알림이있는 회원들의 캐시를 삭제
This commit is contained in:
parent
b4b9546531
commit
13b69cbf38
3 changed files with 48 additions and 11 deletions
|
|
@ -446,14 +446,9 @@ class ncenterliteController extends ncenterlite
|
|||
$args = new stdClass();
|
||||
$args->srl = $obj->document_srl;
|
||||
$output = executeQuery('ncenterlite.deleteNotifyBySrl', $args);
|
||||
if($output->toBool())
|
||||
if(!$output->toBool())
|
||||
{
|
||||
//Remove flag files
|
||||
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($args->member_srl) . $args->member_srl . '.php';
|
||||
if(file_exists($flag_path))
|
||||
{
|
||||
FileHandler::removeFile($flag_path);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
|
@ -461,6 +456,17 @@ class ncenterliteController extends ncenterlite
|
|||
function triggerAfterMoveToTrash(&$obj)
|
||||
{
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$notify_list = $oNcenterliteModel->getNotifyListByDocumentSrl($obj->document_srl);
|
||||
|
||||
$member_srls = array();
|
||||
foreach($notify_list as $value)
|
||||
{
|
||||
if(!in_array($value->member_srl, $member_srls))
|
||||
{
|
||||
$member_srls = $value->member_srl;
|
||||
}
|
||||
}
|
||||
|
||||
$config = $oNcenterliteModel->getConfig();
|
||||
|
||||
if(empty($config->use))
|
||||
|
|
@ -473,11 +479,14 @@ class ncenterliteController extends ncenterlite
|
|||
$output = executeQuery('ncenterlite.deleteNotifyBySrl', $args);
|
||||
if($output->toBool())
|
||||
{
|
||||
//Remove flag files
|
||||
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($args->member_srl) . $args->member_srl . '.php';
|
||||
if(file_exists($flag_path))
|
||||
foreach($member_srls as $member_srl)
|
||||
{
|
||||
FileHandler::removeFile($flag_path);
|
||||
//Remove flag files
|
||||
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php';
|
||||
if(file_exists($flag_path))
|
||||
{
|
||||
FileHandler::removeFile($flag_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Object();
|
||||
|
|
|
|||
|
|
@ -457,4 +457,21 @@ class ncenterliteModel extends ncenterlite
|
|||
|
||||
return zdate($datetime, 'Y-m-d');
|
||||
}
|
||||
|
||||
function getNotifyListByDocumentSrl($document_srl = null)
|
||||
{
|
||||
if($document_srl === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQueryArray('ncenterlite.getNotifyListByDocumentSrl', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
11
modules/ncenterlite/queries/getNotifyListByDocumentSrl.xml
Normal file
11
modules/ncenterlite/queries/getNotifyListByDocumentSrl.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getNotifyListByDocumentSrl" action="select">
|
||||
<tables>
|
||||
<table name="ncenterlite_notify" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue