mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Cleanup
This commit is contained in:
parent
f07e2d9520
commit
525af6f168
|
@ -58,7 +58,7 @@ abstract class BaseSerializer extends SerializerAbstract
|
|||
$data = $model->getRelation($relation);
|
||||
} elseif ($many) {
|
||||
$relationIds = $relation.'_ids';
|
||||
$data = $model->$relationIds ?: $model->$relation()->get(['id'])->fetch('id')->all();
|
||||
$data = $model->$relationIds ?: $model->$relation()->lists('id');
|
||||
} else {
|
||||
$relationId = $relation.'_id';
|
||||
$data = $model->$relationId;
|
||||
|
|
Loading…
Reference in New Issue
Block a user