|
|
|
|
@ -20,6 +20,10 @@ class PlanController extends Controller
|
|
|
|
|
$checkup_type_id=request('checkup_type_id');//体检类型表对应id
|
|
|
|
|
$amount=request('amount');//总金额
|
|
|
|
|
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
|
|
|
|
|
|
|
|
|
|
$danwei_id=request('danwei_id');//单位id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$first_day_timestamp = strtotime($month . '-01');
|
|
|
|
|
$first_day = date('Y-m-d', $first_day_timestamp); //当月第一天
|
|
|
|
|
$last_day_timestamp = strtotime($month . '-01 +1 month -1 day');
|
|
|
|
|
@ -31,7 +35,18 @@ class PlanController extends Controller
|
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [json_encode($checkup_type_id)])
|
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
|
|
|
|
|
->where('is_vip','<>',1)
|
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
|
->whereIn('use_type',[0,$use_type])
|
|
|
|
|
->where(function ($query) use ($danwei_id) {
|
|
|
|
|
// 检查 bind_work_unit_id 为 NULL 或空字符串
|
|
|
|
|
$query->whereNull('bind_work_unit_id')
|
|
|
|
|
->orWhere('bind_work_unit_id', '=', '');
|
|
|
|
|
|
|
|
|
|
// 如果 $danwei_id 不为空,则添加额外的条件
|
|
|
|
|
if (!empty($danwei_id)) {
|
|
|
|
|
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(isset($person_id)){
|
|
|
|
|
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
|
|
|
|
|
if(!!$personInfo){
|
|
|
|
|
@ -108,6 +123,9 @@ class PlanController extends Controller
|
|
|
|
|
$checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id
|
|
|
|
|
$amount=request('amount');//总金额
|
|
|
|
|
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
|
|
|
|
|
|
|
|
|
|
$danwei_id=request('danwei_id');//单位名称
|
|
|
|
|
|
|
|
|
|
$personInfo=false;
|
|
|
|
|
if(isset($person_id)){
|
|
|
|
|
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
|
|
|
|
|
@ -119,7 +137,20 @@ class PlanController extends Controller
|
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")',[$checkup_type_id])
|
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
|
|
|
|
|
->where('is_vip','<>',1)
|
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
|
->whereIn('use_type',[0,$use_type])
|
|
|
|
|
->where(function ($query) use ($danwei_id) {
|
|
|
|
|
// 检查 bind_work_unit_id 为 NULL 或空字符串
|
|
|
|
|
$query->whereNull('bind_work_unit_id')
|
|
|
|
|
->orWhere('bind_work_unit_id', '=', '');
|
|
|
|
|
|
|
|
|
|
// 如果 $danwei_id 不为空,则添加额外的条件
|
|
|
|
|
if (!empty($danwei_id)) {
|
|
|
|
|
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$comboItemsNmr=[];
|
|
|
|
|
if(!!$combo_id){
|
|
|
|
|
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first();
|
|
|
|
|
@ -184,7 +215,20 @@ class PlanController extends Controller
|
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
|
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
|
|
|
|
|
->where('is_vip','<>',1)
|
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
|
->whereIn('use_type',[0,$use_type])
|
|
|
|
|
->where(function ($query) use ($danwei_id) {
|
|
|
|
|
// 检查 bind_work_unit_id 为 NULL 或空字符串
|
|
|
|
|
$query->whereNull('bind_work_unit_id')
|
|
|
|
|
->orWhere('bind_work_unit_id', '=', '');
|
|
|
|
|
|
|
|
|
|
// 如果 $danwei_id 不为空,则添加额外的条件
|
|
|
|
|
if (!empty($danwei_id)) {
|
|
|
|
|
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(count($comboItemsNmr)>0 or count($ItemsNmr)>0 or !empty($er_xian_info)){
|
|
|
|
|
//如果有核磁项目,11点往后的号源不可用
|
|
|
|
|
$weeklist=$weeklist->where('time','<=','11:00');
|
|
|
|
|
|