whereBetween('date',[$first_day,$last_day])->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){ $list=$list->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount); } if($use_type==2){ $list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount); } $list=$list->select('date', DB::raw('COUNT(*) as count')); $list=$list->groupBy('date')->get(); return \Yz::Return(true,"查询完成",['list'=>$list]); } //获取某日号源列表 public function GetDayPlanList() { $hospital_id =request('hospital'); $openid =request('openid'); $person_id=request('person_id'); $date=request('date'); $use_type=request('use_type');//使用类型 1个检 2团检 $checkup_type_id=request('checkup_type_id');//体检类型表对应id $amount=request('amount');//总金额 $list=DB::table('plans') ->where('date',$date)->whereIn('status',[1,2]) ->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){ $list=$list->where(['amount_limit1'=>0])->orWhere('amount_limit1','>=',$amount); } if($use_type==2){ $list=$list->where(['amount_limit2'=>0])->orWhere('amount_limit2','>=',$amount); } $list=$list->get(); return \Yz::Return(true,"查询完成",['list'=>$list]); } }