21 lines
800 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class JstRow extends Command
{
protected $signature = 'jst:row {--trade=}';
protected $description = '看本地表某交易单号的行';
public function handle(): int
{
$c = DB::connection((string) config('jushuitan.connection', 'jushuitan_local'));
$rows = $c->table('jst_oms_shipping')->where('trade_no', (string) $this->option('trade'))
->get(['express_no', 'barcode', 'product_name', 'qty', 'pkg_count', 'supplier_name', 'length_cm', 'volume_cm3']);
$this->line('行数='.count($rows));
foreach ($rows as $r) {
$this->line(' '.json_encode($r, JSON_UNESCAPED_UNICODE));
}
return self::SUCCESS;
}
}