diff --git a/app/Notifications/WorkOrder/Reply.php b/app/Notifications/WorkOrder/Reply.php index b2e9553..d81401d 100644 --- a/app/Notifications/WorkOrder/Reply.php +++ b/app/Notifications/WorkOrder/Reply.php @@ -36,6 +36,10 @@ public function __construct(ReplyModel $reply) */ public function via(): array { + if (! $this->work_order->notify) { + return []; + } + $channels = [WeComChannel::class, WebChannel::class]; if ($this->work_order->status === 'replied') { diff --git a/app/Notifications/WorkOrder/WorkOrder.php b/app/Notifications/WorkOrder/WorkOrder.php index 981a882..e4b6b4c 100644 --- a/app/Notifications/WorkOrder/WorkOrder.php +++ b/app/Notifications/WorkOrder/WorkOrder.php @@ -30,6 +30,10 @@ public function __construct(WorkOrderModel $work_order) */ public function via(): array { + if (! $this->work_order->notify) { + return []; + } + return [WeComChannel::class, WebChannel::class]; }