log
This commit is contained in:
@@ -20,8 +20,7 @@ public function getAuthorsAttribute()
|
|||||||
$authorId = $this->getRawOriginal('ListaAutori');
|
$authorId = $this->getRawOriginal('ListaAutori');
|
||||||
$ids = explode(",", $authorId);
|
$ids = explode(",", $authorId);
|
||||||
$autori = [];
|
$autori = [];
|
||||||
foreach ($ids as $id)
|
foreach ($ids as $id) {
|
||||||
{
|
|
||||||
|
|
||||||
$autore = Author::where('IdAutore', $id)->orderBy('DataOra', 'desc')->first();
|
$autore = Author::where('IdAutore', $id)->orderBy('DataOra', 'desc')->first();
|
||||||
if ($autore) {
|
if ($autore) {
|
||||||
@@ -55,8 +54,7 @@ public function getEditoreAttribute()
|
|||||||
if ($this->IdMarchioEditoriale > 0) {
|
if ($this->IdMarchioEditoriale > 0) {
|
||||||
$editore = Publisher::where('IdMarchioEditoriale', $this->IdMarchioEditoriale)->orderBy('DataOra', 'desc')->first();
|
$editore = Publisher::where('IdMarchioEditoriale', $this->IdMarchioEditoriale)->orderBy('DataOra', 'desc')->first();
|
||||||
return $editore->Descrizione;
|
return $editore->Descrizione;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,5 +75,4 @@ public function nimaia()
|
|||||||
{
|
{
|
||||||
return $this->hasOne('App\Artnim', 'id_gm', 'IdArticolo');
|
return $this->hasOne('App\Artnim', 'id_gm', 'IdArticolo');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Mylog;
|
||||||
use App\Order as AppOrder;
|
use App\Order as AppOrder;
|
||||||
use Codexshaper\WooCommerce\Facades\Order;
|
use Codexshaper\WooCommerce\Facades\Order;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -91,9 +92,8 @@ class OrderUpdateGm extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the directory actual name and put in the log file
|
// get the directory actual name and put in the log file
|
||||||
$title = '*** SITO DI PRODUZIONE *** ';
|
|
||||||
|
|
||||||
$log = $title . ' Ordini aggiornati' . "\n";
|
$log = ' Ordini aggiornati' . "\n";
|
||||||
|
|
||||||
// check if there are orders to log
|
// check if there are orders to log
|
||||||
if($orderupdated > 0) {
|
if($orderupdated > 0) {
|
||||||
@@ -101,7 +101,7 @@ class OrderUpdateGm extends Command
|
|||||||
Mail::raw($log, function ($message, $orderupdated) {
|
Mail::raw($log, function ($message, $orderupdated) {
|
||||||
$message->to("log@fioredellavita.it");
|
$message->to("log@fioredellavita.it");
|
||||||
//$message->bcc('');
|
//$message->bcc('');
|
||||||
$message->subject("Ordini Aggiornati su GM:" . $orderupdated);
|
$message->subject(Mylog::getSubjectEmail("Ordini Aggiornati su GM:" . $orderupdated));
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Codexshaper\WooCommerce\Facades\Product;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use App\Setting;
|
use App\Setting;
|
||||||
use App\Article;
|
use App\Article;
|
||||||
|
use App\Mylog;
|
||||||
use Codexshaper\WooCommerce\Models\Product as ModelsProduct;
|
use Codexshaper\WooCommerce\Models\Product as ModelsProduct;
|
||||||
use Codexshaper\WooCommerce\Facades\Variation;
|
use Codexshaper\WooCommerce\Facades\Variation;
|
||||||
use Codexshaper\WooCommerce\Facades\Category;
|
use Codexshaper\WooCommerce\Facades\Category;
|
||||||
@@ -1108,7 +1109,7 @@ class ProductUpdateGm extends Command
|
|||||||
Mail::raw($loginizio. $log . $log2 . $log1 . $log3 . $logfine, function ($message) {
|
Mail::raw($loginizio. $log . $log2 . $log1 . $log3 . $logfine, function ($message) {
|
||||||
$message->to("log@fioredellavita.it");
|
$message->to("log@fioredellavita.it");
|
||||||
//$message->bcc('luca@pecos.it');
|
//$message->bcc('luca@pecos.it');
|
||||||
$message->subject("Inserimento nuovi prodotti");
|
$message->subject(Mylog::getSubjectEmail("Inserim. nuovi prodotti"));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Codexshaper\WooCommerce\Facades\Product;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use App\Setting;
|
use App\Setting;
|
||||||
use App\Article;
|
use App\Article;
|
||||||
|
use App\Mylog;
|
||||||
use App\Stock;
|
use App\Stock;
|
||||||
use Codexshaper\WooCommerce\Models\Product as ModelsProduct;
|
use Codexshaper\WooCommerce\Models\Product as ModelsProduct;
|
||||||
use Codexshaper\WooCommerce\Facades\Variation;
|
use Codexshaper\WooCommerce\Facades\Variation;
|
||||||
@@ -111,7 +112,7 @@ class ProductUpdateQta extends Command
|
|||||||
Mail::raw($loginizio. $lognrprodotti . $logfine, function ($message) {
|
Mail::raw($loginizio. $lognrprodotti . $logfine, function ($message) {
|
||||||
$message->to("log@fioredellavita.it");
|
$message->to("log@fioredellavita.it");
|
||||||
//$message->bcc('luca@pecos.it');
|
//$message->bcc('luca@pecos.it');
|
||||||
$message->subject("Aggiornamento Quantità Prodotti:");
|
$message->subject(Mylog::getSubjectEmail("Aggiornam. Qtà Prodotti:"));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Codexshaper\WooCommerce\Facades\Product;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use App\Setting;
|
use App\Setting;
|
||||||
use App\Article;
|
use App\Article;
|
||||||
|
use App\Mylog;
|
||||||
use Codexshaper\WooCommerce\Models\Product as ModelsProduct;
|
use Codexshaper\WooCommerce\Models\Product as ModelsProduct;
|
||||||
use Codexshaper\WooCommerce\Facades\Variation;
|
use Codexshaper\WooCommerce\Facades\Variation;
|
||||||
use Codexshaper\WooCommerce\Facades\Category;
|
use Codexshaper\WooCommerce\Facades\Category;
|
||||||
@@ -16,6 +17,7 @@ use Illuminate\Support\Facades\Mail;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ProductUpdateUsedGm extends Command
|
class ProductUpdateUsedGm extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -95,8 +97,7 @@ class ProductUpdateUsedGm extends Command
|
|||||||
Log::channel('updateproductsused')->notice('Inizio da '.$settingora->value."\n");
|
Log::channel('updateproductsused')->notice('Inizio da '.$settingora->value."\n");
|
||||||
$loginizio = 'Inizio da '.$settingora->value."\n";
|
$loginizio = 'Inizio da '.$settingora->value."\n";
|
||||||
$logfine = 'Fino a '.$ora_update."\n";
|
$logfine = 'Fino a '.$ora_update."\n";
|
||||||
$title = '*** SITO DI PRODUZIONE *** ';
|
$log = ' PRODOTTI USATI INSERITI'."\n";
|
||||||
$log = $title . ' PRODOTTI USATI INSERITI'."\n";
|
|
||||||
$log1 = 'EVENTUALI PRODOTTI USATI NON INSERITI'."\n";
|
$log1 = 'EVENTUALI PRODOTTI USATI NON INSERITI'."\n";
|
||||||
$log2 = 'PRODOTTI USATI AGGIORNATI' . "\n";
|
$log2 = 'PRODOTTI USATI AGGIORNATI' . "\n";
|
||||||
$log3 = 'PRODOTTI USATI NON INSERITI PER PROBLEMI SERVER' . "\n";
|
$log3 = 'PRODOTTI USATI NON INSERITI PER PROBLEMI SERVER' . "\n";
|
||||||
@@ -286,7 +287,7 @@ class ProductUpdateUsedGm extends Command
|
|||||||
Mail::raw($loginizio. $log . $log2 . $log1 . $log3 . $logfine, function ($message) {
|
Mail::raw($loginizio. $log . $log2 . $log1 . $log3 . $logfine, function ($message) {
|
||||||
$message->to("log@fioredellavita.it");
|
$message->to("log@fioredellavita.it");
|
||||||
//$message->bcc('luca@pecos.it');
|
//$message->bcc('luca@pecos.it');
|
||||||
$message->subject("Inserimento nuovi prodotti Usati");
|
$message->subject(Mylog::getSubjectEmail("Inserim. nuovi prodotti Usati"));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
15
app/Mylog.php
Normal file
15
app/Mylog.php
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Mylog extends Model
|
||||||
|
{
|
||||||
|
public $subject = '*** PROD: ';
|
||||||
|
|
||||||
|
public static function getSubjectEmail(string $subject) {
|
||||||
|
return self::$subject . " " . $subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user