copy()->subHours(++$i); $vol = $L * $W * $H; $sid = 9000000 + $i; $db->table('jst_oms_shipping')->updateOrInsert( ['source_id' => $sid, 'sku_source_id' => $sid], [ 'express_no' => $expno, 'trade_no' => $tradeno, 'item_id' => $itemid, 'barcode' => $barcode, 'product_name' => $pname, 'qty' => $qty, 'receiver_state' => $prov, 'buyer_nick' => '', 'receiver_name' => $rname, 'shop_name' => $shop, 'express_name1' => $express, 'warehouse_name' => $wh, 'ship_time' => $shipTime, 'freight' => $freight, 'online_weight' => $onlineW, 'actual_weight' => $actualW, 'length_cm' => $L, 'width_cm' => $W, 'height_cm' => $H, 'volume_cm3' => $vol, 'receiver_city' => $city, 'receiver_district' => $dist, 'supplier_name' => $supplier, 'receiver_address' => $prov.$city.$dist.'示例路'.($i*7).'号', 'receiver_mobile' => $mobile, 'receiver_phone' => '', 'express_name2' => $express, 'platform' => $platform, 'buyer_memo' => '', 'seller_memo' => '', 'package_no' => 'PH'.$shipTime->format('Ymd').str_pad((string)$i,4,'0',STR_PAD_LEFT), 'amount' => round($actualW * 9.9 + 39, 2), 'product_code' => $procode, 'download_time' => $shipTime->copy()->addMinutes(30), 'pay_time' => $shipTime->copy()->subHours(3), 'freight_rate' => 1.0, 'freight_formula' => '首重+续重', 'weight_kg' => $actualW, 'settle_weight_kg' => max($actualW, round($vol/6000, 4)), 'settle_volume_cm3' => $vol, 'recon_weight_kg' => $actualW, 'recon_volume_cm3' => $vol, 'finished_barcode' => '', 'finished_name' => $pname, 'finished_supplier' => $supplier, 'settle_freight' => $settleFreight, 'front_no' => '', 'modified' => $shipTime, 'synced_at' => $now, ] ); } $db->table('jst_sync_state')->updateOrInsert(['dataset_key' => 'jst.sctrade'], [ 'watermark' => $now, 'status' => 'succeeded', 'last_succeeded_at' => $now, 'updated_at' => $now, 'created_at' => $now, ]); $this->command?->info('已写入 ' . count($samples) . ' 条发货明细演示数据(47 列,source_id 9000001 起)。'); } }