diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 903423327..c1a10eea9 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -853,12 +853,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "b77d3be5faf647d05827c831a069509175126d13" + "reference": "d24cae2f0ba60e6e2067e232a2baffd8cf67a4ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b77d3be5faf647d05827c831a069509175126d13", - "reference": "b77d3be5faf647d05827c831a069509175126d13", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d24cae2f0ba60e6e2067e232a2baffd8cf67a4ee", + "reference": "d24cae2f0ba60e6e2067e232a2baffd8cf67a4ee", "shasum": "", "mirrors": [ { @@ -875,7 +875,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2021-06-25T04:07:35+00:00", + "time": "2021-06-25T10:23:11+00:00", "default-branch": true, "type": "library", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index b82e76b00..342d3c4e5 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '04d0cd8563af49737965f1567d8d569e800a9eeb', + 'reference' => '9e41e91010789c2b2c3556ff002e9e190202da39', 'name' => 'zoujingli/thinkadmin', 'dev' => false, ), @@ -144,7 +144,7 @@ 'aliases' => array( 0 => '9999999-dev', ), - 'reference' => 'b77d3be5faf647d05827c831a069509175126d13', + 'reference' => 'd24cae2f0ba60e6e2067e232a2baffd8cf67a4ee', 'dev_requirement' => false, ), 'zoujingli/thinkadmin' => array( @@ -153,7 +153,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '04d0cd8563af49737965f1567d8d569e800a9eeb', + 'reference' => '9e41e91010789c2b2c3556ff002e9e190202da39', 'dev_requirement' => false, ), 'zoujingli/wechat-developer' => array( diff --git a/vendor/services.php b/vendor/services.php index 74478d0d6..5f563f41c 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/helper/PageHelper.php b/vendor/zoujingli/think-library/src/helper/PageHelper.php index b3128db08..fbe6bb0d6 100644 --- a/vendor/zoujingli/think-library/src/helper/PageHelper.php +++ b/vendor/zoujingli/think-library/src/helper/PageHelper.php @@ -63,35 +63,25 @@ class PageHelper extends Helper } // 列表分页及结果集处理 if ($page) { - if (empty($limit)) { + if ($limit <= 1) { $limit = $this->app->request->get('limit', $this->app->cookie->get('limit', 20)); if (intval($this->app->request->get('not_cache_limit', 0)) < 1) { - $this->app->cookie->set('limit', ($limit = intval($limit >= 10 ? $limit : 20)) . ''); + $this->app->cookie->set('limit', ($limit = intval($limit >= 5 ? $limit : 20)) . ''); } } - [$options, $query] = ['', $this->app->request->get()]; + $query = $this->app->request->get(); $pager = $this->query->paginate(['list_rows' => $limit, 'query' => $query], $total); - foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 300, 400, 500, 600] as $num) { - [$query['limit'], $query['page'], $selects] = [$num, 1, $limit === $num ? 'selected' : '']; - if (stripos($this->app->request->get('spm', '-'), 'm-') === 0) { - $url = sysuri('admin/index/index') . '#' . $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query)); - } else { - $url = $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query)); - } - $options .= ""; + [$data, $opts] = [$pager->toArray(), '']; + foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] as $num) { + $url = $this->app->request->baseUrl() . '?' . urldecode(http_build_query(array_merge($query, ['limit' => $num, 'page' => 1]))); + $opts .= sprintf('', $num, $url, $limit === $num ? 'selected' : '', $num); } - $selects = ""; - $pagetext = lang('think_library_page_html', [$pager->total(), $selects, $pager->lastPage(), $pager->currentPage()]); - $pagehtml = "
{$pagetext}{$pager->render()}
"; - if (stripos($this->app->request->get('spm', '-'), 'm-') === 0) { - $this->class->assign('pagehtml', preg_replace('|href="(.*?)"|', 'data-open="$1" onclick="return false" href="$1"', $pagehtml)); - } else { - $this->class->assign('pagehtml', $pagehtml); - } - $result = ['page' => ['limit' => $limit, 'total' => $pager->total(), 'pages' => $pager->lastPage(), 'current' => $pager->currentPage()], 'list' => $pager->items()]; + $select = ""; + $pagehtml = lang('think_library_page_html', [$data['total'], $select, $data['last_page'], $data['current_page']]); + $this->class->assign('pagehtml', "
{$pagehtml}{$pager->render()}
"); + $result = ['page' => ['limit' => $data['per_page'], 'total' => $data['total'], 'pages' => $data['last_page'], 'current' => $data['current_page']], 'list' => $data['data']]; } else { - $pager = $this->query->select(); - $result = ['page' => ['limit' => $pager->count(), 'total' => 1, 'pages' => 1, 'current' => 1], 'list' => $pager->toArray()]; + $result = ['list' => $this->query->select()->toArray()]; } if (false !== $this->class->callback('_page_filter', $result['list']) && $display) { if ($this->app->request->get('output') === 'json') {