获取我的账户数据-获取医生服务包每月账单数据
This commit is contained in:
@@ -75,22 +75,26 @@ class DoctorAccountService extends BaseService
|
||||
$balance_account = $doctor_account['balance_account'];
|
||||
}
|
||||
|
||||
// 获取医生每月账单数据
|
||||
$bill = [];
|
||||
// 获取医生问诊每月账单数据
|
||||
// $bill = [];
|
||||
//
|
||||
// $params = array();
|
||||
// $params['doctor_id'] = $user_info['client_user_id'];
|
||||
// $params['year'] = $year;
|
||||
// $doctor_account_days = DoctorAccountDay::getDoctorMonth($params);
|
||||
// if (!empty($doctor_account_days)) {
|
||||
// foreach ($doctor_account_days as $doctor_account_day) {
|
||||
// $data = array();
|
||||
// $data['total_amount'] = bcmul((string)$doctor_account_day['total_amount'], 1, 2);
|
||||
// $data['month'] = $doctor_account_day['month'];
|
||||
// $bill[] = $data;
|
||||
// }
|
||||
// unset($doctor_account_days);
|
||||
// }
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['year'] = $year;
|
||||
$doctor_account_days = DoctorAccountDay::getDoctorMonth($params);
|
||||
if (!empty($doctor_account_days)) {
|
||||
foreach ($doctor_account_days as $doctor_account_day) {
|
||||
$data = array();
|
||||
$data['total_amount'] = bcmul((string)$doctor_account_day['total_amount'], 1, 2);
|
||||
$data['month'] = $doctor_account_day['month'];
|
||||
$bill[] = $data;
|
||||
}
|
||||
unset($doctor_account_days);
|
||||
}
|
||||
// 获取医生服务包每月账单数据
|
||||
$year = date('Y',strtotime($year));
|
||||
$bill = $this->getDoctorMonthlyGroupBill($user_doctor,$year);
|
||||
|
||||
$result = array();
|
||||
$result['doctor_today_inquiry_total'] = bcmul((string)$doctor_today_total, "0.75", 2); // 今日预计收入
|
||||
@@ -121,9 +125,6 @@ class DoctorAccountService extends BaseService
|
||||
return fail();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
||||
|
||||
// 获取当月开始时间
|
||||
$start_date = date('Y-m-01 00:00:00', strtotime($date));
|
||||
|
||||
@@ -133,7 +134,7 @@ class DoctorAccountService extends BaseService
|
||||
|
||||
$date_params = [$start_date, $end_date];
|
||||
|
||||
$results = Order::getDoctorCreatedDateOrderInquiryPage($params, $date_params, $user_doctor['is_platform_deep_cooperation'], ['*'], $page, $per_page);
|
||||
$results = Order::getDoctorCreatedDateOrderInquiryPage($user_doctor['doctor_id'], $date_params, $user_doctor['is_platform_deep_cooperation'], ['*'], $page, $per_page);
|
||||
if (!empty($results['data'])) {
|
||||
$OrderService = new OrderService();
|
||||
|
||||
@@ -865,4 +866,41 @@ class DoctorAccountService extends BaseService
|
||||
|
||||
return $income_tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生每月账单数据
|
||||
* @param array|object $user_doctor
|
||||
* @param string $year
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorMonthlyGroupBill(array|object $user_doctor,string $year): array
|
||||
{
|
||||
// 获取医生服务包每月账单数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
||||
$order_service_package = OrderServicePackage::getMonthlyGroupBill($params,$year);
|
||||
if (!empty($order_service_package)){
|
||||
$order_service_package = $order_service_package->toArray();
|
||||
}
|
||||
|
||||
// 获取医生问诊每月账单数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];;
|
||||
$order_inquiry = OrderInquiry::getMonthlyGroupBill($params,$year,$user_doctor['is_platform_deep_cooperation']);
|
||||
if (!empty($order_inquiry)){
|
||||
$order_inquiry = $order_inquiry->toArray();
|
||||
}
|
||||
|
||||
// 处理月账单数据
|
||||
// 合并两个数组
|
||||
$merged = array_merge($order_service_package, $order_inquiry);
|
||||
|
||||
// 去除重复的元素
|
||||
$bill = array_unique($merged, SORT_REGULAR);
|
||||
|
||||
// 重新索引数组
|
||||
$bill = array_values($bill);
|
||||
|
||||
return $bill;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user