This commit is contained in:
meimei
2025-04-16 14:10:39 +08:00
parent 536cc44069
commit db0efbfc30
5 changed files with 24 additions and 3 deletions

View File

@@ -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());