[*] fix MQTasks
This commit is contained in:
1 parent
c6ce4be3cc
commit
876ad2d7a6
1 file changed
+1
-28
@@ -390,7 +390,7 @@ DELETE from `jokes` WHERE `jokes`.id not in (SELECT id FROM t_temp);'
|
|||||||
foreach ($res['photos'] as $arImage) {
|
foreach ($res['photos'] as $arImage) {
|
||||||
$result[] = [
|
$result[] = [
|
||||||
'date' => $arImage['earth_date'],
|
'date' => $arImage['earth_date'],
|
||||||
'src' => $arImage['img_src'],
|
'src' => $arImage['img_src'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$page++;
|
$page++;
|
||||||
@@ -401,33 +401,6 @@ DELETE from `jokes` WHERE `jokes`.id not in (SELECT id FROM t_temp);'
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function saveSolImages($sol)
|
|
||||||
{
|
|
||||||
$counter = 0;
|
|
||||||
$files = [];
|
|
||||||
$res = self::getSolImages($sol);
|
|
||||||
sleep(5);
|
|
||||||
|
|
||||||
if (empty($res)) {
|
|
||||||
throw new CoreException('Изображений с ровера за ' . $sol . ' сол нет');
|
|
||||||
}
|
|
||||||
foreach ($res as $arImage) {
|
|
||||||
$folder = 'ftp://admin:j2medit@10.8.0.2/mars/' . $arImage['date'];
|
|
||||||
if (!file_exists($folder)) {
|
|
||||||
if (!mkdir($folder) && !is_dir($folder)) {
|
|
||||||
//throw new CoreException('Папку "' . $folder . '" не удалось создать');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (copy($arImage['src'], $folder . '/' . basename($arImage['src']))) {
|
|
||||||
$counter++;
|
|
||||||
$files[] = basename($arImage['src']);
|
|
||||||
//throw new CoreException('Не удалось сохранить файл "' . $folder . '/' . basename($arImage['src']) . '" не удалось создать');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ['count' => $counter, 'files' => $files];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static function getStory($from = null)
|
public static function getStory($from = null)
|
||||||
{
|
{
|
||||||
$tableName = 'podslyshano';
|
$tableName = 'podslyshano';
|
||||||
|
|||||||
Reference in new issue
Block a user