echo 'position: '.$position.'<br/>district: '.$district;
if($position == 0 && $district == 0){
$results = DB::table('salaries')
->join('districts', 'salary_district', '=', 'district_id')
->join('companies', 'salary_company', '=', 'company_id')
->join('positions', 'salary_position', '=', 'position_id')
->paginate($pages);
echo '<br/>first';
} elseif($district == 0 && $position != 0){
$results = DB::table('salaries')
->join('districts', 'salary_district', '=', 'district_id')
->join('companies', 'salary_company', '=', 'company_id')
->join('positions', 'salary_position', '=', 'position_id')
->where('position_name', '=', $position)
->paginate($pages);
echo '<br/>second';
} else {
$results = DB::table('salaries')
->join('districts', 'salary_district', '=', 'district_id')
->join('companies', 'salary_company', '=', 'company_id')
->join('positions', 'salary_position', '=', 'position_id')
->where('position_name', '=', $position)
->where('district_id', '=', $district)
->paginate($pages);
echo '<br/>third';
}
输出:
position: Contabilista
district: 0
first
$position
contabilista
与true
进行比较时,0
给我{{1}}的情况如何?我错过了什么?