完善号源接口,修改各种细节

wenjuan
yanzai 1 year ago
parent 2808e86137
commit fb8f815be2

@ -54,6 +54,8 @@ class ApiMapController extends Controller
'StartPay' => $base_url . '/api/H5/StartPay',//开始支付
'CheckPay' => $base_url . '/api/H5/CheckPay',//支付查询
'Refund' => $base_url . '/api/H5/Refund',//退款
'GetMonthPlanCount' => $base_url . '/api/H5/GetMonthPlanCount',//按月获取每日号源
'GetDayPlanList' => $base_url . '/api/H5/GetDayPlanList',//获取每日号源
];
}

@ -347,10 +347,10 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
'true_price'=>$true_price,//需要用户支付的金的
'original_price'=>$all_original_price,//总原价
'pay_item_count'=>$pay_item_count,//需要付费的项目数量
'nmr_list'=>[
'nmr_list'=>[[
'item_id'=>"1",
"name"=>"磁共振平扫(腰椎)"
]//核磁项目列表
]]//核磁项目列表
];
return \Yz::Return(true,"查询成功",$data);
}

@ -5,6 +5,7 @@ namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class PersonController extends Controller
{
@ -24,6 +25,13 @@ class PersonController extends Controller
];
}
}
$checkup_type=DB::table('checkup_type')->where(['status'=>1,'is_del'=>0])->get();
$checkup_type_id=0;
foreach ($checkup_type as $ct) {
if($group_info['体检类型']==$ct->name){
$checkup_type_id=$ct->id;
}
}
$data=[
'name' => $group_info['姓名'],
'id_number' => $group_info['证件号码'],
@ -36,6 +44,7 @@ class PersonController extends Controller
'group_id' => $group_info['预约Id'],
'tongshou_xiane'=>$group_info['统收限额'],
'sixi_zong_ji_jin_e'=>$group_info['总计金额'],
'checkup_type_id'=>$checkup_type_id,
'items' => $items,
];
$group_list[]=$data;

@ -3,6 +3,7 @@
namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\Controller;
use DateTime;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
@ -36,7 +37,36 @@ class PlanController extends Controller
}
$list=$list->select('date', DB::raw('COUNT(*) as count'));
$list=$list->groupBy('date')->get();
return \Yz::Return(true,"查询完成",['list'=>$list]);
//获取整月日期
// 获取当月的第一天
$firstDay = date("Y-m-d", strtotime($month . "-01"));
// 获取当月的最后一天
$lastDay = date("Y-m-t", strtotime($month));
$dates = array();
$k=0;
for ($i = $firstDay; $i <= $lastDay; $i = date("Y-m-d", strtotime($i . " +1 day"))) {
$xingqi=\App\Lib\Tools::GetWeekName($i);
$dates[]=[
'date'=>$i,
'xingqi'=>$xingqi,
'count'=>0
];
foreach ($list as $item) {
if($item->date == $i){
$dates[$k]=[
'date'=>$i,
'xingqi'=>$xingqi,
'count'=>$item->count
];
break;
}
}
$k++;
}
return \Yz::Return(true,"查询完成",['list'=>$dates]);
}
//获取某日号源列表
public function GetDayPlanList()
@ -61,7 +91,54 @@ class PlanController extends Controller
$list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount);
}
$list=$list->get();
return \Yz::Return(true,"查询完成",['list'=>$list]);
// 获取前后各三天的日期
$dateTime = new DateTime($date);
$days7=[];
for ($i = -3; $i <= 3; $i++) {
$dateTimeClone = clone $dateTime; // 克隆对象以避免修改原对象
$dateTimeClone->modify("$i days"); // 修改日期
$days7[] = $dateTimeClone->format('Y-m-d'); // 按照需要的格式添加到结果数组
}
$weeklist=DB::table('plans')
->whereBetween('date',[$days7[0],$days7[6]])->whereIn('status',[1])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
->where(['hospital_id'=>$hospital_id,'type'=>1])
->whereIn('use_type',[0,$use_type]);
if($use_type==1){
$weeklist=$weeklist->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount);
}
if($use_type==2){
$weeklist=$weeklist->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount);
}
$weeklist=$weeklist->select('date', DB::raw('COUNT(*) as count'));
$weeklist=$weeklist->groupBy('date')->get();
$week7=[];
$k=0;
foreach ($days7 as $date) {
$xingqi=\App\Lib\Tools::GetWeekName($date);
$week7[]=[
'date'=>$date,
'count'=>0,
'xingqi'=>$xingqi
];
foreach ($weeklist as $plan) {
if($plan->date == $date){
$week7[$k]=[
'date'=>$date,
'xingqi'=>$xingqi,
'count'=>$plan->count
];
break;
}
}
$k++;
}
return \Yz::Return(true,"查询完成",['list'=>$list,'weeklist'=>$week7]);
}
//检查号源是否可用
public function CheckPlan($plan_id,$hospital_id,$type,$sex,$price,$checkup_type_id)

@ -125,10 +125,10 @@ class XCXApiController extends Controller
// $method = 'POST';
// $url = '/jeecg-boot/hospital/openapi/order/create';
// $timestamp = "1727226133";
// $nonce = 'V50f38fJzFuCAxWG';
// $timestamp = "1727231032";
// $nonce = 'km4W4cjDqwNee1Tw';
// $body = 'amount=1&appid=13a159e438a742dd932c9bddbfaa41e5&ghzid=c5ce8410ba854d879a0abf689923ca0d&order_desc=单位团检&orderid=20240915183440999WMp2yu&sub_org_code=6';
//dd($body);
$private_key = Storage::get('keys/private_key.pem');
$SignStr = $method . "\n" .
$url . "\n" .
@ -143,7 +143,7 @@ class XCXApiController extends Controller
// 对签名结果进行 Base64 编码
$base64Signature = base64_encode($signature);
// dd($base64Signature);
if ($is_urlencode) {
$base64Signature = urlencode($base64Signature);
}

@ -0,0 +1,39 @@
<?php
namespace App\Lib;
class Tools
{
//查询某天是星期几
public static function GetWeekName($date)
{
$dayOfWeek = date('N', strtotime($date)); // 获取星期几1代表星期一7代表星期日
$weekname='';
switch ($dayOfWeek) {
case 1:
$weekname= "星期一";
break;
case 2:
$weekname= "星期二";
break;
case 3:
$weekname="星期三";
break;
case 4:
$weekname= "星期四";
break;
case 5:
$weekname= "星期五";
break;
case 6:
$weekname= "星期六";
break;
case 7:
$weekname= "星期日";
break;
default:
$weekname= "无效日期";
}
return $weekname;
}
}
Loading…
Cancel
Save