From d7d52fa5b9d845398731e072c5ccac9798b7ee63 Mon Sep 17 00:00:00 2001 From: walkor Date: Mon, 5 Dec 2022 21:30:44 +0800 Subject: [PATCH] save --- src/plugin/admin/app/controller/Crud.php | 2 +- .../admin/app/controller/UploadController.php | 3 ++ src/plugin/admin/config/process.php | 37 ------------------- 3 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 src/plugin/admin/config/process.php diff --git a/src/plugin/admin/app/controller/Crud.php b/src/plugin/admin/app/controller/Crud.php index d46b8c5..98b28d6 100644 --- a/src/plugin/admin/app/controller/Crud.php +++ b/src/plugin/admin/app/controller/Crud.php @@ -134,7 +134,7 @@ class Crud extends Base $model = $this->model; foreach ($where as $column => $value) { if (is_array($value)) { - if (in_array($value[0], ['>', '=', '<', '<>'])) { + if (in_array($value[0], ['>', '=', '<', '<>', 'like'])) { $model = $model->where($column, $value[0], $value[1]); } elseif ($value[0] == 'in') { $model = $model->whereIn($column, $value[1]); diff --git a/src/plugin/admin/app/controller/UploadController.php b/src/plugin/admin/app/controller/UploadController.php index 77f66bf..7670f52 100644 --- a/src/plugin/admin/app/controller/UploadController.php +++ b/src/plugin/admin/app/controller/UploadController.php @@ -56,6 +56,9 @@ class UploadController extends Crud if (!empty($where['ext']) && is_string($where['ext'])) { $where['ext'] = ['in', explode(',', $where['ext'])]; } + if (!empty($where['name']) && is_string($where['name'])) { + $where['name'] = ['like', "%{$where['name']}%"]; + } $query = $this->doSelect($where, $field, $order); return $this->doFormat($query, $format, $page_size); } diff --git a/src/plugin/admin/config/process.php b/src/plugin/admin/config/process.php deleted file mode 100644 index 580d468..0000000 --- a/src/plugin/admin/config/process.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @copyright walkor - * @link http://www.workerman.net/ - * @license http://www.opensource.org/licenses/mit-license.php MIT License - */ - -return []; -return [ - // File update detection and automatic reload - 'monitor' => [ - 'handler' => process\Monitor::class, - 'reloadable' => false, - 'constructor' => [ - // Monitor these directories - 'monitor_dir' => [ - app_path(), - config_path(), - base_path() . '/process', - base_path() . '/support', - base_path() . '/resource', - base_path() . '/.env', - ], - // Files with these suffixes will be monitored - 'monitor_extensions' => [ - 'php', 'html', 'htm', 'env' - ] - ] - ] -];