From e5f953e05407757b731a2105515f0d6fed471d5c Mon Sep 17 00:00:00 2001 From: weigang Date: Mon, 19 Oct 2020 12:46:35 +0800 Subject: [PATCH] no message --- app/Constants/v3/ErrorCode.php | 6 ++++++ app/Service/v3/Implementations/OrderOnlineService.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Constants/v3/ErrorCode.php b/app/Constants/v3/ErrorCode.php index 716e2cc..942c94e 100644 --- a/app/Constants/v3/ErrorCode.php +++ b/app/Constants/v3/ErrorCode.php @@ -95,6 +95,12 @@ class ErrorCode extends AbstractConstants */ const ORDER_OFFLINE_FAIL = 612; + /** + * 下单失败 + * @Message("无法自己购买自己店铺的商品") + */ + const ORDER_ONLINE_LIMIT_STORE_BUY_SELF = 613; + /************************************/ /* 支付相关 651-700 */ /************************************/ diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 3744a78..4b5748e 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -211,7 +211,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface // 禁止店铺自己下自己的单 if (in_array($userId, [$store->user_id, $store->admin_id])) { - throw new ErrorCodeException(ErrorCode::ORDER_ONLINE_FAIL, '无法购买自己店铺商品', ['store' => json_encode($store), 'user_id' => $userId, 'store_item' => $storeItem]); + throw new ErrorCodeException(ErrorCode::ORDER_ONLINE_LIMIT_STORE_BUY_SELF, '', ['store' => json_encode($store), 'user_id' => $userId, 'store_item' => $storeItem]); } $storeType = $store->category_id;