aa
This commit is contained in:
@@ -47,10 +47,12 @@ class ProductUpdateGm extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
try {
|
||||
set_time_limit(0);
|
||||
ini_set("memory_limit", "512M");
|
||||
$settingora = Setting::where('key', 'update_products')->first();
|
||||
$productLogger = new ProductLogger($settingora->value);
|
||||
echo "SettingOra: " . $settingora;
|
||||
$fromtime = str_replace('-', '', $settingora->value);
|
||||
|
||||
$articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli GROUP BY IdArticolo) b'), function ($join) {
|
||||
@@ -83,12 +85,21 @@ class ProductUpdateGm extends Command
|
||||
->orderBy('Titolo')
|
||||
->get();
|
||||
|
||||
$productLogger = new ProductLogger($settingora->value);
|
||||
|
||||
foreach ($articles as $article) {
|
||||
setProductFromGM($article, true, $productLogger);
|
||||
}
|
||||
|
||||
$productLogger->setLogandSendEmail();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage();
|
||||
|
||||
if ($productLogger) {
|
||||
$productLogger->addLog('Error', $e->getMessage());
|
||||
$productLogger->setLogandSendEmail();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user