mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-04-22 16:31:56 +02:00
parent
83bc743d79
commit
0c72e5eec8
@ -50,13 +50,14 @@ abstract class AbstractMetricRepository
|
||||
/**
|
||||
* Get the table names prefix.
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
protected function getPrefix()
|
||||
{
|
||||
$driver = $this->config->get('database.default');
|
||||
$connection = $this->config->get('database.connections.'.$driver);
|
||||
$prefix = $connection['prefix'];
|
||||
|
||||
return $prefix;
|
||||
}
|
||||
|
||||
@ -68,17 +69,19 @@ abstract class AbstractMetricRepository
|
||||
protected function getTableName()
|
||||
{
|
||||
$prefix = $this->getPrefix();
|
||||
|
||||
return $prefix.'metrics';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the metric points table name.
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
protected function getMetricPointsTableName()
|
||||
{
|
||||
$prefix = $this->getPrefix();
|
||||
|
||||
return $prefix.'metric_points';
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac
|
||||
$timeInterval = $dateTime->format('YmdHi');
|
||||
$metricPointsTableName = $this->getMetricPointsTableName();
|
||||
|
||||
|
||||
if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
|
||||
$queryType = 'SUM(mp.`value` * mp.`counter`) AS `value`';
|
||||
} elseif ($metric->calc_type == Metric::CALC_AVG) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user