Skip to content

Commit

Permalink
Merge pull request #2348 from bjrambo/pr/pointOutput
Browse files Browse the repository at this point in the history
포인트를 저장하는 부분에 적용여부를 확인하지 않는 문제 고침
  • Loading branch information
bnu committed Dec 10, 2018
2 parents 7f058e3 + a915dbc commit 9735e16
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions modules/point/point.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,25 @@ function setPoint($member_srl, $point, $mode = null)
$oDB->begin();

// If there are points, update, if no, insert
$oPointModel = getModel('point');
if($oPointModel->isExistsPoint($member_srl)) executeQuery("point.updatePoint", $args);
else executeQuery("point.insertPoint", $args);
if($current_point > 0)
{
$output = executeQuery("point.updatePoint", $args);
}
else
{
// 많은 동접시 넣는 과정에서 insert가 미리 이루어졌지만 이 공간으로 넘어올 경우 다시 한번 더 업데이트를 처리.
$output = executeQuery("point.insertPoint", $args);
if(!$output->toBool())
{
$output = executeQuery("point.updatePoint", $args);
}
}

if(!$output->toBool())
{
$oDB->rollback();
return $output;
}

// Get a new level
$level = $oPointModel->getLevel($point, $config->level_step);
Expand Down

0 comments on commit 9735e16

Please sign in to comment.