新增功能
This commit is contained in:
@@ -62,6 +62,9 @@ class PayController extends BaseApiController
|
||||
if (false === $order) {
|
||||
return $this->fail(PaymentLogic::getError(), $params);
|
||||
}
|
||||
if (empty($order['user_id'])) {
|
||||
$order['user_id'] = $this->userId;
|
||||
}
|
||||
//支付流程
|
||||
$redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
|
||||
$result = PaymentLogic::pay($params['pay_way'], $params['from'], $order, $this->userInfo['terminal'], $redirectUrl);
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user