mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
코드 개선
This commit is contained in:
parent
d641e2cc0e
commit
c2b78f4468
2 changed files with 10 additions and 18 deletions
|
|
@ -133,8 +133,8 @@ class documentController extends document
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update Document Voted Cancel
|
* Update Document Voted Cancel
|
||||||
* @param stdClass $args
|
* @param int $document_srl
|
||||||
* @param stdClass $d_args
|
* @param Document $oDocument
|
||||||
* @param int $point
|
* @param int $point
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
|
|
@ -148,12 +148,12 @@ class documentController extends document
|
||||||
$d_args->member_srl = $logged_info->member_srl;
|
$d_args->member_srl = $logged_info->member_srl;
|
||||||
if($point > 0)
|
if($point > 0)
|
||||||
{
|
{
|
||||||
$args->voted_count = $oDocument->get('voted_count') - 1;
|
$args->voted_count = $oDocument->get('voted_count') - $point;
|
||||||
$output = executeQuery('document.updateVotedCount', $args);
|
$output = executeQuery('document.updateVotedCount', $args);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$args->blamed_count = $oDocument->get('blamed_count') + 1;
|
$args->blamed_count = $oDocument->get('blamed_count') - $point;
|
||||||
$output = executeQuery('document.updateBlamedCount', $args);
|
$output = executeQuery('document.updateBlamedCount', $args);
|
||||||
}
|
}
|
||||||
$d_output = executeQuery('document.deleteDocumentVotedLog', $d_args);
|
$d_output = executeQuery('document.deleteDocumentVotedLog', $d_args);
|
||||||
|
|
@ -1295,14 +1295,14 @@ class documentController extends document
|
||||||
{
|
{
|
||||||
$args->blamed_count = $oDocument->get('blamed_count') + $point;
|
$args->blamed_count = $oDocument->get('blamed_count') + $point;
|
||||||
// Leave in the session information
|
// Leave in the session information
|
||||||
$_SESSION['voted_document'][$document_srl] = -1;
|
$_SESSION['voted_document'][$document_srl] = $point;
|
||||||
$output = executeQuery('document.updateBlamedCount', $args);
|
$output = executeQuery('document.updateBlamedCount', $args);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$args->voted_count = $oDocument->get('voted_count') + $point;
|
$args->voted_count = $oDocument->get('voted_count') + $point;
|
||||||
// Leave in the session information
|
// Leave in the session information
|
||||||
$_SESSION['voted_document'][$document_srl] = 1;
|
$_SESSION['voted_document'][$document_srl] = $point;
|
||||||
$output = executeQuery('document.updateVotedCount', $args);
|
$output = executeQuery('document.updateVotedCount', $args);
|
||||||
}
|
}
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
|
||||||
|
|
@ -372,13 +372,9 @@ class documentItem extends Object
|
||||||
function getVoted()
|
function getVoted()
|
||||||
{
|
{
|
||||||
if(!$this->document_srl) return;
|
if(!$this->document_srl) return;
|
||||||
if($_SESSION['voted_document'][$this->document_srl] == '1')
|
if($_SESSION['voted_document'][$this->document_srl])
|
||||||
{
|
{
|
||||||
return 1;
|
return $_SESSION['voted_document'][$this->document_srl];
|
||||||
}
|
|
||||||
else if($_SESSION['voted_document'][$this->document_srl] == '-1')
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
|
|
@ -388,13 +384,9 @@ class documentItem extends Object
|
||||||
$args->document_srl = $this->document_srl;
|
$args->document_srl = $this->document_srl;
|
||||||
$output = executeQuery('document.getDocumentVotedLog', $args);
|
$output = executeQuery('document.getDocumentVotedLog', $args);
|
||||||
|
|
||||||
if($output->data->point === '1')
|
if($output->data->point)
|
||||||
{
|
{
|
||||||
return 1;
|
return $output->data->point;
|
||||||
}
|
|
||||||
else if($output->data->point === '-1')
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue