mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 07:03:35 +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