Kaynağa Gözat

[backend] Cron : ajout de logs dans l'action processOrders afin de déterminer pourquoi les commandes ne se payent pas automatiquement.

refactoring
Guillaume Bourgeois 5 yıl önce
ebeveyn
işleme
85b52e9fbb
2 değiştirilmiş dosya ile 12 ekleme ve 2 silme
  1. +1
    -1
      backend/config/main.php
  2. +11
    -1
      backend/controllers/CronController.php

+ 1
- 1
backend/config/main.php Dosyayı Görüntüle

@@ -58,7 +58,7 @@ return [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
'levels' => ['error', 'warning', 'info'],
],
],
],

+ 11
- 1
backend/controllers/CronController.php Dosyayı Görüntüle

@@ -139,6 +139,10 @@ class CronController extends BackendController
$arrayProducers = Producer::searchAll() ;

foreach ($arrayProducers as $producer) {
$countOrders = 0 ;
$mailOrdersSend = false ;
$distribution = Distribution::findOne([
'date' => $date,
'active' => 1,
@@ -172,6 +176,7 @@ class CronController extends BackendController
$order->id_user,
User::ID_USER_SYSTEM
);
$countOrders ++ ;
}
}
}
@@ -222,8 +227,13 @@ class CronController extends BackendController

$mail->setSubject($subject)
->send();
$mailOrdersSend = true ;
}
}
if($producer->active) {
Yii::info($producer->name.' : Distribution du '.$date.', '.count($arrayOrders).' commande(s) enregistrée(s), '.$countOrders.' commande(s) payée(s), '.($mailOrdersSend ? 'Récapitulatif de commandes envoyé' : 'Aucun email envoyé'), 'cron-process-orders') ;
}
}
}
}
}

Yükleniyor…
İptal
Kaydet