H5号源性别筛选

main
yanzai 1 year ago
parent a07752dca9
commit d7f8ae9c57

@ -32,12 +32,12 @@ class PlanController extends Controller
->where(['hospital_id'=>$hospital_id,'type'=>1]) ->where(['hospital_id'=>$hospital_id,'type'=>1])
->where('is_vip','<>',1) ->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]); ->whereIn('use_type',[0,$use_type]);
// if($use_type==1){ if(isset($person_id)){
// $list=$list->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount); $personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
// } if(!!$personInfo){
// if($use_type==2){ $list=$list->whereIn('sex',[0,$personInfo->sex]);
// $list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount); }
// } }
if ($use_type == 1) { if ($use_type == 1) {
$list = $list->where(function ($query) use ($amount) { $list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount); $query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
@ -93,6 +93,10 @@ class PlanController extends Controller
$checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id $checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id
$amount=request('amount');//总金额 $amount=request('amount');//总金额
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空"); if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$personInfo=false;
if(isset($person_id)){
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
}
$currentDateTime = now(); $currentDateTime = now();
$list=DB::table('plans') $list=DB::table('plans')
->where('date',$date)->whereIn('status',[1,2]) ->where('date',$date)->whereIn('status',[1,2])
@ -101,6 +105,10 @@ class PlanController extends Controller
->where(['hospital_id'=>$hospital_id,'type'=>1]) ->where(['hospital_id'=>$hospital_id,'type'=>1])
->where('is_vip','<>',1) ->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]); ->whereIn('use_type',[0,$use_type]);
if(!!$personInfo){
$list=$list->whereIn('sex',[0,$personInfo->sex]);
}
if ($use_type == 1) { if ($use_type == 1) {
$list = $list->where(function ($query) use ($amount) { $list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount); $query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
@ -131,12 +139,10 @@ class PlanController extends Controller
->where(['hospital_id'=>$hospital_id,'type'=>1]) ->where(['hospital_id'=>$hospital_id,'type'=>1])
->where('is_vip','<>',1) ->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]); ->whereIn('use_type',[0,$use_type]);
// if($use_type==1){ if(!!$personInfo){
// $weeklist=$weeklist->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount); $weeklist=$weeklist->whereIn('sex',[0,$personInfo->sex]);
// } }
// 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(function ($query) use ($amount) { $weeklist = $weeklist->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount); $query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);

Loading…
Cancel
Save