HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/tepnot/public_html/wp-content/plugins/dokan-pro/includes/Admin/Reports/Manager.php
<?php

namespace WeDevs\DokanPro\Admin\Reports;

use DateTimeZone;
use WeDevs\Dokan\Utilities\OrderUtil;

/**
 * Class Manager
 *
 * @since 3.4.1
 * @since 3.8.0 Moved this class from includes/Reports/Manager.php to includes/Admin/Reports/Manager.php
 */
class Manager {
    /**
     * @since 3.4.1
     *
     * @param array $args
     *
     * @return array|object|string|null
     */
    public function get_logs( $args = [] ) {
        $default = [
            'id'           => [],
            'order_id'     => [],
            'vendor_id'    => [],
            'start_date'   => '',
            'end_date'     => '',
            'order_status' => '',         // possible values are wc-processing, wc-completed etc.
            'orderby'      => 'id',
            'order'        => 'DESC',
            'return'       => 'ids',     // possible values are all, ids, count
            'per_page'     => 20,
            'page'         => 1,
        ];

        $args = wp_parse_args( $args, $default );

        $query_args = [
			'id'           => $args['id'],
	        'order_id'     => $args['order_id'],
	        'seller_id'    => $args['vendor_id'],
	        'date' 	   => [
		        'from' => $args['start_date'],
		        'to'   => $args['end_date'],
	        ],
	        'status'       => explode( ',', $args['order_status'] ),
	        'orderby'      => $args['orderby'],
	        'order'        => $args['order'],
	        'return'       => $args['return'],
	        'limit'        => $args['per_page'],
	        'paged'        => $args['page'],
        ];

		$orders = dokan()->order->all( $query_args );
		if ( 'count' === $orders ) {
			return $orders->total;
		}

		return $orders;
    }

    /**
     * This will check if given var is empty or not.
     *
     * @since 3.4.1
     *
     * @param mixed $var
     *
     * @return bool
     */
    protected function is_empty( $var ) {
        if ( empty( $var ) ) {
            return true;
        }

        if ( isset( $var[0] ) && intval( $var[0] === 0 ) ) {
            return true;
        }

        return false;
    }
}