更新初级版本

This commit is contained in:
Your Name
2026-03-06 17:30:37 +08:00
parent 52bb80e2f1
commit 7b76671988
19 changed files with 1656 additions and 370 deletions
+42 -4
View File
@@ -28,7 +28,7 @@ class TcmController extends BaseApiController
* @notes 不需要登录的方法
* @var array
*/
public array $notNeedLogin = ['getPatientSignature', 'diagnosisDetail', 'getDict'];
public array $notNeedLogin = ['getPatientSignature', 'diagnosisDetail', 'getDict', 'confirmDiagnosis'];
/**
* @notes 获取患者签名(供小程序调用)
@@ -58,20 +58,58 @@ class TcmController extends BaseApiController
*/
public function diagnosisDetail()
{
$id = $this->request->get('id');
$params = [
'id' => $this->request->get('id'),
'user_id' => $this->request->get('user_id', 0),
'share_user_id' => $this->request->get('share_user_id', 0)
];
if (!$id) {
if (!$params['id']) {
return $this->fail('诊单ID不能为空');
}
try {
$result = DiagnosisLogic::detail(['id' => $id]);
$result = DiagnosisLogic::diagnosisDetailWithRecord($params);
if ($result === false) {
return $this->fail(DiagnosisLogic::getError());
}
return $this->data($result);
} catch (\Exception $e) {
return $this->fail($e->getMessage());
}
}
/**
* @notes 确认诊单(供小程序调用)
* @return \think\response\Json
*/
public function confirmDiagnosis()
{
$params = [
'id' => $this->request->post('id'),
'user_id' => $this->userId,
'share_user_id' => $this->request->post('share_user', 0)
];
if (!$params['id']) {
return $this->fail('诊单ID不能为空');
}
try {
$result = DiagnosisLogic::confirmDiagnosisRecord($params);
if ($result === false) {
return $this->fail(DiagnosisLogic::getError());
}
return $this->success('确认成功');
} catch (\Exception $e) {
return $this->fail($e->getMessage());
}
}
/**
* @notes 获取字典数据(供小程序调用)
* @return \think\response\Json