2015-08-15 95 views

回答

5

你可以。这会为你工作:

$query = DB::table('attendances'); 

if($flag == 1) { 
    $query->where('type', '=', $userinput) 
} else { 
    $query->where('type', '=', $newdate) 
} 

$result = $query->get(); 
+0

它的工作thankx一个looooooooooooot – sara