Created
February 3, 2015 22:41
-
-
Save andrewhl/fc87dc6c72056f9f26ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function scopeByInStore($query) | |
{ | |
$inStoreOrderType = GiftCardOrderTypes::$inStore; | |
$id = GiftCardBatch::where('name', '=', $inStoreOrderType)->first()->id; | |
$inStoreGiftCardIds = GiftCard::where('gift_card_batch_id', '=', $id) | |
->lists('id'); | |
return $query->whereIn('gift_card_id', $inStoreGiftCardIds); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment