38 lines
781 B
PHP
38 lines
781 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Carbon\Carbon;
|
|
use App\Models\Oldmen;
|
|
use Illuminate\Console\Command;
|
|
|
|
class VerifyNeedPayArrear extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'app:verify-need-pay-arrear';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = '更新入住客人欠费状态';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
//
|
|
Oldmen::where('live_in', Oldmen::STATUS_LIVE)
|
|
->where('need_pay', Oldmen::PAY_NOTICE)
|
|
->whereDate('avliable_at', '>', now())->update([
|
|
'need_pay' => Oldmen::PAY_ARREAR
|
|
]);
|
|
}
|
|
}
|