Laravel 中需要 innerJoin 的数据来自查询结果,怎么做?
类似要做如下操作
table('info as a')->join(
(select loan_id from loan_table where uid in (select uid from users where created_at > xxx)) as b,
'a.loan_id',
'=',
'b.loan_id'
)
SQL 大概意思是:
select * from loan_info as a inner join (select loan_id from loan_table where uid in (select uid from users where created_at > xxx)) as b on a.loan_id = b.loan_id
用laravel中查询构造器怎么实现?
推荐文章: