From 7379406cb9cd72a1d43cb34dc6e94dea932814f1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 6 Jan 2025 11:30:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor(admin):=20=E4=BC=98=E5=8C=96=20ChangeL?= =?UTF-8?q?og=20=E5=88=97=E8=A1=A8=E7=9A=84=E6=90=9C=E7=B4=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 'url' 字段的搜索条件从 '=' 改为 '%like%',提高搜索灵活性 - 优化 'mark' 字段的搜索条件,使用 '%like%' 提升搜索体验 --- app/admin/lists/ChangeLogLists.php | 131 +++++++++++++++-------------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/app/admin/lists/ChangeLogLists.php b/app/admin/lists/ChangeLogLists.php index 28e0614d..b01da57c 100644 --- a/app/admin/lists/ChangeLogLists.php +++ b/app/admin/lists/ChangeLogLists.php @@ -1,66 +1,67 @@ - ['model', 'link_id', 'nums', 'pm', 'url'], - '%like%' => ['mark'], - ]; - } - - - /** - * @notes 获取列表 - * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - * @author admin - * @date 2025/01/06 10:03 - */ - public function lists(): array - { - return ChangeLog::where($this->searchWhere) - ->field(['id', 'model', 'link_id', 'nums', 'pm', 'url', 'mark']) - ->limit($this->limitOffset, $this->limitLength) - ->order(['id' => 'desc']) - ->select() - ->toArray(); - } - - - /** - * @notes 获取数量 - * @return int - * @author admin - * @date 2025/01/06 10:03 - */ - public function count(): int - { - return ChangeLog::where($this->searchWhere)->count(); - } - + ['model', 'link_id', 'nums', 'pm'], + '%like%' => ['mark','url'], + + ]; + } + + + /** + * @notes 获取列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2025/01/06 10:03 + */ + public function lists(): array + { + return ChangeLog::where($this->searchWhere) + ->field(['id', 'model', 'link_id', 'nums', 'pm', 'url', 'mark']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取数量 + * @return int + * @author admin + * @date 2025/01/06 10:03 + */ + public function count(): int + { + return ChangeLog::where($this->searchWhere)->count(); + } + } \ No newline at end of file