api.so-manager-dev.com/app/Console/Commands/ExpirePaymentTransactions.php
Your Name f139a3f608
All checks were successful
Deploy api / deploy (push) Successful in 22s
支払いAPI実装
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:02:25 +09:00

28 lines
756 B
PHP

<?php
namespace App\Console\Commands;
use App\Models\PaymentTransaction;
use Illuminate\Console\Command;
/**
* 支払期限切れトランザクションのステータス更新バッチ
*/
class ExpirePaymentTransactions extends Command
{
protected $signature = 'payment:expire';
protected $description = '支払期限切れトランザクションのステータスを更新する';
public function handle(): int
{
$count = PaymentTransaction::where('status', '入金待ち')
->whereNotNull('pay_limit')
->where('pay_limit', '<', now())
->update(['status' => '支払期限切れ']);
$this->info("支払期限切れ更新: {$count}");
return Command::SUCCESS;
}
}