$this->load->helper('procents');
$res=$this->json->getParts($parts, $s='');
//делаем проценты
$a=array();
if(!empty($res)){
foreach($res as $r){
$r['price']=round (procents($r['price'], $userdata['merge']), 1, PHP_ROUND_HALF_UP);
$r['crc']=md5($r['price'].$r['uniqueid'].$r['brandName'].$r['artikul']);
$img_array=$this->json->getImage($r['artikul'], $r['brandName']);
if(!empty($img_array))
$img_array=json_encode($img_array);
else
$img_array=false;
$r['image']=$img_array;
$a[]=$r;
}
var_dump($a);
}