4 public static function GetList($by =
's_id',
$order =
'desc',
$arFilter = [], $is_filtered =
null, &$total = 0, &$grby =
'', &
$max = 0)
6 $DB = CDatabase::GetModuleConnection(
'statistic');
8 $s =
"S.NAME as SEARCHER_NAME, S.ID as SEARCHER_ID";
9 $strSqlGroup =
"GROUP BY S.ID, S.NAME, S.PHRASES_HITS, S.PHRASES";
10 $arSqlSearch = Array(
"PH.SEARCHER_ID <> 1");
24 if( ((
string)
$val ==
'') || (
$val ===
"NOT_REF") )
27 $match_value_set = array_key_exists(
$key.
"_EXACT_MATCH",
$arFilter);
35 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
38 case "SEARCHER_ID_STR":
39 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
43 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
48 $arSqlSearch[] =
"PH.DATE_HIT >= ".$DB->CharToDateFunction(
$val,
"SHORT");
52 $arSqlSearch[] =
"PH.DATE_HIT < ".CStatistics::DBDateAdd(
$DB->CharToDateFunction(
$val,
"SHORT"), 1);
55 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
61 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
65 $arSqlSearch[] = (
$val==
"Y") ?
"PH.URL_TO_404='Y'" :
"PH.URL_TO_404='N'";
72 $strSqlGroup =
" GROUP BY PH.PHRASE ";
79 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
87 $grby = ($find_group==
"P" || $find_group==
"S") ? $find_group :
"";
91 if ($by ==
"s_id") $strSqlOrder =
"ORDER BY PH.ID";
92 elseif ($by ==
"s_site_id") $strSqlOrder =
"ORDER BY PH.SITE_ID";
93 elseif ($by ==
"s_phrase") $strSqlOrder =
"ORDER BY PH.PHRASE";
94 elseif ($by ==
"s_searcher_id") $strSqlOrder =
"ORDER BY PH.SEARCHER_ID";
95 elseif ($by ==
"s_referer_id") $strSqlOrder =
"ORDER BY PH.REFERER_ID";
96 elseif ($by ==
"s_date_hit") $strSqlOrder =
"ORDER BY PH.DATE_HIT";
97 elseif ($by ==
"s_url_to") $strSqlOrder =
"ORDER BY PH.URL_TO";
98 elseif ($by ==
"s_session_id") $strSqlOrder =
"ORDER BY PH.SESSION_ID";
101 $strSqlOrder =
"ORDER BY PH.ID";
106 $strSqlOrder .=
" desc ";
119 ".$DB->DateToCharFunction(
"PH.DATE_HIT").
" DATE_HIT,
122 b_stat_phrase_list PH
123 INNER JOIN b_stat_searcher S ON (S.ID = PH.SEARCHER_ID)
131 if ($by ==
"s_phrase" && $grby==
"P") $strSqlOrder =
"ORDER BY PH.PHRASE";
132 elseif ($by ==
"s_searcher_id" && $grby==
"S") $strSqlOrder =
"ORDER BY PH.SEARCHER_ID";
133 elseif ($by ==
"s_quantity") $strSqlOrder =
"ORDER BY QUANTITY";
136 $strSqlOrder =
"ORDER BY QUANTITY";
140 $strSqlOrder .=
" desc ";
144 count(PH.ID) as COUNTER
146 b_stat_phrase_list PH,
150 and S.ID = PH.SEARCHER_ID
153 $c =
$DB->Query($strSql);
156 while ($cr = $c->Fetch())
158 $total += intval($cr[
"COUNTER"]);
159 $arrCount[] = intval($cr[
"COUNTER"]);
161 $max = (is_array($arrCount) &&
count($arrCount)>0) ? max($arrCount) : 0;
167 count(PH.ID) QUANTITY,
168 (count(PH.ID)*100)/$total C_PERCENT
170 b_stat_phrase_list PH,
174 and S.ID = PH.SEARCHER_ID
184 count(PH.ID) QUANTITY,
185 (count(PH.ID)*100)/$total C_PERCENT,
186 S.PHRASES_HITS/S.PHRASES AVERAGE_HITS
188 b_stat_phrase_list PH,
192 and S.ID = PH.SEARCHER_ID
200 if ($by ==
"s_name") $strSqlOrder =
"ORDER BY S.ID";
201 elseif ($by ==
"s_quantity") $strSqlOrder =
"ORDER BY QUANTITY";
202 elseif ($by ==
"s_average_hits") $strSqlOrder =
"ORDER BY AVERAGE_HITS";
205 $strSqlOrder =
"ORDER BY QUANTITY";
209 $strSqlOrder .=
" desc ";
211 $strSql =
"SELECT sum(S.PHRASES) TOTAL, max(S.PHRASES) MAX FROM b_stat_searcher S";
212 $c =
$DB->Query($strSql);
214 $total = intval($cr[
"TOTAL"]);
215 $max = intval($cr[
"MAX"]);
219 S.NAME SEARCHER_NAME,
221 S.PHRASES*100/$total C_PERCENT,
222 S.PHRASES_HITS/S.PHRASES AVERAGE_HITS
226 ".$DB->IsNull(
"S.PHRASES",
"0").
" > 0
static GetList($by='s_id', $order='desc', $arFilter=[], $is_filtered=null, &$total=0, &$grby='', &$max=0)
static DBTopSql($strSql, $nTopCount=false)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
CheckDateTime($datetime, $format=false)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"