mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Merge branch 'pr/703' into develop
This commit is contained in:
commit
256c68a4ee
2 changed files with 9 additions and 7 deletions
|
|
@ -546,7 +546,7 @@ class DB
|
|||
* @param array $arg_columns column list. if you want get specific colums from executed result, add column list to $arg_columns
|
||||
* @return object result of query
|
||||
*/
|
||||
function executeQuery($query_id, $args = NULL, $arg_columns = NULL)
|
||||
function executeQuery($query_id, $args = NULL, $arg_columns = NULL, $type = NULL)
|
||||
{
|
||||
static $cache_file = array();
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ class DB
|
|||
// look for cache file
|
||||
$cache_file[$query_id] = $this->checkQueryCacheFile($query_id, $xml_file);
|
||||
}
|
||||
$result = $this->_executeQuery($cache_file[$query_id], $args, $query_id, $arg_columns);
|
||||
$result = $this->_executeQuery($cache_file[$query_id], $args, $query_id, $arg_columns, $type);
|
||||
|
||||
$this->actDBClassFinish();
|
||||
// execute query
|
||||
|
|
@ -643,9 +643,11 @@ class DB
|
|||
* @param array $arg_columns column list. if you want get specific colums from executed result, add column list to $arg_columns
|
||||
* @return object result of query
|
||||
*/
|
||||
function _executeQuery($cache_file, $source_args, $query_id, $arg_columns)
|
||||
function _executeQuery($cache_file, $source_args, $query_id, $arg_columns, $type)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if(!in_array($type, array('master','slave'))) $type = 'slave';
|
||||
|
||||
if(!file_exists($cache_file))
|
||||
{
|
||||
|
|
@ -683,7 +685,7 @@ class DB
|
|||
case 'select' :
|
||||
$arg_columns = is_array($arg_columns) ? $arg_columns : array();
|
||||
$output->setColumnList($arg_columns);
|
||||
$connection = $this->_getConnection('slave');
|
||||
$connection = $this->_getConnection($type);
|
||||
$output = $this->_executeSelectAct($output, $connection);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class commentModel extends comment
|
|||
{
|
||||
$args = new stdClass();
|
||||
$args->comment_srl = $comment_srl;
|
||||
$output = executeQuery('comment.getChildCommentCount', $args);
|
||||
$output = executeQuery('comment.getChildCommentCount', $args, NULL, 'master');
|
||||
return (int) $output->data->count;
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ class commentModel extends comment
|
|||
{
|
||||
$args = new stdClass();
|
||||
$args->comment_srl = $comment_srl;
|
||||
$output = executeQueryArray('comment.getChildComments', $args);
|
||||
$output = executeQueryArray('comment.getChildComments', $args, NULL, 'master');
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ class commentModel extends comment
|
|||
$args->status = 1;
|
||||
}
|
||||
|
||||
$output = executeQuery('comment.getCommentCount', $args);
|
||||
$output = executeQuery('comment.getCommentCount', $args, NULL, 'master');
|
||||
$total_count = $output->data->count;
|
||||
|
||||
return (int) $total_count;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue