diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index df860e75..d8dc8b82 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2333,7 +2333,7 @@ class ProductRepository extends BaseRepository if (!$model->save($data)) { throw new \Exception('入库失败'); } - if (!$orderProduct->save(['is_imported' => 1])) { + if (isset($orderProduct) && !$orderProduct->save(['is_imported' => 1])) { throw new \Exception('订单商品更新出错'); } }