mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 07:11:42 +09:00
issue 148 if update group by admin, point should be updated too
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9853 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a59e1ec43a
commit
04a8e38201
1 changed files with 32 additions and 0 deletions
|
|
@ -1854,6 +1854,9 @@
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// if group is changed, point changed too.
|
||||
$this->_updatePointByGroup($orgMemberInfo->member_srl, $group_srl_list);
|
||||
}
|
||||
}
|
||||
// Call a trigger (after)
|
||||
|
|
@ -1980,5 +1983,34 @@
|
|||
executeQuery('member.deleteAutologin', $args);
|
||||
}
|
||||
}
|
||||
|
||||
function _updatePointByGroup($memberSrl, $groupSrlList)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$pointModuleConfig = $oModuleModel->getModuleConfig('point');
|
||||
$pointGroup = $pointModuleConfig->point_group;
|
||||
|
||||
if(is_array($pointGroup) && count($pointGroup)>0)
|
||||
{
|
||||
$levelGroup = array_flip($pointGroup);
|
||||
ksort($levelGroup);
|
||||
}
|
||||
$maxLevel = 0;
|
||||
$resultGroup = array_intersect($levelGroup, $groupSrlList);
|
||||
if(count($resultGroup) > 0)
|
||||
$maxLevel = max(array_flip($resultGroup));
|
||||
|
||||
if($maxLevel > 0)
|
||||
{
|
||||
$oPointModel = &getModel('point');
|
||||
$originPoint = $oPointModel->getPoint($memberSrl);
|
||||
|
||||
if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
|
||||
{
|
||||
$oPointController = &getController('point');
|
||||
$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue