From f577c6c3cdf3367cd0187de76c8ccb1c6964513b Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 17 May 2023 14:49:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Command/getProductCommand.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/Command/getProductCommand.php b/app/Command/getProductCommand.php index 1fb771c..4c0107a 100644 --- a/app/Command/getProductCommand.php +++ b/app/Command/getProductCommand.php @@ -101,12 +101,6 @@ class getProductCommand extends HyperfCommand return false; } - if (empty($item['thirdDrugCode'])) { - Db::rollBack(); -// $this->line("商品更新失败,缺少第三方药房药品编码" . json_encode($item, JSON_UNESCAPED_UNICODE)); - return false; - } - if (empty($item['drugPrice'])) { Db::rollBack(); // $this->line("商品更新失败,缺少药品价格" . json_encode($item, JSON_UNESCAPED_UNICODE)); @@ -116,7 +110,6 @@ class getProductCommand extends HyperfCommand // 查询是否存在 $params = array(); $params['product_platform_code'] = $item['drugCode']; - $params['product_pharmacy_code'] = $item['thirdDrugCode']; $product_platform = ProductPlatform::getOne($params); if (!empty($product_platform)) { // 已存在,更新 @@ -185,6 +178,14 @@ class getProductCommand extends HyperfCommand } } + // 第三方药店商品编码 + if (isset($item['thirdDrugCode'])) { + if ($product_platform['product_pharmacy_code'] != $item['thirdDrugCode']) { + $product_platform_data['product_pharmacy_code'] = $item['thirdDrugCode']; + $product_data['product_pharmacy_code'] = $item['thirdDrugCode']; + } + } + // 基本包装数量 if (isset($item['basicPackingCount'])) { if ($product_platform['packaging_count'] != $item['basicPackingCount']) { @@ -251,7 +252,9 @@ class getProductCommand extends HyperfCommand $data['product_platform_code'] = $item['drugCode']; // 第三方药店商品编码 - $data['product_pharmacy_code'] = $item['thirdDrugCode']; + if (isset($item['thirdDrugCode'])){ + $data['product_pharmacy_code'] = $item['thirdDrugCode']; + } // 商品规格 if (isset($item['specifications'])) {