更新委托商品处理

This commit is contained in:
yaooo 2023-09-07 15:12:32 +08:00
parent 0d1e33f245
commit aef33c660c
3 changed files with 8 additions and 7 deletions

View File

@ -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 ?? '';
}

View File

@ -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']]);

View File

@ -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,