102 lines
3.0 KiB
PHP
102 lines
3.0 KiB
PHP
<?php
|
||
|
||
namespace App\Controller;
|
||
|
||
use App\Request\UserPatientRequest;
|
||
use App\Services\MyDoctorService;
|
||
use App\Services\UserPatientService;
|
||
use Hyperf\Snowflake\IdGeneratorInterface;
|
||
use Psr\Container\ContainerExceptionInterface;
|
||
use Psr\Container\NotFoundExceptionInterface;
|
||
use Psr\Http\Message\ResponseInterface;
|
||
|
||
/**
|
||
* 患者
|
||
*/
|
||
class UserPatientController extends AbstractController
|
||
{
|
||
/**
|
||
* 获取患者个人中心数据
|
||
* @return ResponseInterface
|
||
*/
|
||
public function getPatientCenter(): ResponseInterface
|
||
{
|
||
$UserPatientService = new UserPatientService();
|
||
$data = $UserPatientService->getPatientCenter();
|
||
return $this->response->json($data);
|
||
}
|
||
|
||
/**
|
||
* 获取患者信息
|
||
* @return ResponseInterface
|
||
*/
|
||
public function getPatientCenterInfo(): ResponseInterface
|
||
{
|
||
$UserPatientService = new UserPatientService();
|
||
$data = $UserPatientService->getPatientCenterInfo();
|
||
return $this->response->json($data);
|
||
}
|
||
|
||
/**
|
||
* 获取患者优惠卷列表
|
||
* @return ResponseInterface
|
||
* @throws ContainerExceptionInterface
|
||
* @throws NotFoundExceptionInterface
|
||
*/
|
||
public function getPatientCouponlist(): ResponseInterface
|
||
{
|
||
$request = $this->container->get(UserPatientRequest::class);
|
||
$request->scene('getPatientCouponlist')->validateResolved();
|
||
|
||
$UserPatientService = new UserPatientService();
|
||
$data = $UserPatientService->getPatientCouponlist();
|
||
return $this->response->json($data);
|
||
}
|
||
|
||
/**
|
||
* 删除服务过患者的医生
|
||
* 首页-个人中心
|
||
* @return ResponseInterface
|
||
*/
|
||
public function deletePatientDoctor(): ResponseInterface
|
||
{
|
||
$UserPatientService = new UserPatientService();
|
||
$data = $UserPatientService->deletePatientDoctor();
|
||
return $this->response->json($data);
|
||
}
|
||
|
||
/**
|
||
* 获取购物车药品数据
|
||
* @return ResponseInterface
|
||
* @throws ContainerExceptionInterface
|
||
* @throws NotFoundExceptionInterface
|
||
*/
|
||
public function getShoppingCart(): ResponseInterface
|
||
{
|
||
$UserPatientService = new UserPatientService();
|
||
$data = $UserPatientService->getShoppingCart();
|
||
return $this->response->json($data);
|
||
}
|
||
|
||
/**
|
||
* 修改购物车药品数据
|
||
* @return ResponseInterface
|
||
* @throws ContainerExceptionInterface
|
||
* @throws NotFoundExceptionInterface
|
||
*/
|
||
public function putShoppingCart(): ResponseInterface
|
||
{
|
||
if (!in_array("1", [2, 3, 4, 5])) {
|
||
// 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||
dump(111);
|
||
}
|
||
die;
|
||
$request = $this->container->get(UserPatientRequest::class);
|
||
$request->scene('putShoppingCart')->validateResolved();
|
||
|
||
$UserPatientService = new UserPatientService();
|
||
$data = $UserPatientService->putShoppingCart();
|
||
return $this->response->json($data);
|
||
}
|
||
|
||
} |