ComposerUpdate

This commit is contained in:
邹景立 2021-06-25 18:25:37 +08:00
parent 9e41e91010
commit 7a248e66f6
4 changed files with 20 additions and 30 deletions

View File

@ -853,12 +853,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "b77d3be5faf647d05827c831a069509175126d13" "reference": "d24cae2f0ba60e6e2067e232a2baffd8cf67a4ee"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b77d3be5faf647d05827c831a069509175126d13", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d24cae2f0ba60e6e2067e232a2baffd8cf67a4ee",
"reference": "b77d3be5faf647d05827c831a069509175126d13", "reference": "d24cae2f0ba60e6e2067e232a2baffd8cf67a4ee",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -875,7 +875,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2021-06-25T04:07:35+00:00", "time": "2021-06-25T10:23:11+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {

View File

@ -5,7 +5,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '04d0cd8563af49737965f1567d8d569e800a9eeb', 'reference' => '9e41e91010789c2b2c3556ff002e9e190202da39',
'name' => 'zoujingli/thinkadmin', 'name' => 'zoujingli/thinkadmin',
'dev' => false, 'dev' => false,
), ),
@ -144,7 +144,7 @@
'aliases' => array( 'aliases' => array(
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => 'b77d3be5faf647d05827c831a069509175126d13', 'reference' => 'd24cae2f0ba60e6e2067e232a2baffd8cf67a4ee',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'zoujingli/thinkadmin' => array( 'zoujingli/thinkadmin' => array(
@ -153,7 +153,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '04d0cd8563af49737965f1567d8d569e800a9eeb', 'reference' => '9e41e91010789c2b2c3556ff002e9e190202da39',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'zoujingli/wechat-developer' => array( 'zoujingli/wechat-developer' => array(

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2021-06-25 12:08:14 // This file is automatically generated at:2021-06-25 18:25:22
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -63,35 +63,25 @@ class PageHelper extends Helper
} }
// 列表分页及结果集处理 // 列表分页及结果集处理
if ($page) { if ($page) {
if (empty($limit)) { if ($limit <= 1) {
$limit = $this->app->request->get('limit', $this->app->cookie->get('limit', 20)); $limit = $this->app->request->get('limit', $this->app->cookie->get('limit', 20));
if (intval($this->app->request->get('not_cache_limit', 0)) < 1) { 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); $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) { [$data, $opts] = [$pager->toArray(), ''];
[$query['limit'], $query['page'], $selects] = [$num, 1, $limit === $num ? 'selected' : '']; foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] as $num) {
if (stripos($this->app->request->get('spm', '-'), 'm-') === 0) { $url = $this->app->request->baseUrl() . '?' . urldecode(http_build_query(array_merge($query, ['limit' => $num, 'page' => 1])));
$url = sysuri('admin/index/index') . '#' . $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query)); $opts .= sprintf('<option data-num="%d" value="%s" %s>%d</option>', $num, $url, $limit === $num ? 'selected' : '', $num);
} else {
$url = $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query));
}
$options .= "<option data-num='{$num}' value='{$url}' {$selects}>{$num}</option>";
} }
$selects = "<select onchange='location.href=this.options[this.selectedIndex].value' data-auto-none>{$options}</select>"; $select = "<select onchange='location.href=this.options[this.selectedIndex].value'>{$opts}</select>";
$pagetext = lang('think_library_page_html', [$pager->total(), $selects, $pager->lastPage(), $pager->currentPage()]); $pagehtml = lang('think_library_page_html', [$data['total'], $select, $data['last_page'], $data['current_page']]);
$pagehtml = "<div class='pagination-container nowrap'><span>{$pagetext}</span>{$pager->render()}</div>"; $this->class->assign('pagehtml', "<div class='pagination-container nowrap'><span>{$pagehtml}</span>{$pager->render()}</div>");
if (stripos($this->app->request->get('spm', '-'), 'm-') === 0) { $result = ['page' => ['limit' => $data['per_page'], 'total' => $data['total'], 'pages' => $data['last_page'], 'current' => $data['current_page']], 'list' => $data['data']];
$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()];
} else { } else {
$pager = $this->query->select(); $result = ['list' => $this->query->select()->toArray()];
$result = ['page' => ['limit' => $pager->count(), 'total' => 1, 'pages' => 1, 'current' => 1], 'list' => $pager->toArray()];
} }
if (false !== $this->class->callback('_page_filter', $result['list']) && $display) { if (false !== $this->class->callback('_page_filter', $result['list']) && $display) {
if ($this->app->request->get('output') === 'json') { if ($this->app->request->get('output') === 'json') {