From 384d0d1a1f100a6473a2a8026f4d9bc34213c550 Mon Sep 17 00:00:00 2001 From: lemon <15040771@qq.com> Date: Mon, 13 Sep 2021 21:27:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=BE=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/BalanceDue.php | 70 +++++++++++++++++++++++++++++ app/Console/Kernel.php | 2 + 2 files changed, 72 insertions(+) create mode 100644 app/Console/Commands/BalanceDue.php diff --git a/app/Console/Commands/BalanceDue.php b/app/Console/Commands/BalanceDue.php new file mode 100644 index 0000000..56c54d0 --- /dev/null +++ b/app/Console/Commands/BalanceDue.php @@ -0,0 +1,70 @@ +where('status', OrderStatus::PAY_EARNEST) + ->get(); + $sms = new SmsService(); + foreach ($orders as $order) { + if (!empty($order->mobile)) { + $sms->send( + 'pay', + [ + $order->order_no, + '定金/订金', + $order->timeout, + '定金/订金', + '小程序' + ], + [ + $order->mobile + ], + ); + } + } + } + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index aac98ca..09ca566 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -15,6 +15,7 @@ class Kernel extends ConsoleKernel protected $commands = [ // \App\Console\Commands\DemandTimeout::class, + \App\Console\Commands\BalanceDue::class, ]; /** @@ -26,6 +27,7 @@ class Kernel extends ConsoleKernel protected function schedule(Schedule $schedule) { $schedule->command('demand:timeout')->everyMinute(); + $schedule->command('balance:due')->dailyAt('21:35');; // $schedule->command('inspire')->hourly(); }