From 6eeb9c6f0c6ff511571afef2683c106248a77d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 12 Mar 2025 20:45:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=86=E9=A1=B5=E5=99=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20db.event.page=5Fcount=20=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/helper/PageHelper.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/think-library/src/helper/PageHelper.php b/plugin/think-library/src/helper/PageHelper.php index 8e14c16aa..b9dd40588 100644 --- a/plugin/think-library/src/helper/PageHelper.php +++ b/plugin/think-library/src/helper/PageHelper.php @@ -19,6 +19,7 @@ declare (strict_types=1); namespace think\admin\helper; use think\admin\Helper; +use think\admin\Library; use think\admin\service\AdminService; use think\db\BaseQuery; use think\db\Query; @@ -162,6 +163,7 @@ class PageHelper extends Helper if ($total === true || is_numeric($total)) return $total; [$query, $options] = [clone $query, $query->getOptions()]; if (isset($options['order'])) $query->removeOption('order'); + Library::$sapp->db->trigger('before_page_count', $query); if (empty($options['union'])) return $query->count(); $table = [$query->buildSql() => '_union_count_']; return $query->newQuery()->table($table)->count();