diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 5385eed18..14654eab6 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -446,6 +446,7 @@ class OrderLogic extends BaseLogic return true; } catch (\Exception $e) { Db::rollback(); + d($e); self::setError($e->getMessage()); return false; } diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 4e4993303..b8df492bd 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -742,11 +742,14 @@ class PayNotifyLogic extends BaseLogic 'product_id' => $v['product_id'], ] )->withTrashed()->find(); - $updateData[] = [ - 'id' => $StoreBranchProduct['id'], - 'stock' => $StoreBranchProduct['stock'] - $v['cart_num'], - 'sales' => ['inc', $v['cart_num']] - ]; + if($StoreBranchProduct){ + $updateData[] = [ + 'id' => $StoreBranchProduct['id'], + 'stock' => $StoreBranchProduct['stock'] - $v['cart_num'], + 'sales' => ['inc', $v['cart_num']] + ]; + } + } (new StoreBranchProduct())->saveAll($updateData);