mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 02:53:37 +08:00
Cleanup
This commit is contained in:
parent
80a11ccc86
commit
5d5bbb9832
|
@ -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