mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 05:42:13 +09:00
#410. trigger로 추천, 비추천에 따른 포인트 변동 기능 지원
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4194 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
75ff83f052
commit
296c181762
14 changed files with 100 additions and 4 deletions
|
|
@ -351,6 +351,41 @@
|
|||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 추천/비추천 시 포인트 적용
|
||||
**/
|
||||
|
||||
function triggerUpdateVotedCount(&$obj) {
|
||||
$module_srl = $obj->module_srl;
|
||||
$member_srl = $obj->member_srl;
|
||||
if(!$module_srl || !$member_srl) return new Object();
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
$oPointModel = &getModel('point');
|
||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||
|
||||
if( $obj->point > 0 )
|
||||
{
|
||||
$point = $config->module_point[$module_srl]['voted'];
|
||||
if(!isset($point)) $point = $config->voted;
|
||||
}
|
||||
else
|
||||
{
|
||||
$point = $config->module_point[$module_srl]['blamed'];
|
||||
if(!isset($point)) $point = $config->blamed;
|
||||
}
|
||||
|
||||
if(!$point) return new Object();
|
||||
|
||||
// 포인트 증감
|
||||
$cur_point += $point;
|
||||
$this->setPoint($member_srl,$cur_point);
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 포인트 설정
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue