diff --git a/app/Utils/API/PaymentNew.php b/app/Utils/API/PaymentNew.php index 6afbd9e..3929bf6 100644 --- a/app/Utils/API/PaymentNew.php +++ b/app/Utils/API/PaymentNew.php @@ -152,6 +152,17 @@ class PaymentNew } } catch (\GuzzleHttp\Exception\RequestException $e) { Log::warning("请求支付api失未知失败:" . $e->getMessage()); + // 如果是 400 错误,可能有额外的请求错误信息 + if ($e->hasResponse()) { + $response = $e->getResponse(); + $httpCode = $response->getStatusCode(); + if ($httpCode == 400) { + $responseBody = $response->getBody()->getContents(); + Log::warning("请求支付api失败,状态码 400,响应体:" . $responseBody); + } + } + + return -1; } } } diff --git a/app/controller/api/WithdrawController.php b/app/controller/api/WithdrawController.php index a723add..75a09eb 100644 --- a/app/controller/api/WithdrawController.php +++ b/app/controller/api/WithdrawController.php @@ -104,6 +104,11 @@ class WithdrawController //用户存了一个 转账信息 这里是用户转账信息的id $bank_id = $request->post('bank_id'); $user_id = $request->data['id']; + $today = date('Y-m-d'); + //判断用户今天提现几次 + if(Withdraw::where('user_id',$user_id)->where('created_at', '>=', $today . " 00:00:00")->count()>=3){ + return ApiResponseApp::error(null, '每天只能提现三次'); + } $user = User::find($user_id); //提现金额 $rate = ExchangeRate::where('type', 'BDT')->get();