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 {