From 21f2cf12da53f3234e98ee1603092a2dda13770a Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Mon, 11 Sep 2023 16:49:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=8A=A5=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=AE=A2=E5=8D=95command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Command/ReportPreProductOrderCommand.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Command/ReportPreProductOrderCommand.php b/app/Command/ReportPreProductOrderCommand.php index dcd829f..c32b289 100644 --- a/app/Command/ReportPreProductOrderCommand.php +++ b/app/Command/ReportPreProductOrderCommand.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Command; +use App\Exception\BusinessException; use App\Model\OrderPrescription; use App\Model\OrderProduct; use App\Model\UserPatient; @@ -55,6 +56,20 @@ class ReportPreProductOrderCommand extends HyperfCommand foreach ($order_product_ids as $item){ $this->line("本次请求订单号:" . $item['order_product_id']); + // 获取商品订单数据 + $params = array(); + $params['order_product_id'] = $item['order_product_id']; + $order_product = OrderProduct::getOne($params); + if (empty($order_product)) { + $this->line("结束,商品订单数据错误"); + continue; + } + + if ($order_product['report_pre_status'] == 1){ + $this->line("结束,订单已上报"); + continue; + } + Db::beginTransaction(); try {