Created
June 17, 2019 14:38
-
-
Save nutch31/b9bd5ccc72739fb4dd4ee9404bba576f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
// Query | |
$query = Lead::where([ | |
['campaign_id', $request->get('campaignId')] | |
]) | |
->whereBetween('submitted_date_time', [$startDateTime, $endDateTime]) | |
->where(function($q) use ($analyticCampaignId_array, $trackingPhone_array, $directChannelId_array, $status) | |
{ | |
if(!empty($analyticCampaignId_array)) | |
{ | |
$q->orWhereIn('analytic_campaign_id', $analyticCampaignId_array) | |
->where('type', $this->submitted_lead); | |
} | |
if(!empty($trackingPhone_array)) | |
{ | |
$q->orWhereIn('tracking_phone', $trackingPhone_array) | |
->where('type', $this->phone_lead); | |
} | |
if(!empty($directChannelId_array)) | |
{ | |
$q->orWhereIn('direct_channel_id', $directChannelId_array) | |
->where('type', $this->direct_lead); | |
} | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment