• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/classes/general/question.php
  • Класс: CLQuestion
  • Вызов: CLQuestion::GetCount
static function GetCount($arFilter=Array())
{
	global $DB;

	$arSqlSearch = CLQuestion::GetFilter($arFilter);

	$strSqlSearch = "";
	$cnt = count($arSqlSearch);
	for($i=0; $i<$cnt; $i++)
		if($arSqlSearch[$i] <> '')
			$strSqlSearch .= " AND ".$arSqlSearch[$i]." ";

	$strSql =
	"SELECT COUNT(DISTINCT CQ.ID) as C ".
	"FROM b_learn_question CQ ".
	"INNER JOIN b_learn_lesson CL ON CQ.LESSON_ID = CL.ID ".
	"WHERE 1=1 ".
	$strSqlSearch;

	$res = $DB->Query($strSql, false, "File: ".__FILE__."
Line: ".__LINE__); $res_cnt = $res->Fetch(); return intval($res_cnt["C"]); }