Skip to content

Instantly share code, notes, and snippets.

@LeeXun
Created March 8, 2018 10:45
Show Gist options
  • Save LeeXun/04bd737c77b9c5fd0feaa0b8611e7fb2 to your computer and use it in GitHub Desktop.
Save LeeXun/04bd737c77b9c5fd0feaa0b8611e7fb2 to your computer and use it in GitHub Desktop.
->leftJoin('likes', function($join) use ($viewer_id) {
$join->on('likes.customer_id', '=', DB::raw($viewer_id));
$join->on('likes.like_type', '=', DB::raw(Like::LIKE_TYPE_PRODUCT));
$join->on('likes.like_id', '=', 'oc_product.product_id');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment