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 @@ +