fix: [CRUDComponent] Full group by on meta-templates
parent
a8951ed69e
commit
de4ba80e21
|
@ -252,7 +252,8 @@ class CRUDComponent extends Component
|
||||||
$query->innerJoinWith('MetaTemplateFields', function ($q) {
|
$query->innerJoinWith('MetaTemplateFields', function ($q) {
|
||||||
return $q->contain('MetaFields')->innerJoinWith('MetaFields');
|
return $q->contain('MetaFields')->innerJoinWith('MetaFields');
|
||||||
});
|
});
|
||||||
$query->group(['MetaTemplates.id'])->order(['MetaTemplates.is_default' => 'DESC']);
|
$query->group(['MetaTemplates.id', 'MetaTemplates.scope', 'MetaTemplates.name', 'MetaTemplates.namespace', 'MetaTemplates.description', 'MetaTemplates.version', 'MetaTemplates.uuid', 'MetaTemplates.source', 'MetaTemplates.enabled', 'MetaTemplates.is_default'])
|
||||||
|
->order(['MetaTemplates.is_default' => 'DESC']);
|
||||||
$metaTemplates = $query->all();
|
$metaTemplates = $query->all();
|
||||||
$data['metaTemplates'] = $metaTemplates;
|
$data['metaTemplates'] = $metaTemplates;
|
||||||
return $data;
|
return $data;
|
||||||
|
|
Loading…
Reference in New Issue