From db0efbfc30f92c358cbee58af6eb811ed3fbe7dc Mon Sep 17 00:00:00 2001 From: meimei <102865034@qq.com> Date: Wed, 16 Apr 2025 14:10:39 +0800 Subject: [PATCH] fixed --- .../admin/controller/Mattertemplatecategorization.php | 6 ++++-- .../admin/model/Mattertemplatecategorization.php | 8 +++++++- .../admin/view/mattertemplatecategorization/add.html | 6 ++++++ .../admin/view/mattertemplatecategorization/edit.html | 6 ++++++ .../assets/js/backend/mattertemplatecategorization.js | 1 + 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/superadmin/application/admin/controller/Mattertemplatecategorization.php b/superadmin/application/admin/controller/Mattertemplatecategorization.php index 10beb66..ceb8884 100644 --- a/superadmin/application/admin/controller/Mattertemplatecategorization.php +++ b/superadmin/application/admin/controller/Mattertemplatecategorization.php @@ -52,19 +52,21 @@ class Mattertemplatecategorization extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['mattertemplate','firmstoreprojectsone','firmstoreprojectstwo']) + ->with(['mattertemplate','firmstoreprojectsone','firmstoreprojectstwo','firm']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->visible(['id','name','create_time','update_time']); + $row->visible(['id','name','create_time','update_time','firmstoreprojectsone_id','firmstoreprojectstwo_id','firm_id']); $row->visible(['mattertemplate']); $row->getRelation('mattertemplate')->visible(['name']); $row->visible(['firmstoreprojectsone']); $row->getRelation('firmstoreprojectsone')->visible(['name']); $row->visible(['firmstoreprojectstwo']); $row->getRelation('firmstoreprojectstwo')->visible(['name']); + $row->visible(['firm']); + $row->getRelation('firm')->visible(['full_name']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/superadmin/application/admin/model/Mattertemplatecategorization.php b/superadmin/application/admin/model/Mattertemplatecategorization.php index 4e58376..6ed3c7b 100644 --- a/superadmin/application/admin/model/Mattertemplatecategorization.php +++ b/superadmin/application/admin/model/Mattertemplatecategorization.php @@ -51,6 +51,12 @@ class Mattertemplatecategorization extends Model public function firmstoreprojectstwo() { - return $this->belongsTo('Firmstoreprojectstwo', 'id', 'id', [], 'LEFT')->setEagerlyType(0); + return $this->belongsTo('Firmstoreprojectstwo', 'firmstoreprojectstwo_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function firm() + { + return $this->belongsTo('Firm', 'firm_id', 'id', [], 'LEFT')->setEagerlyType(0); } } diff --git a/superadmin/application/admin/view/mattertemplatecategorization/add.html b/superadmin/application/admin/view/mattertemplatecategorization/add.html index d1359ee..f01dc81 100644 --- a/superadmin/application/admin/view/mattertemplatecategorization/add.html +++ b/superadmin/application/admin/view/mattertemplatecategorization/add.html @@ -12,6 +12,12 @@ +
+ +
+ +
+
diff --git a/superadmin/application/admin/view/mattertemplatecategorization/edit.html b/superadmin/application/admin/view/mattertemplatecategorization/edit.html index 219406d..6b8971b 100644 --- a/superadmin/application/admin/view/mattertemplatecategorization/edit.html +++ b/superadmin/application/admin/view/mattertemplatecategorization/edit.html @@ -12,6 +12,12 @@
+
+ +
+ +
+
diff --git a/superadmin/public/assets/js/backend/mattertemplatecategorization.js b/superadmin/public/assets/js/backend/mattertemplatecategorization.js index fab8f3b..22ccadc 100644 --- a/superadmin/public/assets/js/backend/mattertemplatecategorization.js +++ b/superadmin/public/assets/js/backend/mattertemplatecategorization.js @@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'id', title: __('Id')}, {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'mattertemplate.name', title: __('Mattertemplate.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'firm.full_name', title: '企业名称', operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'firmstoreprojectsone.name', title: __('Firmstoreprojectsone.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'firmstoreprojectstwo.name', title: __('Firmstoreprojectstwo.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},