获取我的账户月账单明细数据数据修改
This commit is contained in:
@@ -7,16 +7,23 @@ use App\Amqp\Producer\AutoCompleteInquiryDelayDirectProducer;
|
||||
use App\Amqp\Producer\AutoFinishInquiryDelayDirectProducer;
|
||||
use App\Amqp\Producer\CancelUnpayOrdersDelayDirectProducer;
|
||||
use App\Amqp\Producer\SendSmsMessageProducer;
|
||||
use App\Constants\DoctorTitleCode;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Factory\CacheFactory;
|
||||
use App\Factory\ProdRedisFactory;
|
||||
use App\Model\DoctorConfigFollowPackage;
|
||||
use App\Model\DoctorConfigFollowPackageItem;
|
||||
use App\Model\DoctorConfigHealthPackage;
|
||||
use App\Model\DoctorInquiryTime;
|
||||
use App\Model\HospitalDepartmentCustom;
|
||||
use App\Model\Order;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\OrderInquiryRefund;
|
||||
use App\Model\OrderPrescriptionProduct;
|
||||
use App\Model\OrderProduct;
|
||||
use App\Model\OrderProductItem;
|
||||
use App\Model\OrderServicePackageRefund;
|
||||
use App\Model\PatientFamily;
|
||||
use App\Model\ReportRegulatory;
|
||||
use App\Model\User;
|
||||
@@ -447,62 +454,112 @@ class TestController extends AbstractController
|
||||
}
|
||||
|
||||
public function test_17(){
|
||||
$expertise_id = $this->request->input('expertise_id');
|
||||
$province_id = $this->request->input('province_id');
|
||||
$city_id = $this->request->input('city_id');
|
||||
$sort_order = $this->request->input('sort_order',1);
|
||||
$keyword = $this->request->input('keyword',"");
|
||||
$is_search_welfare_reception = $this->request->input('is_search_welfare_reception',0); // 是否参加公益图文问诊(0:否 1:是)
|
||||
$is_first_online = $this->request->input('is_first_online',0); // 是否优先在线(1:是)
|
||||
$page = $this->request->input('page',1);
|
||||
$per_page = $this->request->input('per_page',10);
|
||||
$params = array();
|
||||
$params['doctor_id'] = "516900370252341248";
|
||||
|
||||
// 组合条件
|
||||
$hospital_params = array();// 医院搜索
|
||||
$doctor_params = array();// 医生搜索
|
||||
$doctor_expertise_params = array();// 医生专长搜索
|
||||
// 获取当月开始时间
|
||||
$start_date = date('Y-m-01 00:00:00', strtotime("2024-04-19"));
|
||||
|
||||
// 省市区
|
||||
if (!empty($province_id)) {
|
||||
if (empty($city_id)) {
|
||||
// 省份存在时需和城市在一块
|
||||
return fail(HttpEnumCode::CLIENT_HTTP_ERROR);
|
||||
// 获取当月结束时间
|
||||
// 获取给定月份的下一个月的第一天,然后减去一天得到当月的最后一天
|
||||
$end_date = date("Y-m-d 23:59:59", strtotime("+1 month", strtotime($start_date)) - 1);
|
||||
|
||||
$date_params = [$start_date, $end_date];
|
||||
|
||||
$results = Order::getDoctorCreatedDateOrderInquiryPage($params,$date_params,1,["*"]);
|
||||
if (!empty($results['data'])) {
|
||||
foreach ($results['data'] as &$result) {
|
||||
// 入账金额
|
||||
$result['estimate_income'] = bcmul((string)$result['amount_total'],"0.75",2);
|
||||
|
||||
// 入账状态-问诊订单
|
||||
if (!empty($result['OrderInquiry'])){
|
||||
if ($result['OrderInquiry']['inquiry_status'] == 4 || $result['OrderInquiry']['inquiry_status'] == 5){
|
||||
$result['entry_status'] = 1;// 入账中
|
||||
}elseif ($result['OrderInquiry']['inquiry_status'] == 6){
|
||||
$result['entry_status'] = 2;// 入账成功
|
||||
}elseif ($result['OrderInquiry']['inquiry_status'] == 7){
|
||||
$result['entry_status'] = 3;// 入账失败
|
||||
// 获取退款数据
|
||||
$params = array();
|
||||
$params['inquiry_no'] = $result['OrderInquiry']['inquiry_no'];
|
||||
$order_inquiry_refunds = OrderInquiryRefund::getList($params);
|
||||
if (!empty($order_inquiry_refunds)){
|
||||
$refund_total = 0;
|
||||
foreach ($order_inquiry_refunds as $order_inquiry_refund){
|
||||
$refund_total = $refund_total + $order_inquiry_refund['refund_total'];
|
||||
}
|
||||
|
||||
// 订单退款金额
|
||||
$result['refund_total'] = $refund_total;
|
||||
|
||||
if (($result['OrderInquiry']['payment_amount_total'] - $refund_total) > 0){
|
||||
$result['entry_status'] = 2;// 入账成功
|
||||
}else{
|
||||
$result['entry_status'] = 3;// 入账失败
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($result['OrderInquiry']['cancel_reason'])){
|
||||
$result['cancel_remarks'] = inquiryCancelReasonToPushString($result['OrderInquiry']['cancel_reason']);
|
||||
}
|
||||
}else{
|
||||
$result['entry_status'] = 0;// 未知
|
||||
}
|
||||
|
||||
$result['patient_name'] = $result['OrderInquiry']['patient_name'];
|
||||
$result['patient_name_mask'] = $result['OrderInquiry']['patient_name_mask'];
|
||||
$result['patient_sex'] = $result['OrderInquiry']['patient_sex'];
|
||||
$result['patient_age'] = $result['OrderInquiry']['patient_age'];
|
||||
$result['start_time'] = $result['OrderInquiry']['reception_time'];
|
||||
$result['finish_time'] = $result['OrderInquiry']['finish_time'];
|
||||
$result['inquiry_type'] = $result['OrderInquiry']['inquiry_type'];
|
||||
$result['inquiry_mode'] = $result['OrderInquiry']['inquiry_mode'];
|
||||
}
|
||||
|
||||
// 入账状态-服务包订单
|
||||
if (!empty($result['OrderServicePackage'])){
|
||||
if ($result['OrderServicePackage']['order_service_status'] == 3){
|
||||
$result['entry_status'] = 1;// 入账中
|
||||
}elseif ($result['OrderServicePackage']['order_service_status'] == 4){
|
||||
$result['entry_status'] = 2;// 入账成功
|
||||
}elseif ($result['OrderServicePackage']['order_service_status'] == 5){
|
||||
// 获取退款数据
|
||||
$params = array();
|
||||
$params['order_service_no'] = $result['OrderServicePackage']['order_service_no'];
|
||||
$order_service_package_refunds = OrderServicePackageRefund::getList($params);
|
||||
if (!empty($order_service_package_refunds)){
|
||||
$refund_total = 0;
|
||||
foreach ($order_service_package_refunds as $order_service_package_refund){
|
||||
$refund_total = $refund_total + $order_service_package_refund['refund_total'];
|
||||
}
|
||||
|
||||
// 订单退款金额
|
||||
$result['refund_total'] = $refund_total;
|
||||
|
||||
if (($result['OrderServicePackage']['payment_amount_total'] - $refund_total) > 0){
|
||||
$result['entry_status'] = 2;// 入账成功
|
||||
}else{
|
||||
$result['entry_status'] = 3;// 入账失败
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$result['entry_status'] = 0;// 未知
|
||||
}
|
||||
|
||||
$result['patient_name'] = $result['OrderServicePackage']['patient_name'];
|
||||
$result['patient_name_mask'] = $result['OrderServicePackage']['patient_name_mask'];
|
||||
$result['patient_sex'] = $result['OrderServicePackage']['patient_sex'];
|
||||
$result['patient_age'] = $result['OrderServicePackage']['patient_age'];
|
||||
$result['start_time'] = $result['OrderServicePackage']['start_time'];
|
||||
$result['finish_time'] = $result['OrderServicePackage']['finish_time'];
|
||||
}
|
||||
|
||||
unset($result['OrderInquiry']);
|
||||
unset($result['OrderServicePackage']);
|
||||
}
|
||||
$hospital_params[] = ['province_id', '=', $province_id];
|
||||
$hospital_params[] = ['city_id', '=', $city_id];
|
||||
}
|
||||
|
||||
// 医生专长
|
||||
if (!empty($expertise_id)) {
|
||||
$doctor_expertise_params['expertise_id'] = $expertise_id;
|
||||
}
|
||||
|
||||
// 固定医生查询条件
|
||||
$doctor_params['status'] = 1; // 状态(0:禁用 1:正常 2:删除)
|
||||
|
||||
$doctor_params["iden_auth_status"] = 1;// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
$doctor_params["is_bind_bank"] = 1;// 是否已绑定结算银行卡(0:否 1:是)
|
||||
|
||||
$fields = [
|
||||
"doctor_id",
|
||||
"user_id",
|
||||
"user_name",
|
||||
"multi_point_status",
|
||||
"is_bind_bank",
|
||||
"is_recommend",
|
||||
"avatar",
|
||||
"doctor_title",
|
||||
"department_custom_id",
|
||||
"department_custom_name",
|
||||
"hospital_id",
|
||||
"served_patients_num",
|
||||
"praise_rate",
|
||||
"avg_response_time",
|
||||
"number_of_fans",
|
||||
"be_good_at",
|
||||
];
|
||||
|
||||
$user_doctors = UserDoctor::getInquiryDoctorPageTest($keyword,$hospital_params, $doctor_params,$doctor_expertise_params,$is_search_welfare_reception,$is_first_online, $sort_order, ['*'],$page,$per_page);
|
||||
return success($user_doctors);
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user