讨论数量:
$list->getCollection()->transform(function (ShopCat $shopCat) {
return array_merge($shopCat->only('id', 'goods_id', 'merchant_id', 'cat'), [
'merchant_logo' => $shopCat->merchant?->logo,
'merchant_name' => $shopCat->merchant?->name,
]);
});
推荐文章: