From fb29a3e0e93038aaee7a35ba6424e5eba83e2284 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 19 Sep 2020 15:14:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=98=BE=E7=A4=BA=E5=95=86?= =?UTF-8?q?=E6=88=B7=E5=A4=B1=E6=95=88=E6=98=BE=E7=A4=BA=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/WithdrawController.php | 6 ++++-- app/Service/v3/Implementations/AppointmentTimeService.php | 3 ++- app/Service/v3/Implementations/ShopCartService.php | 3 ++- app/Service/v3/Implementations/StoreLoginService.php | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/Controller/v3/WithdrawController.php b/app/Controller/v3/WithdrawController.php index 97cd17c..2ab1f62 100644 --- a/app/Controller/v3/WithdrawController.php +++ b/app/Controller/v3/WithdrawController.php @@ -68,7 +68,8 @@ class WithdrawController extends BaseController $storeId = $this->request->input('store_id'); $store = Store::query()->where(['user_id' => $userId, 'id' => $storeId])->first(); if (empty($store)) { - throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); + $msg = ['user_id' => $userId, 'storeId' => $storeId]; + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,json_encode($msg)); } $data['balance'] = UserBalance::query() @@ -128,7 +129,8 @@ class WithdrawController extends BaseController $storeId = $this->request->input('store_id'); $store = Store::query()->where(['user_id' => $userId, 'id' => $storeId])->first(); if (empty($store)) { - throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE, '[稍后重试]'); + $msg = ['user_id' => $userId, 'storeId' => $storeId]; + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE, '[稍后重试]' . json_encode($msg)); } // 校验余额 diff --git a/app/Service/v3/Implementations/AppointmentTimeService.php b/app/Service/v3/Implementations/AppointmentTimeService.php index 37714c8..a2f1aa3 100644 --- a/app/Service/v3/Implementations/AppointmentTimeService.php +++ b/app/Service/v3/Implementations/AppointmentTimeService.php @@ -38,7 +38,8 @@ class AppointmentTimeService implements AppointmentTimeServiceInterface $sotreIds = ShoppingCart::query()->whereIn('id',$shopcartIds)->pluck('store_id'); $stores = Store::query()->whereIn('id',$sotreIds)->get()->toArray(); if(empty($stores)){ - throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); + $msg = ['id'=>$sotreIds]; + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,json_encode($msg)); } $time1Arr = []; $time2Arr = []; diff --git a/app/Service/v3/Implementations/ShopCartService.php b/app/Service/v3/Implementations/ShopCartService.php index 6a02069..919e783 100644 --- a/app/Service/v3/Implementations/ShopCartService.php +++ b/app/Service/v3/Implementations/ShopCartService.php @@ -169,7 +169,8 @@ class ShopCartService implements ShopCartServiceInterface $totalAmount = 0; foreach ($carts as $key => &$cart) { if (empty($cart->store)) { - throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); + $msg = ["car_module"=>"1","shopcartIdsArr"=>$shopcartIdsArr]; + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,json_encode($msg)); continue; } diff --git a/app/Service/v3/Implementations/StoreLoginService.php b/app/Service/v3/Implementations/StoreLoginService.php index 0aa7e4e..3bdc0fe 100644 --- a/app/Service/v3/Implementations/StoreLoginService.php +++ b/app/Service/v3/Implementations/StoreLoginService.php @@ -16,7 +16,9 @@ class StoreLoginService implements StoreLoginServiceInterface ['status','=',2] ])->first(); if(empty($storeUsersModel)){ - throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); + $msg = ["StoreLoginService"=>"1","account"=>$account]; + + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,json_encode($msg)); } $password = $this->stringHash($password,$storeUsersModel->salt); if($storeUsersModel->password === $password){