From fd049b60fdfd96fd8b627a57a158eddce3f941b6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 12 May 2023 13:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/SpuRepository.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index ca88a283..361edf81 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -211,6 +211,7 @@ class SpuRepository extends BaseRepository try { switch ($productType) { case 0: + case 98: $where = [ 'activity_id' => 0, 'product_id' => $id, @@ -309,14 +310,14 @@ class SpuRepository extends BaseRepository } $ret = $make->getWhere(['product_id' => $where['product_id']]); if (!$ret || $ret['status'] !== 1 || $ret['mer_status'] !== 1 || $ret['is_del']) $status = 0; - if (in_array($productType, [0, 1]) && ($ret['is_show'] !== 1 || $ret['is_used'] !== 1)) $status = 0; + if (in_array($productType, [0, 1,98]) && ($ret['is_show'] !== 1 || $ret['is_used'] !== 1)) $status = 0; $result = $this->dao->getSearch($where)->find(); if (!$result && $ret) $result = $this->create($ret->toArray(), $where['product_id'], $where['activity_id'], $productType); if ($result) $this->dao->update($result['spu_id'], ['status' => $status]); - if ($status == 1 && $productType == 0) { + if ($status == 1 && in_array($productType, [0, 98])) { Queue(SendSmsJob::class, ['tempId' => 'PRODUCT_INCREASE', 'id' => $id]); } - if ($productType == 0) Queue::push(SyncProductTopJob::class,[]); + if (in_array($productType, [0, 98])) Queue::push(SyncProductTopJob::class,[]); } catch (\Exception $exception) { Log::info($exception->getMessage()); }