mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-19 19:09:13 -04:00
Convert another Database::instance() query over to using db::build()
This commit is contained in:
@@ -96,11 +96,12 @@ class Admin_Comments_Controller extends Admin_Controller {
|
||||
$counts->published = 0;
|
||||
$counts->spam = 0;
|
||||
$counts->deleted = 0;
|
||||
foreach (Database::instance()
|
||||
->select("state", "count(*) as c")
|
||||
foreach (db::build()
|
||||
->select("state")
|
||||
->select(array("c" => 'COUNT("*")'))
|
||||
->from("comments")
|
||||
->groupby("state")
|
||||
->get() as $row) {
|
||||
->group_by("state")
|
||||
->execute() as $row) {
|
||||
$counts->{$row->state} = $row->c;
|
||||
}
|
||||
return $counts;
|
||||
|
||||
Reference in New Issue
Block a user