You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
637 B
16 lines
637 B
<?php
|
|
namespace App\Console\Commands;
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\DB;
|
|
use App\Services\SupplyDemand\Notices;
|
|
class SupplyDemandNotices extends Command {
|
|
protected $signature='supply-demand:send-notices';
|
|
protected $description='发送需求认领和新对接短信提醒,遵循合并频率与每日上限';
|
|
public function handle() {
|
|
DB::table('supply_demand_sms_notices')->whereNotNull('pending_at')->where('attempts','<',3)->orderBy('id')->chunkById(100,function($rows) {
|
|
foreach($rows as $row) Notices::deliver($row->user_id);
|
|
});
|
|
return 0;
|
|
}
|
|
}
|