📜  laravel 返回一维数组 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:46.154000             🧑  作者: Mango

代码示例1
$catcount    = 2;
    $parents_ids = [];
    for ($i = 0; $i < $catcount; $i++) {
        $parents_ids[] = $userCategory[$i];
    }
    $subCats = Category::whereIn('parent_id', $parents_ids)->pluck('id');