瀏覽代碼

ComposerUpdate

邹景立 3 年之前
父節點
當前提交
7a248e66f6

+ 4 - 4
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": {

+ 3 - 3
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(

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?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);
 return array (
   0 => 'think\\admin\\Library',

+ 12 - 22
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 .= "<option data-num='{$num}' value='{$url}' {$selects}>{$num}</option>";
-            }
-            $selects = "<select onchange='location.href=this.options[this.selectedIndex].value' data-auto-none>{$options}</select>";
-            $pagetext = lang('think_library_page_html', [$pager->total(), $selects, $pager->lastPage(), $pager->currentPage()]);
-            $pagehtml = "<div class='pagination-container nowrap'><span>{$pagetext}</span>{$pager->render()}</div>";
-            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);
+            [$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('<option data-num="%d" value="%s" %s>%d</option>', $num, $url, $limit === $num ? 'selected' : '', $num);
             }
-            $result = ['page' => ['limit' => $limit, 'total' => $pager->total(), 'pages' => $pager->lastPage(), 'current' => $pager->currentPage()], 'list' => $pager->items()];
+            $select = "<select onchange='location.href=this.options[this.selectedIndex].value'>{$opts}</select>";
+            $pagehtml = lang('think_library_page_html', [$data['total'], $select, $data['last_page'], $data['current_page']]);
+            $this->class->assign('pagehtml', "<div class='pagination-container nowrap'><span>{$pagehtml}</span>{$pager->render()}</div>");
+            $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') {