From aef33c660c3de0e863c573039c8e88c66e14b213 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 7 Sep 2023 15:12:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A7=94=E6=89=98=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreOrderCreateRepository.php | 6 +++--- app/common/repositories/store/product/ProductRepository.php | 6 +++--- app/common/repositories/store/product/SpuRepository.php | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 5d690a2a..3a242a8e 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -101,7 +101,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository throw new ValidateException('采购商品不支持跨店购买'); } $community = []; - // 99 委托商品是否设置收货方式 + // 99 委托商品是否设置收货方式 ? if ($order_type == 98) { $sourceIdArray = []; foreach($merchantCart['list'] as $prod){ @@ -139,7 +139,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository } $orderDeliveryStatus = true; $order_svip_discount = 0; - // 循环计算每个店铺的订单数据 99 委托商品是否设置收货方式 + // 循环计算每个店铺的订单数据 委托商品是否设置收货方式 ? foreach ($merchantCartList as &$merchantCart) { if ($order_type == 98 && !empty($deliverMethodArray)) { $merchantCart['delivery_way'] = $deliverMethodArray; @@ -173,7 +173,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository $product_cart = []; foreach ($merchantCart['list'] as $k => $cart) { - //处理转售送货方式 99 委托商品是否设置收货方式 + //处理转售送货方式 委托商品是否设置收货方式 ? if ($order_type == 98) { $merchantCart['list'][$k]['product']['delivery_way'] = $cart['product']['delivery_way'] = $deliverMethod ?? ''; } diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index f11f5d0f..0301ca42 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -240,9 +240,9 @@ class ProductRepository extends BaseRepository $settleParams = $this->setAttrValue($data, $result->product_id, $productType, 0,$data['mer_id']); $settleParams['cate'] = $this->setMerCate($data['mer_cate_id'], $result->product_id, $data['mer_id']); $settleParams['attr'] = $this->setAttr($data['attr'], $result->product_id); - if (in_array($productType, [0, 98])) app()->make(ParameterValueRepository::class)->create($result->product_id, $data['params'] ?? [],$data['mer_id']); + if (in_array($productType, [0, 98, 99])) app()->make(ParameterValueRepository::class)->create($result->product_id, $data['params'] ?? [],$data['mer_id']); $this->save($result->product_id, $settleParams, $content,$product,$productType); - if (in_array($productType, [0, 1,98])) { + if (in_array($productType, [0, 1, 98, 99])) { if ($productType == 1) { //秒杀商品 $dat = $this->setSeckillProduct($data); $dat['product_id'] = $result->product_id; @@ -316,7 +316,7 @@ class ProductRepository extends BaseRepository $settleParams['attr'] = $this->setAttr($data['attr'], $id); $data['price'] = $settleParams['data']['price']; unset($data['attrValue'],$data['attr'],$data['mer_cate_id']); - $ret = Spu::getInstance()->where('product_id', $id)->whereIn('product_type',[0, 98])->find(); + $ret = Spu::getInstance()->where('product_id', $id)->whereIn('product_type',[0, 98, 99])->find(); Db::transaction(function () use ($id, $data, $settleParams,$ret) { $this->save($id, $settleParams, null, [], 0); app()->make(SpuRepository::class)->update($ret->spu_id,['price' => $data['price']]); diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index 4f4ce30e..163bf456 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -380,7 +380,7 @@ 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,98, 99]) && ($ret['is_show'] !== 1 || $ret['is_used'] !== 1)) $status = 0; + if (in_array($productType, [0, 1, 98, 99]) && ($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]); @@ -465,6 +465,7 @@ class SpuRepository extends BaseRepository switch ($productType) { case 0: case 98: + case 99: $where = [ 'activity_id' => 0, 'product_id' => $id,