diff --git a/app/Command/PaymentCommand.php b/app/Command/PaymentCommand.php index b7095fd..ffd8c64 100644 --- a/app/Command/PaymentCommand.php +++ b/app/Command/PaymentCommand.php @@ -47,10 +47,11 @@ class PaymentCommand extends HyperfCommand * @var PaymentService $paymentService */ $paymentService = $this->container->make(PaymentService::class); - $fiveMinute = date('Y-m-d H:i:s', time() - 6*60); - $orders = Order::where('updated_at', '<=', $fiveMinute)->where('status', 'SUCCESS')->get(); + $endTime = date('Y-m-d H:i:s', time() - 6*60); + $beginTime = date('Y-m-d H:i:s', time() - 20*60); + $orders = Order::where('updated_at', '>=', $beginTime)->where('updated_at', '<=', $endTime)->where('status', 'SUCCESS')->get(); foreach ($orders as $order) { - if ($order->user_id != 'ELF1990') { + if ($order->user_id != 'ELF1990' && strpos($order->user_id, 'ACT_') !== 0) { continue; } $userId = $order->user_id; diff --git a/app/Controller/Payment/AccountController.php b/app/Controller/Payment/AccountController.php index fb69ea0..8b545d5 100644 --- a/app/Controller/Payment/AccountController.php +++ b/app/Controller/Payment/AccountController.php @@ -185,4 +185,13 @@ class AccountController extends AbstractController } return 'ACT_' . $accountId; } + + public function companyRegister(RequestInterface $request) + { + $userInfo = $this->checkUser($request); + $userId = $this->resetUserId($userInfo['userId']); + $requestLog = $this->createRequestLog(['userId' => $userId, 'email' => $request->input('email'), 'returnUrl' => 'http://124.223.222.61:9701/account.html']); + $url = $this->userService->companyRegister($requestLog->getData(), $requestLog->app, $requestLog->request_token); + return $this->success(['url' => $url]); + } } diff --git a/config/routes.php b/config/routes.php index ca5b8b6..ea3b739 100644 --- a/config/routes.php +++ b/config/routes.php @@ -47,6 +47,7 @@ Router::addGroup('/account',function () { Router::post('/reset-pay-password', [AccountController::class, 'resetPayPassword']); Router::post('/transfer-pay', [AccountController::class, 'transferPay']); Router::post('/user-info', [AccountController::class, 'getUserInfo']); + Router::get('/company-register', [AccountController::class, 'companyRegister']); }, []); Router::addGroup('/notify',function () {