浏览代码

Merge branch 'dev'

master
父节点
当前提交
5206954300
共有 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') ;
}
}
}
}
}

正在加载...
取消
保存