Clients file update
This commit is contained in:
miroman-afk
2021-11-16 15:43:14 +03:00
parent 13a115ba0d
commit 3c8a6b2736
5 changed files with 11 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ class Import extends HRCCommand implements HRCCommandInterface {
public function command($input, $output = null) {
$HRCPortalURL = 'https://portal.hrc.by/';
$folder = 'backup';
$terminals = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->where('work_code', '=', 1)->get();
$terminals = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->get();
$end_date = date('m/d/Y H:i:s', strtotime($input['end_date']) + 86399);
$start_date = date('m/d/Y H:i:s', strtotime($input['start_date']));
foreach ($terminals as $terminal) {
@@ -48,7 +48,9 @@ class Import extends HRCCommand implements HRCCommandInterface {
];
} else {
foreach ($out as $filename) {
$path = '/backup/' . $filename . '.xml';
$date_file = date('Y-m-d', $filename);
//$path = '/backup/' . $filename . '.xml';
$path = '/Резервная%20копия/' . $date_file . '/exchange/' . $date_file . '/exchange/' . $filename . '.xml';
$download_url = $HRCPortalURL . 'api/cloud/download?api=2.0&project_code=hrc&code=' . $terminal['key'] . '&path=' . $path;
$download = curl_init();