本文整理汇总了PHP中CSQLWhere::_NumberIN方法的典型用法代码示例。如果您正苦于以下问题:PHP CSQLWhere::_NumberIN方法的具体用法?PHP CSQLWhere::_NumberIN怎么用?PHP CSQLWhere::_NumberIN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSQLWhere
的用法示例。
在下文中一共展示了CSQLWhere::_NumberIN方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetStatList
function GetStatList($by, $order, $arFilter)
{
$err_mess = CAdvBanner::err_mess() . "<br>Function: GetDynamicList<br>Line: ";
global $DB;
$arSqlSearch = array();
if (CAdvBanner::CheckDynamicFilter($arFilter)) {
if (is_array($arFilter)) {
$filter_keys = array_keys($arFilter);
for ($i = 0, $n = count($filter_keys); $i < $n; $i++) {
$key = $filter_keys[$i];
$val = $arFilter[$filter_keys[$i]];
if (is_array($val)) {
if (count($val) <= 0) {
continue;
}
} else {
if (strlen($val) <= 0 || "{$val}" == "NOT_REF") {
continue;
}
}
$key = strtoupper($key);
switch ($key) {
case "DATE_1":
$arSqlSearch[] = "D.DATE_STAT>=" . $DB->CharToDateFunction($val, "SHORT");
break;
case "DATE_2":
$arSqlSearch[] = "D.DATE_STAT<=" . $DB->CharToDateFunction($val . " 23:59:59", "FULL");
break;
}
}
if (!empty($arFilter['BANNER_ID'])) {
$arSqlSearch[] = CSQLWhere::_NumberIN("D.BANNER_ID", $arFilter['BANNER_ID']);
}
}
}
$strSqlSearch = GetFilterSqlSearch($arSqlSearch);
if ($by == "s_date") {
$strSqlOrder = " ORDER BY D.DATE_STAT ";
} elseif ($by == "s_visitors") {
$strSqlOrder = " ORDER BY VISITOR_COUNT ";
} elseif ($by == "s_clicks") {
$strSqlOrder = " ORDER BY CLICK_COUNT ";
} elseif ($by == "s_ctr") {
$strSqlOrder = " ORDER BY CTR";
} elseif ($by == "s_show") {
$strSqlOrder = " ORDER BY SHOW_COUNT ";
} elseif ($by == "s_id") {
$strSqlOrder = " ORDER BY D.BANNER_ID";
} else {
$strSqlOrder = " ORDER BY DATE_STAT";
$by = "s_date";
}
if ($order != "asc") {
$strSqlOrder .= " desc ";
}
if ($by != "s_date") {
$strSqlOrder .= ', DATE_STAT ASC';
}
if ($arFilter['BANNER_SUMMA'] == 'Y') {
$strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\t" . $DB->DateToCharFunction("D.DATE_STAT", "SHORT") . "\t\tDATE_STAT,\n\t\t\t\t\tSUM(D.SHOW_COUNT)\t\t\t\t\t\t\t\t\t\tSHOW_COUNT,\n\t\t\t\t\tSUM(D.CLICK_COUNT)\t\t\t\t\t\t\t\t\t\tCLICK_COUNT,\n\t\t\t\t\tSUM(D.VISITOR_COUNT)\t\t\t\t\t\t\t\t\tVISITOR_COUNT,\n\t\t\t\t\t" . CAdvBanner::getCTRSQL() . "\n\t\t\t\tFROM\n\t\t\t\t\tb_adv_banner_2_day D\n\t\t\t\tINNER JOIN b_adv_banner B ON (D.BANNER_ID = B.ID)\n\t\t\t\tINNER JOIN b_adv_contract C ON (B.CONTRACT_ID = C.ID)\n\t\t\t\tWHERE\n\t\t\t\t{$strSqlSearch}\n\t\t\t\tGROUP by DATE_STAT\n\t\t\t\t{$strSqlOrder}\n\t\t\t\t";
} else {
$strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\t" . $DB->DateToCharFunction("D.DATE_STAT", "SHORT") . "\t\tDATE_STAT,\n\t\t\t\t\tSUM(D.SHOW_COUNT)\t\t\t\t\t\t\t\t\t\tSHOW_COUNT,\n\t\t\t\t\tSUM(D.CLICK_COUNT)\t\t\t\t\t\t\t\t\t\tCLICK_COUNT,\n\t\t\t\t\tSUM(D.VISITOR_COUNT)\t\t\t\t\t\t\t\t\tVISITOR_COUNT,\n\t\t\t\t\tD.BANNER_ID,\n\t\t\t\t\tB.NAME\t\t\t\t\t\t\t\t\t\t\t\t\tBANNER_NAME,\n\t\t\t\t\t" . CAdvBanner::getCTRSQL() . "\n\t\t\t\tFROM\n\t\t\t\t\tb_adv_banner_2_day D\n\t\t\t\tINNER JOIN b_adv_banner B ON (D.BANNER_ID = B.ID)\n\t\t\t\tINNER JOIN b_adv_contract C ON (B.CONTRACT_ID = C.ID)\n\t\t\t\tWHERE\n\t\t\t\t{$strSqlSearch}\n\t\t\t\tGROUP by D.DATE_STAT, D.BANNER_ID, B.NAME\n\t\t\t\t{$strSqlOrder}\n\t\t\t\t";
}
return $DB->Query($strSql, false, $err_mess . __LINE__);
}