Saveing data after each print, saved or quick note. Increased trafficar radius to 2,5km from 2km.
This commit is contained in:
@@ -75,6 +75,20 @@ class Paper
|
||||
}
|
||||
}
|
||||
|
||||
public function saveToHistory($title, $text, $textSource, $image)
|
||||
{
|
||||
DB::table('history')
|
||||
->insertGetId([
|
||||
'topic' => $title,
|
||||
'topic_slug' => str_slug($title, '_'),
|
||||
'text' => $text,
|
||||
'text_source' => $textSource,
|
||||
'icon' => $image,
|
||||
'created_at' => time(),
|
||||
'updated_at' => time()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function sendPrint($title, $text = '', $image = false, $imageLocal = true)
|
||||
{
|
||||
@@ -82,6 +96,9 @@ class Paper
|
||||
$this->sendHeaderPrint($title);
|
||||
$htmlToPos = new HtmlToPos();
|
||||
$convertedData = $htmlToPos->convert($text);
|
||||
|
||||
//zapisuje do pamięci dane o drukowanej notatce, jesli obrazek nie jest ikoną to nie zapisuje go
|
||||
$this->saveToHistory($title, $convertedData, $text, $imageLocal ? $image : '');
|
||||
if (is_array($convertedData)) {
|
||||
$this->printer->text($convertedData['text']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user