This commit is contained in:
Your Name
2026-04-30 09:27:42 +08:00
parent dc899e4af4
commit eb782305e6
460 changed files with 10785 additions and 928 deletions
+8 -2
View File
@@ -31,10 +31,16 @@ class SyncTrackingNumbers extends Command
$startTime = microtime(true);
try {
// 查询所有有快递单号的订单
// 终态订单不再触发查件:已完成(3)/已取消(4)/已签收(6)/暂不制药(8)/拒收(9)/退款(10)/保留药方(11)/制药缓发(12)
$terminalFulfillmentStatus = [3, 4, 6, 8, 9, 10, 11, 12];
// 查询所有有快递单号、未结案、且未上传甘草的订单
// 已上传甘草(gancao_reciperl_order_no 非空)的物流由甘草侧 GancaoLogisticsRouteService 拉取,不重复走快递100
$orders = Db::name('tcm_prescription_order')
->where('tracking_number', '<>', '')
->whereNull('delete_time')
->whereNotIn('fulfillment_status', $terminalFulfillmentStatus)
->whereRaw("TRIM(COALESCE(gancao_reciperl_order_no, '')) = ''")
->field([
'id',
'tracking_number',
@@ -51,7 +57,7 @@ class SyncTrackingNumbers extends Command
$skipped = 0;
$failed = 0;
$output->writeln("找到 {$total} 个有快递单号的订单");
$output->writeln("找到 {$total} 个有快递单号、未结案、未上传甘草的订单(已跳过已完成/已取消/已签收等终态及甘草已托管订单)");
foreach ($orders as $order) {
try {