103 lines
3.2 KiB
PHP
103 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\DoctorAccountRequest;
|
|
use App\Request\UserDoctorRequest;
|
|
use App\Services\DoctorAccountService;
|
|
use App\Utils\PcreMatch;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
/**
|
|
* 医生账户
|
|
*/
|
|
class DoctorAccountController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取我的账户数据
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getDoctorAccount(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(DoctorAccountRequest::class);
|
|
$request->scene('getDoctorAccount')->validateResolved();
|
|
|
|
$DoctorAccountService = new DoctorAccountService();
|
|
$data = $DoctorAccountService->getDoctorAccount();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取我的账户月账单明细数据
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getDoctorAccountInfo(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(DoctorAccountRequest::class);
|
|
$request->scene('getDoctorAccountInfo')->validateResolved();
|
|
|
|
$DoctorAccountService = new DoctorAccountService();
|
|
$data = $DoctorAccountService->getDoctorAccountInfo();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取提现数据
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getDoctorWithdrawalInfo(): ResponseInterface
|
|
{
|
|
$DoctorAccountService = new DoctorAccountService();
|
|
$data = $DoctorAccountService->getDoctorWithdrawalInfo();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取可提现订单列表
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getDoctorWithdrawalOrderList(): ResponseInterface
|
|
{
|
|
$DoctorAccountService = new DoctorAccountService();
|
|
$data = $DoctorAccountService->getDoctorWithdrawalOrderList();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取医生提现记录列表
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getDoctorWithdrawalRecordList(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(DoctorAccountRequest::class);
|
|
$request->scene('getDoctorWithdrawalRecordList')->validateResolved();
|
|
|
|
$DoctorAccountService = new DoctorAccountService();
|
|
$data = $DoctorAccountService->getDoctorWithdrawalRecordList();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 发起提现
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function addDoctorWithdrawal(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(DoctorAccountRequest::class);
|
|
$request->scene('addDoctorWithdrawal')->validateResolved();
|
|
|
|
$DoctorAccountService = new DoctorAccountService();
|
|
$data = $DoctorAccountService->addDoctorWithdrawal();
|
|
return $this->response->json($data);
|
|
}
|
|
} |