7 $DB = CDatabase::GetModuleConnection(
'search');
22 ,scsite.URL as SITE_URL
24 ,' .
$DB->DateToCharFunction(
'sc.DATE_CHANGE') .
' as FULL_DATE_CHANGE
25 ,' .
$DB->DateToCharFunction(
'sc.DATE_CHANGE',
'SHORT') .
" as DATE_CHANGE
26 FROM b_search_content sc
27 INNER JOIN b_search_content_site scsite ON sc.ID=scsite.SEARCH_CONTENT_ID
28 INNER JOIN b_lang L ON scsite.SITE_ID=L.LID
29 INNER JOIN b_search_content_right scg ON sc.ID=scg.SEARCH_CONTENT_ID
32 AND scsite.SITE_ID='" .
$DB->ForSQL(
$site_id, 2) .
"'
33 AND (sc.DATE_FROM is null OR sc.DATE_FROM <= " .
$DB->CurrentTimeFunction() .
')
34 AND (sc.DATE_TO is null OR sc.DATE_TO >= ' .
$DB->CurrentTimeFunction() .
')
35 AND sc.ID > ' . intval(
$ID) .
'
39 if (intval($limit) > 0)
41 $strSql .=
'LIMIT ' . intval($limit);
43 $r =
$DB->Query($strSql);
44 parent::__construct($r->result);