15 lines
567 B
PHP
15 lines
567 B
PHP
<?php
|
|
|
|
/* ----------------------------------------------------------------------
|
|
24.12.2022
|
|
Берем рандомные 99 товаров.....
|
|
---------------------------------------------------------------------- */
|
|
|
|
$rndTovar=\DB::getAll('SELECT * FROM `tovar` WHERE `artikul`<>"" ORDER BY RANDOM() LIMIT 99');
|
|
for ($i=0; count($rndTovar); $i++) $rndTovar[$i]['img']=\DB::getValue("SELECT `filename` FROM `tovar_img` WHERE `tovar_id`=? LIMIT 1", $rndTovar[$i]['id']);
|
|
|
|
|
|
print_r($rndTovar);
|
|
$smarty -> assign( 'rndTovar', $rndTovar );
|
|
|
|
?>
|