diff --git a/code/app/Console/Commands/RemindOrders.php b/code/app/Console/Commands/RemindOrders.php index fcb7deeb..c0e76007 100644 --- a/code/app/Console/Commands/RemindOrders.php +++ b/code/app/Console/Commands/RemindOrders.php @@ -48,7 +48,7 @@ public function handle() foreach($notifications as $gas_id => $orders) { Log::info('Invio promemoria per ordini ' . join(', ', $orders)); - NotifyRemindOrder::dispatch($gas_id, $orders); + NotifyRemindOrder::dispatch($orders); } $gas = Gas::all(); diff --git a/code/app/Jobs/NotifyRemindOrder.php b/code/app/Jobs/NotifyRemindOrder.php index 06da6ba5..d087d07d 100644 --- a/code/app/Jobs/NotifyRemindOrder.php +++ b/code/app/Jobs/NotifyRemindOrder.php @@ -9,36 +9,25 @@ use Illuminate\Queue\SerializesModels; use App\Notifications\RemindOrderNotification; -use App\Gas; use App\Order; class NotifyRemindOrder implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - public $gas_id; public $orders_id; - public function __construct($gas_id, $orders_id) + public function __construct($orders_id) { - $this->gas_id = $gas_id; $this->orders_id = $orders_id; } public function handle() { - $gas = Gas::find($this->gas_id); - if ($gas->hasFeature('send_order_reminder') == false) { - return; - } - $aggregate_users = []; - $hub = app()->make('GlobalScopeHub'); foreach($this->orders_id as $order_id) { $order = Order::find($order_id); - - $hub->setGas($gas->id); $users = $order->notifiableUsers($gas); foreach($users as $user) {