From 2044dd4d6b9669da1e094e45287d7224b2798d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Thu, 1 Sep 2022 10:11:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#10000=20=E5=BA=97=E9=93=BA=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=95=86=E5=93=81,=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php index b385410..034f86d 100644 --- a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php +++ b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php @@ -121,7 +121,12 @@ class KuaiTuanTuan extends BusinessClient $publicParams['sign'] = $this->getSign($publicParams); $res = $this->formDataPostRequest($url, $publicParams); if (isset($res['error_response'])) { - throw new \RuntimeException($res['error_response']['error_msg']); + // ToDo 重构异常处理 + if ('业务服务错误' === $res['error_response']['error_msg'] && '该店铺下不存在该商品' === $res['error_response']['sub_msg']) { + BusinessGoodsSku::where('goods_id', $appendParams['goods_id'])->where('sku_id', $appendParams['sku_id'])->delete(); + } else { + throw new \RuntimeException($res['error_response']['error_msg'] . ':' . $res['error_response']['error_msg']); + } } return $res;