limeng 8cae97df0d fix(发货数据): 对齐工作平台口径并补足两边差异
- 确认基表为发货明细 jst_order_express_details(聚水潭发货单dlv镜像)
- 快递单号回落: logistic_id -> jst_Orders.l_id -> 运费表 expressNo
- 发货时间 send_time 缺失时回落 jst_Orders.send_date(修滞后单)
- 并入自动发货仓(jst_Orders已发货但不在发货明细表), 约2179条
- 剔除补差虚拟单(商品名含 补收差价/差价专用)
- 窗口重跑先按发货时间删旧行再重建, 批量 insertOrIgnore 提速
- 每日 01:28 滚动同步 --days=3

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014nvGZkg27YMEdhRy6EiUwf
2026-09-21 03:11:31 +00:00

26 lines
1.1 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class JstCount extends Command
{
protected $signature = 'jst:count';
protected $description = '发货数据本地表统计';
public function handle(): int
{
$c = DB::connection((string) config('jushuitan.connection', 'jushuitan_local'));
$t = $c->table('jst_oms_shipping');
$this->line('total='.$t->count());
$this->line('autoship(source>=1e9)='.(clone $t)->where('source_id', '>=', 1000000000)->count());
$this->line('express_rows(source<9e6)='.(clone $t)->where('source_id', '<', 9000000)->count());
$this->line('buchai_left='.(clone $t)->where('product_name', 'like', '%补收差价%')->count());
$this->line('express_no_filled='.(clone $t)->whereNotNull('express_no')->where('express_no', '<>', '')->count());
$this->line('express_no_empty='.(clone $t)->where(function ($q) { $q->whereNull('express_no')->orWhere('express_no', ''); })->count());
return self::SUCCESS;
}
}