MP_Reports::do_initsearches()
Init searches.
Source Source
File: mortgage-platform/Inc/Callback/MP_Reports.php
protected function do_initsearches() {
$arr = array(
'column' => 'post_date',
'after' => '1 months ago',
'inclusive' => true,
);
$leads = $this->get_id_for_period( $arr, array( MortgagePlatform::$lead ) );
$count_leads = count( $leads );
$leads_searches = $this->get_searches( $leads, MortgagePlatform::$lead );
$abandoned_leads = $this->get_id_for_period( $arr, array( MortgagePlatform::$abandoned_lead ) );
$count_abandoned_leads = count( $abandoned_leads );
$abandoned_leads_searches = $this->get_searches( $abandoned_leads, MortgagePlatform::$abandoned_lead );
$before = gmdate( 'd F Y', strtotime( current_time( 'd F Y' ) ) - 3600 * 24 * 30 );
$time = $before . ' - ' . current_time( 'd F Y' );
$array = array(
array(
$time,
$count_leads,
$leads_searches - $count_leads,
$count_abandoned_leads,
$abandoned_leads_searches - $count_abandoned_leads,
),
);
return wp_send_json( $array );
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |