$find= db\ErrorMessage::findOne(['date'=>$date->format('Y-m-d'),'message'=>$message]);
$errorMessage->message_hash=md5($message);
---
$find= db\ErrorMessage::findOne(['date'=>$date->format('Y-m-d'),'message_hash'=>md5($message]));
$extra_photos = $this->DB->sql2array("SELECT * FROM `portfolio_items2image` WHERE `item` = {$item['id']} ORDER BY `id`");
$extra_photos = array_chunk($extra_photos, count($extra_photos) / 2);
foreach($extra_photos as $i => $arr) {
foreach ($arr as $extra_photos) {
$photo_data = array(
'id' => $extra_photo['id'],
'title' => $item['title'],
'img_prev' => $IMG->src($this->CONF['upload_dir'] . '/portfolio/' . $extra_photo['prev'], 1920, 800),
'img_full' => $this->CONF['upload_dir'] . '/portfolio/' . $extra_photo['full']
);
$this->TPL->insert_loop($this->CONF['base_tpl'] . '.work_part.extra_images_'.$i, array('EXTRA_PHOTO' => $photo_data));
}
}