SELECT
p.*, (IF(dp.Rate, dp.Rate, p.Rate)) AS Rate
FROM
visp.packages p LEFT JOIN (SELECT
*
From
visp.dealer_packages
Where
DealerID = 56 OR DealerID = 0
) dp on dp.PackageID = p.packageID
WHERE p.Status = 1 AND (IsPublic = 1 AND dp.Status is NULL OR dp.Status = 1) AND IsDealerCanAdd = 1 ORDER BY
p.PackageOrdering
如何在laravel-querybuilder中进行此查询?