From 88735f590efee8ef8e8ec80507e0e8c236341a34 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sun, 14 Aug 2022 23:55:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=95=86=E5=93=81=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8=E3=80=81=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Plugins.php | 5 +++++ app/admin/form/Warehousegoods.php | 1 + app/index/controller/Plugins.php | 5 +++++ app/install/view/index/create.html | 2 +- app/module/FormHandleModule.php | 8 +++++++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/admin/controller/Plugins.php b/app/admin/controller/Plugins.php index 422061774..50c116a15 100755 --- a/app/admin/controller/Plugins.php +++ b/app/admin/controller/Plugins.php @@ -195,6 +195,11 @@ class Plugins extends Common MyViewAssign('plugins_css', file_exists(ROOT_PATH.'static'.DS.$plugins_css) ? $plugins_css : ''); $plugins_js = $module_name.DS.'js'.DS.$plugins_name.DS.$group.DS.'common.js'; MyViewAssign('plugins_js', file_exists(ROOT_PATH.'static'.DS.$plugins_js) ? $plugins_js : ''); + + // 列表数据 + MyViewAssign('data_total', $this->data_total); + MyViewAssign('data_list', $this->data_list); + MyViewAssign('data', $this->data_detail); } } ?> \ No newline at end of file diff --git a/app/admin/form/Warehousegoods.php b/app/admin/form/Warehousegoods.php index 9ad194418..12f1e8dcd 100644 --- a/app/admin/form/Warehousegoods.php +++ b/app/admin/form/Warehousegoods.php @@ -171,6 +171,7 @@ class WarehouseGoods 'select_field' => 'wg.*', 'order_by' => 'wg.id desc', 'group' => 'wg.id', + 'distinct' => 'wg.id', 'detail_dkey' => 'wg.id', 'data_handle' => 'WarehouseGoodsService::WarehouseGoodsListHandle', 'is_page' => 1, diff --git a/app/index/controller/Plugins.php b/app/index/controller/Plugins.php index 456f93323..489cfd5a8 100755 --- a/app/index/controller/Plugins.php +++ b/app/index/controller/Plugins.php @@ -162,6 +162,11 @@ class Plugins extends Common MyViewAssign('plugins_css', file_exists(ROOT_PATH.'static'.DS.$plugins_css) ? $plugins_css : ''); $plugins_js = $module_name.DS.'js'.DS.$plugins_name.DS.$group.DS.'common.js'; MyViewAssign('plugins_js', file_exists(ROOT_PATH.'static'.DS.$plugins_js) ? $plugins_js : ''); + + // 列表数据 + MyViewAssign('data_total', $this->data_total); + MyViewAssign('data_list', $this->data_list); + MyViewAssign('data', $this->data_detail); } } ?> \ No newline at end of file diff --git a/app/install/view/index/create.html b/app/install/view/index/create.html index 77fc8cd33..cb753c7f0 100755 --- a/app/install/view/index/create.html +++ b/app/install/view/index/create.html @@ -54,7 +54,7 @@
- +
diff --git a/app/module/FormHandleModule.php b/app/module/FormHandleModule.php index 332677f06..5991b02cb 100644 --- a/app/module/FormHandleModule.php +++ b/app/module/FormHandleModule.php @@ -328,7 +328,13 @@ class FormHandleModule $db->where($this->where); // 总数 - $this->data_total = (int) $db->count(); + // 是否去重 + if(empty($form_data['distinct'])) + { + $this->data_total = (int) $db->count(); + } else { + $this->data_total = (int) $db->count('DISTINCT '.$form_data['distinct']); + } if($this->data_total > 0) { // 增加排序、未设置则默认[ id desc ]