修改消息推送,处方已开具,message_type类型,修改提现数据查询接口
This commit is contained in:
parent
b86c253d0f
commit
5ddc4d1c0a
@ -50,11 +50,16 @@ class DoctorAccountController extends AbstractController
|
||||
/**
|
||||
* 获取提现数据
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getDoctorWithdrawal(): ResponseInterface
|
||||
public function getDoctorWithdrawalInfo(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(DoctorAccountRequest::class);
|
||||
$request->scene('getDoctorWithdrawalInfo')->validateResolved();
|
||||
|
||||
$DoctorAccountService = new DoctorAccountService();
|
||||
$data = $DoctorAccountService->getDoctorWithdrawal();
|
||||
$data = $DoctorAccountService->getDoctorWithdrawalInfo();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,9 @@ class DoctorAccountRequest extends FormRequest
|
||||
'getDoctorWithdrawalRecordList' => [ // 获取医生提现记录列表
|
||||
'year',
|
||||
],
|
||||
'getDoctorWithdrawalInfo' => [ // 获取提现数据
|
||||
'order_inquiry_ids',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -137,10 +137,12 @@ class DoctorAccountService extends BaseService
|
||||
* 获取提现数据
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorWithdrawal(): array
|
||||
public function getDoctorWithdrawalInfo(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_inquiry_ids = $this->request->input('order_inquiry_ids');
|
||||
|
||||
// 获取医生信息
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
@ -184,9 +186,24 @@ class DoctorAccountService extends BaseService
|
||||
$result['bank_name'] = $doctor_bank_card['BasicBank']['bank_name'];
|
||||
$result['bank_card_code_mask'] = $doctor_bank_card['bank_card_code_mask'];
|
||||
|
||||
|
||||
// 获取医生账户余额
|
||||
$balance_account = $this->getDoctorBalanceAccount($user_info['client_user_id']);
|
||||
if (!empty($order_inquiry_ids)){
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['inquiry_status'] = 6; // inquiry_status:问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
$params['inquiry_refund_status'] = 0; // inquiry_refund_status:问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
|
||||
|
||||
$in_params = explode(',',$order_inquiry_ids);
|
||||
$order_inquiry = OrderInquiry::getInList($params,$in_params);
|
||||
if (empty($order_inquiry)){
|
||||
$balance_account = 0;
|
||||
}else{
|
||||
$balance_account = array_sum(array_column($order_inquiry->toArray(),'amount_total'));
|
||||
}
|
||||
}else{
|
||||
$balance_account = $this->getDoctorBalanceAccount($user_info['client_user_id']);
|
||||
}
|
||||
|
||||
if ($balance_account > 0) {
|
||||
$balance_account = $balance_account * 0.75;
|
||||
}
|
||||
|
||||
@ -1138,7 +1138,7 @@ class UserDoctorService extends BaseService
|
||||
|
||||
// 发送IM消息-处方已开具
|
||||
$imService = new ImService();
|
||||
$imService->prescriptionIssued($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id'],$product_name,(string)$order_prescription['order_prescription_id'],"6");
|
||||
$imService->prescriptionIssued($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id'],$product_name,(string)$order_prescription['order_prescription_id'],6);
|
||||
|
||||
// 加入分配药师队列
|
||||
$data = array();
|
||||
|
||||
@ -231,7 +231,7 @@ class UserPharmacistService extends BaseService
|
||||
|
||||
// 发送IM消息-处方已开具
|
||||
$imService = new ImService();
|
||||
$imService->prescriptionIssued($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id'],$product_name,(string)$order_prescription['order_prescription_id'],"7");
|
||||
$imService->prescriptionIssued($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id'],$product_name,(string)$order_prescription['order_prescription_id'],7);
|
||||
|
||||
// 发送站内、短信消息-患者的处方被药师审核通过
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||
|
||||
@ -128,7 +128,7 @@ Router::addGroup('/doctor', function () {
|
||||
// 提现
|
||||
Router::addGroup('/withdrawal', function () {
|
||||
// 获取提现数据
|
||||
Router::get('', [DoctorAccountController::class, 'getDoctorWithdrawal']);
|
||||
Router::post('info', [DoctorAccountController::class, 'getDoctorWithdrawalInfo']);
|
||||
|
||||
// 获取可提现问诊订单列表
|
||||
Router::get('/order', [DoctorAccountController::class, 'getDoctorWithdrawalOrderList']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user