changed logic for sending mails for only have schedule types in production report
This commit is contained in:
@@ -17,7 +17,8 @@ class SendProductionReport extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'send:production-report';
|
||||
//protected $signature = 'send:production-report';
|
||||
protected $signature = 'send:production-report {schedule_type}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -32,8 +33,11 @@ class SendProductionReport extends Command
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$mailRules = \App\Models\AlertMailRule::where('module', 'ProductionQuantities')
|
||||
$scheduleType = $this->argument('schedule_type');
|
||||
|
||||
$mailRules = \App\Models\AlertMailRule::where('module', 'ProductionQuantities')
|
||||
->where('rule_name', 'ProductionMail')
|
||||
->where('schedule_type', $scheduleType)
|
||||
->get();
|
||||
|
||||
$emails = $mailRules->pluck('email')->unique()->toArray();
|
||||
|
||||
Reference in New Issue
Block a user