This commit is contained in:
Your Name
2026-04-30 17:36:47 +08:00
parent 4c21ee5938
commit 7e557b1ea2
33 changed files with 8718 additions and 94 deletions
@@ -8,6 +8,7 @@ use app\common\model\Order;
use app\common\model\tcm\PrescriptionOrder;
use app\common\model\tcm\PrescriptionOrderLog;
use app\common\model\tcm\PrescriptionOrderPayOrder;
use app\common\service\ExpressTrackingService;
use think\facade\Config;
use think\facade\Log;
use think\Response;
@@ -342,14 +343,23 @@ class GancaoCallbackController extends BaseApiController
break;
}
$savedOk = false;
try {
$order->save();
$savedOk = true;
} catch (\Throwable $e) {
Log::error('Gancao callback save failed', [
'order_id' => $order->id,
'error' => $e->getMessage(),
]);
}
if ($savedOk && in_array((int) $order->fulfillment_status, [5, 6], true)) {
ExpressTrackingService::applyAssistantReleaseForShippedPrescriptionOrder($order, [
'tracking_number' => (string) ($order->tracking_number ?? ''),
'source' => 'gancao_callback',
]);
}
}
/**