新增提现模型,修正我的账户
This commit is contained in:
@@ -5,8 +5,8 @@ namespace App\Services;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\DoctorAccount;
|
||||
use App\Model\DoctorAccountDay;
|
||||
use App\Model\DoctorAccountMonth;
|
||||
use App\Model\DoctorBankCard;
|
||||
use App\Model\DoctorWithdrawal;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\UserDoctor;
|
||||
|
||||
@@ -31,31 +31,24 @@ class DoctorAccountService extends BaseService
|
||||
$balance_account = $balance_account * 0.75;
|
||||
}
|
||||
|
||||
// 月余额-已结束订单
|
||||
$amount_total_month = 0;
|
||||
// 获取医生月度余额
|
||||
$amount_total_month = $this->getDoctorMonthAmountTotal($user_info['client_user_id'],$date);;
|
||||
|
||||
// 月已提现金额
|
||||
$withdrawal_amount_month = 0;
|
||||
|
||||
// 获取医生账户某月数据
|
||||
// 获取医生月度已提现金额-审核通过时间为准
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['year'] = date('Y',strtotime($date));
|
||||
$params['month'] = date('m',strtotime($date));
|
||||
$doctor_account_month = DoctorAccountMonth::getOne($params);
|
||||
if (!empty($doctor_account_month)){
|
||||
if (!empty($doctor_account_month['total_amount'])){
|
||||
$amount_total_month = $doctor_account_month['total_amount'] * 0.75;
|
||||
}
|
||||
|
||||
$withdrawal_amount_month = $doctor_account_month['withdrawal_amount'] ?: 0;
|
||||
$doctor_withdrawal = DoctorWithdrawal::getOne($params);
|
||||
if (empty($doctor_withdrawal)){
|
||||
$withdrawal_amount_month = 0;
|
||||
}else{
|
||||
$withdrawal_amount_month = $doctor_withdrawal['actual_withdrawal_amount'];
|
||||
}
|
||||
|
||||
// 获取医生每日账单数据
|
||||
$bill = [];
|
||||
|
||||
$fields = [
|
||||
'total_amount_day',
|
||||
'total_amount',
|
||||
'month',
|
||||
'day',
|
||||
];
|
||||
@@ -68,7 +61,7 @@ class DoctorAccountService extends BaseService
|
||||
if (!empty($doctor_account_days)){
|
||||
foreach ($doctor_account_days as $doctor_account_day){
|
||||
$data = array();
|
||||
$data['total_amount_day'] = $doctor_account_day['total_amount_day'] * 0.75;
|
||||
$data['total_amount'] = $doctor_account_day['total_amount'] * 0.75;
|
||||
$data['month'] = $doctor_account_day['month'];
|
||||
$data['day'] = $doctor_account_day['day'];
|
||||
$bill[] = $data;
|
||||
@@ -123,12 +116,13 @@ class DoctorAccountService extends BaseService
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
// $params['cancel_reason'] = ;
|
||||
$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);
|
||||
if (!empty($order_inquiry['data'])){
|
||||
foreach ($order_inquiry['data'] as &$item){
|
||||
$item['estimate_income'] = $item['amount_total'] * 0.75;
|
||||
$item['amount_total'] = $item['amount_total'] * 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,28 +206,32 @@ class DoctorAccountService extends BaseService
|
||||
return $balance_account;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取医生账户某日预计收益
|
||||
// * @param string $doctor_id 医生id
|
||||
// * @param string $day 日期 Ymd形式
|
||||
// * @return float|int|mixed|string
|
||||
// */
|
||||
// public function getDoctorDayAmountTotal(string $doctor_id, string $day): mixed
|
||||
// {
|
||||
// $params = array();
|
||||
// $params['doctor_id'] = $doctor_id;
|
||||
// $params['year'] = date('Y',strtotime($day));
|
||||
// $params['month'] = date('m',strtotime($day));
|
||||
// $params['day'] = date('d',strtotime($day));
|
||||
// $total_amount_day = DoctorAccountDay::getDoctorSumTotalAmount($params);
|
||||
// if (!empty($total_amount_day)){
|
||||
// $total_amount_day = $total_amount_day * 0.75;
|
||||
// }
|
||||
//
|
||||
// return $total_amount_day ?: 0;
|
||||
// }
|
||||
/**
|
||||
* 获取某月医生账户已结束订单金额
|
||||
* @param string $doctor_id 医生id
|
||||
* @param string $date 日期 Ymd形式
|
||||
* @return float|int|mixed|string
|
||||
*/
|
||||
public function getDoctorMonthAmountTotal(string $doctor_id, string $date): mixed
|
||||
{
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['year'] = date('Y',strtotime($date));
|
||||
$params['month'] = date('m',strtotime($date));
|
||||
|
||||
$total_amount = DoctorAccountDay::getDoctorSumTotalAmount($params);
|
||||
if (empty($total_amount)){
|
||||
$total_amount = 0;
|
||||
}
|
||||
|
||||
return $total_amount;
|
||||
}
|
||||
|
||||
// 获取医生某月提现数据
|
||||
// 审核通过时间为准
|
||||
public function getDoctorMonthWithdrawalData(){
|
||||
|
||||
}
|
||||
|
||||
// 计算个人所得税
|
||||
protected function computeIndividualIncomeTax(){
|
||||
|
||||
Reference in New Issue
Block a user