Php 转换具有mysql的查询
我想将此查询转换为LaravelPhp 转换具有mysql的查询,php,mysql,laravel,Php,Mysql,Laravel,我想将此查询转换为Laravel SELECT COUNT(uplineNetworkdetail) AS uplineNetworkdetailCount , idNetworkdetail , uplineNetworkdetail , downlineNetworkdetail FROM networkdetailCommunity where uplineNetworkde
SELECT COUNT(uplineNetworkdetail) AS uplineNetworkdetailCount
, idNetworkdetail
, uplineNetworkdetail
, downlineNetworkdetail
FROM networkdetailCommunity where uplineNetworkdetail <>'0'
GROUP BY uplineNetworkdetail
HAVING uplineNetworkdetailCount = '1'
ORDER BY posisi asc
请帮我怎么做?查询将是:
$query = DB::table('networkdetailCommunity')
->select('DB::RAW(COUNT(uplineNetworkdetail) AS uplineNetworkdetailCount)','idNetworkdetail','uplineNetworkdetail','downlineNetworkdetail')
->where('uplineNetworkdetail','<>','0')
->groupBy('uplineNetworkdetail')
->havingRaw("uplineNetworkdetailCount='1'")
->orderBy('posisi')
->get();
堆栈溢出不是代码服务位置。。上帝保佑你