猿问

php laravel框架

select tui.*,count(users.id) as number from (select a.uid,a.id as tuiguang_id,a.name,u.tel,u.nickname,case when sum(al.tui_money) is null then 0 else sum(al.tui_money) end as shouyi,case when agent.a_gongsi is null then '直属创骐平台' else agent.a_gongsi end as gongsi from admin as a left join users as u on u.id = a.uid left join user_acount_log as al on al.tuiguang_id = a.id left join agent on agent.aid = a.agentid where a.identity='1' and a.is_tuiguangyuan='0' group by a.uid) as tui left join users on users.tuiguang_id = tui.tuiguang_id group by tui.tuiguang_id

以上sql语句转成laravel的连贯操作,怎么弄?

慕码人4566280
浏览 1201回答 1
1回答

cookies1992

不用想了,用原生接口
随时随地看视频慕课网APP
我要回答