From 242d670b5ab8282df0aa0a3ab00c01064ccb882b Mon Sep 17 00:00:00 2001 From: jianglei Date: Thu, 19 Jan 2023 11:41:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96Table.api.replaceurl?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0ids=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/require-table.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index 807edeba..1da5b209 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -914,7 +914,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table row.ids = ids ? ids : (typeof row.ids !== 'undefined' ? row.ids : 0); url = url == null || url.length === 0 ? '' : url.toString(); //自动添加ids参数 - url = !url.match(/\{ids\}/i) ? url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + '{ids}' : url; + url = !url.match(/(?=([?&]ids=)|(\/ids\/)|(\{ids}))/i) ? + url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + '{ids}' : url; url = url.replace(/\{(.*?)\}/gi, function (matched) { matched = matched.substring(1, matched.length - 1); if (matched.indexOf(".") !== -1) { -- Gitee From 9f1c1db03c382a451ea075258d1637aaf708c5a1 Mon Sep 17 00:00:00 2001 From: bran <765134355@qq.com> Date: Fri, 10 Feb 2023 15:44:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=B3=E8=81=94=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E4=B8=8B=E6=97=B6=E9=97=B4=E6=97=A0=E6=B3=95=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=9A=84BUG=EF=BC=8C=E4=BB=85=E5=9C=A8=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E4=B8=8B=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Backend.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index b70eede8..0704654b 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -397,7 +397,8 @@ class Backend extends Controller $arr = $arr[0]; } $tableArr = explode('.', $k); - if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias) && !empty($this->model)) { + if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias) + && !empty($this->model) && $this->relationSearch) { //修复关联模型下时间无法搜索的BUG $relation = Loader::parseName($tableArr[0], 1, false); $alias[$this->model->$relation()->getTable()] = $tableArr[0]; -- Gitee