实现请求缓存1天。
This commit is contained in:
+11
-2
@@ -49,12 +49,21 @@ trait AggregateQuery
|
||||
}
|
||||
|
||||
$options = $this->getOptions();
|
||||
$subSql = $this->options($options)
|
||||
if (isset($options['cache'])) {
|
||||
$cache = $options['cache'];
|
||||
unset($options['cache']);
|
||||
}
|
||||
|
||||
$subSql = $this->options($options)
|
||||
->field('count(' . $field . ') AS think_count')
|
||||
->bind($this->bind)
|
||||
->buildSql();
|
||||
|
||||
$query = $this->newQuery()->table([$subSql => '_group_count_']);
|
||||
$query = $this->newQuery();
|
||||
if (isset($cache)) {
|
||||
$query->setOption('cache', $cache);
|
||||
}
|
||||
$query->table([$subSql => '_group_count_']);
|
||||
|
||||
$count = $query->aggregate('COUNT', '*');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user