Created
June 17, 2019 14:30
-
-
Save nutch31/4ad8af87db8ae0c8bf6efe643c80814a to your computer and use it in GitHub Desktop.
query
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
// 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