如何在laravel查询构建器上选择所有?

时间:2018-04-17 00:53:52

标签: laravel laravel-query-builder

(1)

template<class T, bool = is_trivially_destructible_v<T>, bool = is_foo_v<T>>
struct __optional_combinatorial_explosion_base { ... };

template<class T>
struct __optional_combinatorial_explosion_base<T, false, true> { ... };

template<class T>
struct __optional_combinatorial_explosion_base<T, true, false> { ... };

template<class T>
struct __optional_combinatorial_explosion_base<T, true, true> { ... };

(2)

__optional_combinatorial_explosion_base

我想问一下如何从a16中选择以上两个查询代码? 我需要使用addselect来添加DB:原始代码

我只能像

一样逐个输入
DB::query()
->select(*)    <----how to write it's error
->addSelect(DB::raw('SUM(CASE WHEN B.approve IS NULL THEN 0 ELSE 1 END) as Ashowcount'))
->addSelect(DB::raw('SUM(B.approve) as Yshow'))
->from(a16 as A)
.....

我觉得这没有效率。

如何轻松选择所有列?

1 个答案:

答案 0 :(得分:1)

year