static function get_fist_year_reports() { $the_week = STUser_f::get_week_reports(); $last_7_days = date('Y-m-d', strtotime('today - 7 days')); $last_15_days = date('Y-m-d', strtotime('today - 30 days')); $last_60_days = date('Y-m-d', strtotime('today - 60 days')); $last_90_days = date('Y-m-d', strtotime('today - 90 days')); $yesterday = date('Y-m-d', strtotime('today - 1 days')); $defaut = array('d' => '', 'm' => '', 'y' => '', 'full' => '', 'last_7days' => $last_7_days, 'last_15days' => $last_15_days, 'last_60days' => $last_60_days, 'last_90days' => $last_90_days, 'yesterday' => $yesterday, 'date_now' => date('Y-m-d'), 'the_week' => $the_week, 'last_year' => date("Y") - 1); global $current_user; get_currentuserinfo(); $user_id = $current_user->ID; $query = array('post_type' => 'shop_order', 'post_status' => array('wc-completed'), 'posts_per_page' => 1, 'author' => $user_id, 'order' => "ASC", 'orderby' => "date"); query_posts($query); while (have_posts()) { the_post(); $defaut = array('d' => get_the_date("d"), 'm' => get_the_date("n"), 'y' => get_the_date("Y"), 'full' => get_the_date("Y-m-d"), 'last_7days' => $last_7_days, 'last_15days' => $last_15_days, 'last_60days' => $last_60_days, 'last_90days' => $last_90_days, 'yesterday' => $yesterday, 'date_now' => date('Y-m-d'), 'the_week' => $the_week, 'last_year' => date("Y") - 1); } return $defaut; }