|
|
|
@ -29,11 +29,22 @@ class PlanController extends Controller
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1])
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1])
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
|
|
|
|
// if($use_type==1){
|
|
|
|
|
|
|
|
// $list=$list->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if($use_type==2){
|
|
|
|
|
|
|
|
// $list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount);
|
|
|
|
|
|
|
|
// }
|
|
|
|
if ($use_type == 1) {
|
|
|
|
if ($use_type == 1) {
|
|
|
|
$list=$list->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount);
|
|
|
|
$list = $list->where(function ($query) use ($amount) {
|
|
|
|
|
|
|
|
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($use_type == 2) {
|
|
|
|
if ($use_type == 2) {
|
|
|
|
$list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount);
|
|
|
|
$list = $list->where(function ($query) use ($amount) {
|
|
|
|
|
|
|
|
$query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$list=$list->select('date', DB::raw('COUNT(*) as count'));
|
|
|
|
$list=$list->select('date', DB::raw('COUNT(*) as count'));
|
|
|
|
$list=$list->groupBy('date')->get();
|
|
|
|
$list=$list->groupBy('date')->get();
|
|
|
|
@ -85,10 +96,15 @@ class PlanController extends Controller
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1])
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1])
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
if ($use_type == 1) {
|
|
|
|
if ($use_type == 1) {
|
|
|
|
$list=$list->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount);
|
|
|
|
$list = $list->where(function ($query) use ($amount) {
|
|
|
|
|
|
|
|
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($use_type == 2) {
|
|
|
|
if ($use_type == 2) {
|
|
|
|
$list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount);
|
|
|
|
$list = $list->where(function ($query) use ($amount) {
|
|
|
|
|
|
|
|
$query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$list=$list->get();
|
|
|
|
$list=$list->get();
|
|
|
|
|
|
|
|
|
|
|
|
@ -107,11 +123,22 @@ class PlanController extends Controller
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
|
|
|
|
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1])
|
|
|
|
->where(['hospital_id'=>$hospital_id,'type'=>1])
|
|
|
|
->whereIn('use_type',[0,$use_type]);
|
|
|
|
->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);
|
|
|
|
|
|
|
|
// }
|
|
|
|
if ($use_type == 1) {
|
|
|
|
if ($use_type == 1) {
|
|
|
|
$weeklist=$weeklist->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount);
|
|
|
|
$weeklist = $weeklist->where(function ($query) use ($amount) {
|
|
|
|
|
|
|
|
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($use_type == 2) {
|
|
|
|
if ($use_type == 2) {
|
|
|
|
$weeklist=$weeklist->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount);
|
|
|
|
$weeklist = $weeklist->where(function ($query) use ($amount) {
|
|
|
|
|
|
|
|
$query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$weeklist=$weeklist->select('date', DB::raw('COUNT(*) as count'));
|
|
|
|
$weeklist=$weeklist->select('date', DB::raw('COUNT(*) as count'));
|
|
|
|
$weeklist=$weeklist->groupBy('date')->get();
|
|
|
|
$weeklist=$weeklist->groupBy('date')->get();
|
|
|
|
|