소스 검색

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

refactoring
부모
커밋
85b52e9fbb
2개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. +1
    -1
      backend/config/main.php
  2. +11
    -1
      backend/controllers/CronController.php

+ 1
- 1
backend/config/main.php 파일 보기

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

+ 11
- 1
backend/controllers/CronController.php 파일 보기

@@ -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') ;
}
}
}
}
}

Loading…
취소
저장