可提现问诊订单列表
This commit is contained in:
parent
ac529a570f
commit
e6afaf0913
@ -57,4 +57,15 @@ class DoctorAccountController extends AbstractController
|
||||
$data = $DoctorAccountService->getDoctorWithdrawal();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可提现问诊订单列表
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getDoctorWithdrawalOrderList(): ResponseInterface
|
||||
{
|
||||
$DoctorAccountService = new DoctorAccountService();
|
||||
$data = $DoctorAccountService->getDoctorWithdrawalOrderList();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ class OrderInquiry extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生接诊订单列表
|
||||
* 获取医生某一时间段接诊订单分页数据
|
||||
* 已结束
|
||||
* @param array $params
|
||||
* @param array $reception_time 接诊时间区间 ['2023-01-02','2023-01-03']
|
||||
@ -115,7 +115,7 @@ class OrderInquiry extends Model
|
||||
* @param int|null $per_page
|
||||
* @return int|mixed|string
|
||||
*/
|
||||
public static function getDoctorAccountInfoPage(array $params, array $reception_time,array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
|
||||
public static function getDoctorDateOrderInquiryPage(array $params, array $reception_time, array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
|
||||
{
|
||||
$raw = self::where($params)
|
||||
->whereBetween('finish_time',$reception_time)
|
||||
@ -132,6 +132,31 @@ class OrderInquiry extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生接诊订单分页数据
|
||||
* 已结束
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return int|mixed|string
|
||||
*/
|
||||
public static function getDoctorOrderInquiryPage(array $params,array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
|
||||
{
|
||||
$raw = self::where($params)
|
||||
->orderBy('finish_time')
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
$data['current_page'] = $raw->currentPage();// 当前页码
|
||||
$data['total'] = $raw->total();//数据总数
|
||||
$data['data'] = $raw->items();//数据
|
||||
$data['per_page'] = $raw->perPage();//每页个数
|
||||
$data['last_page'] = $raw->lastPage();//最后一页
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生某一时间段,某种状态的订单金额
|
||||
* @param array $params
|
||||
|
||||
@ -112,6 +112,7 @@ class DoctorAccountService extends BaseService
|
||||
'amount_total',
|
||||
'payment_amount_total',
|
||||
'reception_time',
|
||||
'finish_time',
|
||||
'patient_name',
|
||||
'patient_sex',
|
||||
'patient_age',
|
||||
@ -122,7 +123,7 @@ class DoctorAccountService extends BaseService
|
||||
$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:退款关闭)
|
||||
|
||||
$order_inquiry = OrderInquiry::getDoctorAccountInfoPage($params, $reception_time, $fields);
|
||||
$order_inquiry = OrderInquiry:: getDoctorDateOrderInquiryPage($params, $reception_time, $fields);
|
||||
if (!empty($order_inquiry['data'])) {
|
||||
foreach ($order_inquiry['data'] as &$item) {
|
||||
$item['amount_total'] = $item['amount_total'] * 0.75;
|
||||
@ -179,7 +180,7 @@ class DoctorAccountService extends BaseService
|
||||
|
||||
$result = array();
|
||||
$result['bank_card_id'] = $doctor_bank_card['bank_card_id'];
|
||||
$result['bank_img_path'] = $doctor_bank_card['BasicBank']['bank_img_path'];
|
||||
$result['bank_icon_path'] = $doctor_bank_card['BasicBank']['bank_icon_path'];
|
||||
$result['bank_name'] = $doctor_bank_card['BasicBank']['bank_name'];
|
||||
$result['bank_card_code_mask'] = $doctor_bank_card['bank_card_code_mask'];
|
||||
|
||||
@ -189,17 +190,64 @@ class DoctorAccountService extends BaseService
|
||||
if ($balance_account > 0) {
|
||||
$balance_account = $balance_account * 0.75;
|
||||
}
|
||||
$result['balance_account'] = floor($balance_account * 100) / 100;
|
||||
|
||||
// 计算医生个人所得税
|
||||
$income_tax = $this->computeIndividualIncomeTax($balance_account);
|
||||
|
||||
$result['withdrawal_amount'] = floor(($balance_account - $income_tax) * 100) / 100;
|
||||
|
||||
$income_tax = floor($income_tax * 100) / 100;
|
||||
$result['income_tax'] = $income_tax;
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可提现问诊订单列表
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorWithdrawalOrderList(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
// 获取医生当日接诊订单金额
|
||||
$fields = [
|
||||
'order_inquiry_id',
|
||||
'inquiry_type',
|
||||
'inquiry_mode',
|
||||
'inquiry_status',
|
||||
'inquiry_refund_status',
|
||||
'inquiry_no',
|
||||
'amount_total',
|
||||
'payment_amount_total',
|
||||
'reception_time',
|
||||
'finish_time',
|
||||
'patient_name',
|
||||
'patient_sex',
|
||||
'patient_age',
|
||||
];
|
||||
|
||||
$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:退款关闭)
|
||||
|
||||
$order_inquiry = OrderInquiry:: getDoctorOrderInquiryPage($params, $fields);
|
||||
if (!empty($order_inquiry['data'])) {
|
||||
foreach ($order_inquiry['data'] as &$item) {
|
||||
$item['amount_total'] = $item['amount_total'] * 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
return success($order_inquiry);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取医生账户余额
|
||||
* @param string $doctor_id
|
||||
|
||||
@ -111,6 +111,15 @@ Router::addGroup('/doctor', function () {
|
||||
Router::addGroup('/withdrawal', function () {
|
||||
// 获取提现数据
|
||||
Router::get('', [DoctorAccountController::class, 'getDoctorWithdrawal']);
|
||||
|
||||
// 获取可提现问诊订单列表
|
||||
Router::get('/order', [DoctorAccountController::class, 'getDoctorWithdrawalOrderList']);
|
||||
});
|
||||
|
||||
// 订单
|
||||
Router::addGroup('/order', function () {
|
||||
// 获取提现数据
|
||||
Router::get('/inquiry', [DoctorAccountController::class, 'getDoctorWithdrawal']);
|
||||
});
|
||||
|
||||
// 处方
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user