新增功能

This commit is contained in:
Your Name
2026-03-14 11:16:04 +08:00
parent eb283f008b
commit 4ddee40675
264 changed files with 5039 additions and 2813 deletions
+38 -2
View File
@@ -28,7 +28,7 @@ class TcmController extends BaseApiController
* @notes 不需要登录的方法
* @var array
*/
public array $notNeedLogin = ['getPatientSignature', 'diagnosisDetail', 'getDict', 'confirmDiagnosis', 'getCardList'];
public array $notNeedLogin = ['getPatientSignature', 'diagnosisDetail', 'getDict', 'confirmDiagnosis', 'getCardList', 'getOrderByNo'];
/**
* @notes 获取患者签名(供小程序调用)
@@ -60,7 +60,7 @@ class TcmController extends BaseApiController
{
$params = [
'id' => $this->request->get('id'),
'user_id' => $this->request->get('user_id', 0),
'user_id' => $this->userId,
'share_user_id' => $this->request->get('share_user_id', 0)
];
@@ -238,4 +238,40 @@ class TcmController extends BaseApiController
return $this->fail($e->getMessage());
}
}
/**
* @notes 根据订单号获取订单详情(供小程序支付页调用)
* @return \think\response\Json
*/
public function getOrderByNo()
{
$orderNo = $this->request->get('order_no', '');
if (empty($orderNo)) {
return $this->fail('订单号不能为空');
}
try {
$order = \app\common\model\Order::where('order_no', $orderNo)->find();
if (!$order) {
return $this->fail('订单不存在');
}
$typeMap = [1 => '挂号费', 2 => '问诊费', 3 => '药品费用'];
$statusMap = [1 => '待支付', 2 => '已支付', 3 => '已取消', 4 => '已退款'];
return $this->data([
'id' => $order['id'],
'order_no' => $order['order_no'],
'order_type' => $order['order_type'],
'order_type_desc' => $typeMap[$order['order_type']] ?? '未知',
'amount' => $order['amount'],
'status' => $order['status'],
'status_desc' => $statusMap[$order['status']] ?? '未知',
'remark' => $order['remark'] ?? '',
'create_time' => $order['create_time'],
]);
} catch (\Exception $e) {
return $this->fail($e->getMessage());
}
}
}