更新
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\adminapi\logic\tcm\DiagnosisLogic;
|
||||
use app\adminapi\logic\ConfigLogic;
|
||||
|
||||
/**
|
||||
* 中医诊断控制器(供小程序调用)
|
||||
@@ -27,7 +28,7 @@ class TcmController extends BaseApiController
|
||||
* @notes 不需要登录的方法
|
||||
* @var array
|
||||
*/
|
||||
public array $notNeedLogin = ['getPatientSignature'];
|
||||
public array $notNeedLogin = ['getPatientSignature', 'diagnosisDetail', 'getDict'];
|
||||
|
||||
/**
|
||||
* @notes 获取患者签名(供小程序调用)
|
||||
@@ -50,4 +51,44 @@ class TcmController extends BaseApiController
|
||||
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取诊单详情(供小程序调用)
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function diagnosisDetail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
|
||||
if (!$id) {
|
||||
return $this->fail('诊单ID不能为空');
|
||||
}
|
||||
|
||||
try {
|
||||
$result = DiagnosisLogic::detail(['id' => $id]);
|
||||
return $this->data($result);
|
||||
} catch (\Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取字典数据(供小程序调用)
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function getDict()
|
||||
{
|
||||
$type = $this->request->get('type', '');
|
||||
|
||||
if (!$type) {
|
||||
return $this->fail('字典类型不能为空');
|
||||
}
|
||||
|
||||
try {
|
||||
$data = ConfigLogic::getDictByType($type);
|
||||
return $this->data($data);
|
||||
} catch (\Exception $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user