Add checking if any file was processed. #708
This commit is contained in:
parent
97d058c3d3
commit
6794db5f6a
1 changed files with 11 additions and 8 deletions
|
|
@ -63,7 +63,7 @@ class LoadWarrantySerialCommand extends Command
|
||||||
$db = $em->getConnection();
|
$db = $em->getConnection();
|
||||||
|
|
||||||
$ws_query_sql = 'SELECT id, file_serial, file_id, api_user, orig_file_serial FROM warranty_serial_queue
|
$ws_query_sql = 'SELECT id, file_serial, file_id, api_user, orig_file_serial FROM warranty_serial_queue
|
||||||
WHERE status = :status LIMIT 1';
|
WHERE status = :status ORDER BY id LIMIT 1';
|
||||||
|
|
||||||
$ws_query_stmt = $db->prepare($ws_query_sql);
|
$ws_query_stmt = $db->prepare($ws_query_sql);
|
||||||
$ws_query_stmt->bindValue('status', $status);
|
$ws_query_stmt->bindValue('status', $status);
|
||||||
|
|
@ -84,12 +84,15 @@ class LoadWarrantySerialCommand extends Command
|
||||||
$this->updateWarrantySerialQueue($id);
|
$this->updateWarrantySerialQueue($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// error_log(print_r($this->log_data, true));
|
if (count($output_info) > 0)
|
||||||
// load log data into db
|
{
|
||||||
$this->load_logger->logWarrantySerialLoadInfo($this->log_data);
|
// error_log(print_r($this->log_data, true));
|
||||||
|
// load log data into db
|
||||||
|
$this->load_logger->logWarrantySerialLoadInfo($this->log_data);
|
||||||
|
|
||||||
// send results back to third party
|
// send results back to third party
|
||||||
$this->sendResults($output_info);
|
$this->sendResults($output_info);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +136,7 @@ class LoadWarrantySerialCommand extends Command
|
||||||
// valid entry, we parse and insert
|
// valid entry, we parse and insert
|
||||||
$serial = trim(strtoupper($row[0]));
|
$serial = trim(strtoupper($row[0]));
|
||||||
|
|
||||||
// error_log('Processing ' . $serial);
|
error_log('Processing ' . $serial);
|
||||||
|
|
||||||
$sku = trim(strtoupper($row[1]));
|
$sku = trim(strtoupper($row[1]));
|
||||||
$dispatch_status = trim($row[2]);
|
$dispatch_status = trim($row[2]);
|
||||||
|
|
@ -445,7 +448,7 @@ class LoadWarrantySerialCommand extends Command
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
|
|
||||||
// check result
|
// check result
|
||||||
// error_log('Result ' . $res);
|
error_log('Result ' . $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue