From ff8b20a4b9e1138f1407f1a21bcfe2646b26d0b6 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Sat, 11 Nov 2023 11:23:51 +0800 Subject: [PATCH] Update Ajax.php --- app/admin/controller/Ajax.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/admin/controller/Ajax.php b/app/admin/controller/Ajax.php index 4338506..21a231b 100644 --- a/app/admin/controller/Ajax.php +++ b/app/admin/controller/Ajax.php @@ -175,11 +175,7 @@ class Ajax extends AdminController return $this->error($e->getMessage()); } case 'listImage': - $res = (new SystemUploadfile())->order($this->sort)->limit(100)->column('url'); - $list = []; - array_map(function ($value) use (&$list) { - $list[] = ['url' => $value,]; - }, $res); + $list = (new SystemUploadfile())->order($this->sort)->limit(100)->field('url')->select()->toArray(); $result = [ "state" => "SUCCESS", "list" => $list,