Hello,
I am using
<?php
$sql = "Select tb.*, t.* from Models\ToyBox tb
LEFT JOIN Models\Toys t on t.tb_id = tb.id"
$query = $this->modelsManager->createQuery($sql);
$results = $query->execute();
$paginator = new \Phalcon\Paginator\Adapter\Model(
array(
"data" => $results,
"limit" => $per_page,
"page" => $page
)
);
$results = $paginator->getPaginate();
$records =
[
"per_page" => $per_page,
"current" => $results->current,
"first" => 1,
"before" => $results->before,
"next" => $results->next,
"last" => $results->last,
"total_pages" => $results->total_pages,
"total_items" => $results->total_items,
];
But I am getting the total items of Toys (total rows I guess?) instead of the Toy Boxes .
Any way to cure that?