mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
fix #1662 임시 저장글을 삭제할 때에는 포인트 증감 처리를 하지 않도록 수정
임시 저장글 작성시에는 포인트가 주어지지 않는데, 글 삭제시에는 임시 저장글 여부와 상관없이 포인트를 차감합니다. 이를 수정합니다.
This commit is contained in:
parent
202e2367d4
commit
203d284a7a
1 changed files with 31 additions and 26 deletions
|
|
@ -187,32 +187,37 @@ class pointController extends point
|
||||||
*/
|
*/
|
||||||
function triggerDeleteDocument(&$obj)
|
function triggerDeleteDocument(&$obj)
|
||||||
{
|
{
|
||||||
$module_srl = $obj->module_srl;
|
$oDocumentModel = getModel('document');
|
||||||
$member_srl = $obj->member_srl;
|
|
||||||
// The process related to clearing the post object
|
|
||||||
if(!$module_srl || !$member_srl) return new Object();
|
|
||||||
// Run only when logged in
|
|
||||||
$logged_info = Context::get('logged_info');
|
|
||||||
if(!$logged_info->member_srl) return new Object();
|
|
||||||
// Get the points of the member
|
|
||||||
$oPointModel = getModel('point');
|
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
|
||||||
// Get the point module information
|
|
||||||
$oModuleModel = getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
|
||||||
|
|
||||||
$point = $module_config['insert_document'];
|
if($obj->status != $oDocumentModel->getConfigStatus('temp'))
|
||||||
if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
|
{
|
||||||
// if the point is set to decrease when writing a document, make sure it does not increase the points when deleting an article
|
$module_srl = $obj->module_srl;
|
||||||
if($point < 0) return new Object();
|
$member_srl = $obj->member_srl;
|
||||||
$cur_point -= $point;
|
// The process related to clearing the post object
|
||||||
// Add points related to deleting an attachment
|
if(!$module_srl || !$member_srl) return new Object();
|
||||||
$point = $module_config['upload_file'];
|
// Run only when logged in
|
||||||
if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
|
$logged_info = Context::get('logged_info');
|
||||||
if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
|
if(!$logged_info->member_srl) return new Object();
|
||||||
// Increase the point
|
// Get the points of the member
|
||||||
$this->setPoint($member_srl,$cur_point);
|
$oPointModel = getModel('point');
|
||||||
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
// Get the point module information
|
||||||
|
$oModuleModel = getModel('module');
|
||||||
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
|
$point = $module_config['insert_document'];
|
||||||
|
if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
|
||||||
|
// if the point is set to decrease when writing a document, make sure it does not increase the points when deleting an article
|
||||||
|
if($point < 0) return new Object();
|
||||||
|
$cur_point -= $point;
|
||||||
|
// Add points related to deleting an attachment
|
||||||
|
$point = $module_config['upload_file'];
|
||||||
|
if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
|
||||||
|
if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
|
||||||
|
// Increase the point
|
||||||
|
$this->setPoint($member_srl,$cur_point);
|
||||||
|
}
|
||||||
|
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue