FuelPHP Bin
<?php // the count query $maxpage = \Config::get('application.setup.page.pagination_menu_all'); $config = array( 'pagination_url' => \Uri::current(), 'total_items' => \Model_Post::query()->related('categories')->where('categories.id', \Input::get('category'))->count(), 'per_page' => $maxpage, 'uri_segment' => 'page', ); $this->data['pagination'] = $pagination = \Pagination::forge('post_pagination', $config); // pagination log : protected config (Array, 13 elements) ↵ current_page : null offset (Integer): 0 per_page (String): "5" (1 characters) total_pages (Integer): 1 total_items (Integer): 3 num_links (Integer): 5 uri_segment (String): "page" (4 characters) show_first (Boolean): false show_last (Boolean): false pagination_url (String): "http://efxdesign.dev/media/admin/gallery" (40 characters) link_offset (Float): 0,5 default_page (String): "first" (5 characters) calculated_page (Integer): 1 // SQL Log : SELECT `t0`.`id` AS `t0_c0`, `t0`.`menu_id` AS `t0_c1`, `t0`.`key` AS `t0_c2`, `t0`.`value` AS `t0_c3`, `t0`.`created_at` AS `t0_c4`, `t0`.`updated_at` AS `t0_c5` FROM `project_menus_metadata` AS `t0` WHERE `t0`.`menu_id` = '11' Connection name: default Speed: 0.223 ms Query analysis: · Query: SIMPLE on t0 · Type: ALL · Rows: 451 (Using where) Call trace for this query: File: PKGPATH/orm/classes/query.php, line 1564 File: PKGPATH/orm/classes/hasmany.php, line 72 File: PKGPATH/orm/classes/model.php, line 1214 File: PKGPATH/orm/classes/model.php, line 1050 File: PKGPATH/orm/classes/model.php, line 2319 File: PKGPATH/orm/classes/model.php, line 1222 File: PKGPATH/orm/classes/model.php, line 1050 File: /Users/efxair/sites/clients/efxdesign/fuelphp/modules/media/classes/controller/backend/post.php, line 616 File: COREPATH/base56.php, line 37 File: COREPATH/classes/controller/hybrid.php, line 81 File: COREPATH/classes/request.php, line 483 File: DOCROOT/index.php, line 71 File: DOCROOT/index.php, line 92 // The query $posts = \Model_Post::query()->related('categories')->where('categories.id', \Input::get('category')) ->order_by($by, $desc) ->offset($pagination->offset) ->limit($pagination->per_page) ->get(); // Posts Log : SELECT COUNT(DISTINCT `t0`.`id`) AS count_result FROM `posts` AS `t0` LEFT JOIN `categories_posts` AS `t1_through` ON (`t0`.`id` = `t1_through`.`post_id`) LEFT JOIN `categories` AS `t1` ON (`t1_through`.`category_id` = `t1`.`id`) WHERE `t1`.`id` = '5' ORDER BY `t0`.`created_at` DESC Connection name: default Speed: 0.157 ms Query analysis: · Query: SIMPLE on t1 · Possible keys: PRIMARY · Key Used: PRIMARY · Type: const · Rows: 1 (Using index) · Query: SIMPLE on t1_through · Possible keys: PRIMARY · Key Used: PRIMARY · Type: ref · Rows: 2 (Using where; Using index) · Query: SIMPLE on t0 · Possible keys: PRIMARY · Key Used: PRIMARY · Type: eq_ref · Rows: 1 (Using where) Call trace for this query: File: PKGPATH/orm/classes/query.php, line 1676 File: /Users/efxair/sites/clients/efxdesign/fuelphp/modules/media/classes/controller/backend/post.php, line 660 File: COREPATH/base56.php, line 37 File: COREPATH/classes/controller/hybrid.php, line 81 File: COREPATH/classes/request.php, line 483 File: DOCROOT/index.php, line 71 File: DOCROOT/index.php, line 92