erp-backend/app/Console/Commands/MatchSkuCommand.php
2026-04-01 17:07:04 +08:00

26 lines
675 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Services\SkuMatchService;
class MatchSkuCommand extends Command
{
protected $signature = 'orders:match-sku';
protected $description = '自动匹配订单SKU';
protected $skuMatchService;
public function __construct(SkuMatchService $skuMatchService)
{
parent::__construct();
$this->skuMatchService = $skuMatchService;
}
public function handle()
{
$this->info('开始自动匹配SKU...');
$results = $this->skuMatchService->batchMatchOrders(100);
$this->info('匹配完成,处理订单数:' . count($results));
}
}