芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/wp-statistics/includes/class-wp-statistics-country.php
0) { $count_day = $args['ago']; } else { $first_day = Helper::get_date_install_plugin(); $count_day = TimeZone::getNumberDayBetween($first_day); } } // Get time ago Days Or Between Two Days if (!empty($args['from']) and !empty($args['to'])) { $days_list = TimeZone::getListDays(array('from' => $args['from'], 'to' => $args['to'])); } else { if (is_numeric($args['ago']) and $args['ago'] > 0) { $days_list = TimeZone::getListDays(array('from' => TimeZone::getTimeAgo($args['ago']))); } else { $days_list = TimeZone::getListDays(array('from' => TimeZone::getTimeAgo($count_day))); } } $days_time_list = array_keys($days_list); // Get Result $limitQuery = (isset($args['limit']) and $args['limit'] > 0) ? $wpdb->prepare("LIMIT %d", $args['limit']) : ''; $sqlQuery = $wpdb->prepare("SELECT `location`, COUNT(`location`) AS `count` FROM `" . DB::table('visitor') . "` WHERE `last_counter` BETWEEN %s AND %s GROUP BY location ORDER BY `count` DESC", reset($days_time_list), end($days_time_list)); $result = $wpdb->get_results($sqlQuery . " " . $limitQuery); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared foreach ($result as $item) { $item->location = strtoupper($item->location); $list[] = array( 'location' => $item->location, 'name' => $ISOCountryCode[$item->location], 'flag' => self::flag($item->location), 'link' => Menus::admin_url('visitors', array('location' => $item->location)), 'number' => $item->count ); } return $list; } }