diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 807089f..42e6443 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -402,7 +402,11 @@ class MainController extends AppController { } $offset = ($page - 1) * $pageLimit; - $blocks = $this->Blocks->find()->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray(); + $currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'DESC'])->first(); + $blocks = $this->Blocks->find()->select( + ['Height', 'Difficulty', 'TransactionHashes', 'BlockSize', 'Nonce', 'BlockTime'] + )->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray(); + $this->set('currentBlock', $currentBlock); $this->set('blocks', $blocks); $this->set('pageLimit', $pageLimit); $this->set('numPages', $numPages); diff --git a/src/Template/Main/blocks.ctp b/src/Template/Main/blocks.ctp index a804c16..b662378 100644 --- a/src/Template/Main/blocks.ctp +++ b/src/Template/Main/blocks.ctp @@ -412,7 +412,7 @@