Skip to content

Instantly share code, notes, and snippets.

@nutch31
Created June 17, 2019 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nutch31/c270abeb3edd01bfe9113336152637ce to your computer and use it in GitHub Desktop.
Save nutch31/c270abeb3edd01bfe9113336152637ce to your computer and use it in GitHub Desktop.
// 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