📜  我们可以在查询 laravel 中使用 2 select - PHP 代码示例

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

代码示例1
$myTable = MyTable->select('firstField');

if ($somethingTrue) {
    $myTable->addSelect('secondField');
}

if ($somethingElseTrue) {
    $myTable->addSelect('thirdField');
}

$myTable->get();