MP_Reports::do_searches( array $arr, string $period, string|null $date, string|null $before, string|null $after )

Searches.


Parameters Parameters

$arr

(array) (Required) .

$period

(string) (Required) period (days, months, years).

$date

(string|null) (Required) date.

$before

(string|null) (Required) first day of a period.

$after

(string|null) (Required) end day of a period.


Top ↑

Source Source

File: mortgage-platform/Inc/Callback/MP_Reports.php

	protected function do_searches( $arr, $period, $date, $before, $after ) {

		if ( $date || $before ) {

			$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 );

			$time = $this->get_time( $_POST, $period, $date, $before, $after );

			$array = array(
				array(
					$time,
					$count_leads,
					$leads_searches - $count_leads,
					$count_abandoned_leads,
					$abandoned_leads_searches - $count_abandoned_leads,
				),
			);

			return wp_send_json( $array );
		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.