mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 20:48:09 +08:00
fix: 分页器增加 db.event.page_count 事件
This commit is contained in:
parent
09d9869f5f
commit
6eeb9c6f0c
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user