From a6f0eeb0edf27c82be4f9d35149d50bb177fb047 Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 23 Jun 2020 10:13:54 +0800 Subject: [PATCH] ComposerUpdate --- composer.lock | 8 ++++---- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- .../zoujingli/think-library/src/helper/DeleteHelper.php | 9 +++++++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index d4f597f3b..099a15ccb 100644 --- a/composer.lock +++ b/composer.lock @@ -929,12 +929,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "2fe569700bd8d7e2a24054f3592c5b06171c617c" + "reference": "c72947dcdfe84b488dd5721f65266a7c00e082c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/2fe569700bd8d7e2a24054f3592c5b06171c617c", - "reference": "2fe569700bd8d7e2a24054f3592c5b06171c617c", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c72947dcdfe84b488dd5721f65266a7c00e082c6", + "reference": "c72947dcdfe84b488dd5721f65266a7c00e082c6", "shasum": "", "mirrors": [ { @@ -978,7 +978,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-06-22T09:29:56+00:00" + "time": "2020-06-22T10:03:12+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index c5a59ff4b..936f231f8 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -955,12 +955,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "2fe569700bd8d7e2a24054f3592c5b06171c617c" + "reference": "c72947dcdfe84b488dd5721f65266a7c00e082c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/2fe569700bd8d7e2a24054f3592c5b06171c617c", - "reference": "2fe569700bd8d7e2a24054f3592c5b06171c617c", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c72947dcdfe84b488dd5721f65266a7c00e082c6", + "reference": "c72947dcdfe84b488dd5721f65266a7c00e082c6", "shasum": "", "mirrors": [ { @@ -976,7 +976,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-06-22T09:29:56+00:00", + "time": "2020-06-22T10:03:12+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index e2bb9b78d..edb99c7f1 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/helper/DeleteHelper.php b/vendor/zoujingli/think-library/src/helper/DeleteHelper.php index 1479cf564..8b2bd1fb0 100644 --- a/vendor/zoujingli/think-library/src/helper/DeleteHelper.php +++ b/vendor/zoujingli/think-library/src/helper/DeleteHelper.php @@ -65,14 +65,19 @@ class DeleteHelper extends Helper if (false === $this->controller->callback('_delete_filter', $this->query, $this->where)) { return null; } - // 执行删除操作 + // 组装执行数据 $data = []; if (method_exists($this->query, 'getTableFields')) { $fields = $this->query->getTableFields(); if (in_array('deleted', $fields)) $data['deleted'] = 1; if (in_array('is_deleted', $fields)) $data['is_deleted'] = 1; } - empty($this->where) or $this->query->where($this->where); + if (!empty($this->where)) $this->query->where($this->where); + // 阻止危险操作 + if (!$this->query->getOptions('where')) { + $this->controller->error(lang('think_library_delete_error')); + } + // 执行删除操作 $result = empty($data) ? $this->query->delete() : $this->query->update($data); // 结果回调处理 if (false === $this->controller->callback('_delete_result', $result)) {