更新
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\logic\DoctorLogic;
|
||||
|
||||
/**
|
||||
* 医生控制器
|
||||
* Class DoctorController
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class DoctorController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['lists', 'detail'];
|
||||
|
||||
/**
|
||||
* @notes 获取医生列表
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$page_no = $this->request->get('page_no', 1);
|
||||
$page_size = $this->request->get('page_size', 10);
|
||||
$keyword = $this->request->get('keyword', '');
|
||||
|
||||
$params = [
|
||||
'page_no' => $page_no,
|
||||
'page_size' => $page_size,
|
||||
'keyword' => $keyword
|
||||
];
|
||||
|
||||
$result = DoctorLogic::getDoctorList($params);
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取医生详情
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$doctorId = $this->request->get('id', 0);
|
||||
|
||||
if (!$doctorId) {
|
||||
return $this->fail('医生ID不能为空');
|
||||
}
|
||||
|
||||
$result = DoctorLogic::getDoctorDetail($doctorId);
|
||||
|
||||
if (!$result) {
|
||||
return $this->fail('医生不存在');
|
||||
}
|
||||
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取医生排班
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function roster()
|
||||
{
|
||||
$doctorId = $this->request->get('doctor_id', 0);
|
||||
$date = $this->request->get('date', '');
|
||||
|
||||
if (!$doctorId || !$date) {
|
||||
return $this->fail('参数不能为空');
|
||||
}
|
||||
|
||||
$result = DoctorLogic::getDoctorRoster($doctorId, $date);
|
||||
return $this->success('', $result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user