PHP语句被忽略?

时间:2014-10-05 13:40:44

标签: php laravel

    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 contabilistatrue进行比较时,0给我{{1}}的情况如何?我错过了什么?

0 个答案:

没有答案