我正在尝试在Laravel中使用许多联接构建查询,但是我找不到正确的方法。
这是sql中的查询:
$query = "SELECT * FROM SAP WHERE intSapID in (SELECT DISTINCT S.intSapID FROM SAP S
INNER JOIN Rub_Check R ON
S.strProperty = R.strProperty
and S.gdDocDate = R.gdElinkDate
and S.strVendor = R.strVendorNum
and S.fltAmount = R.fltAmount
and S.strReference = R.strVoucher
where S.strDocType = 'KC' and R.intidentificador = '$szID')";