pluck
只返回了一個字符public ?function ?query(){
? ?//查詢構(gòu)造器查詢數(shù)據(jù) ?get(),lists(), first(), select(), where(),chunk(), pluck(),
? ?//get() 獲取表的所以數(shù)據(jù)
? //$students= DB::table('student')->get();
? ?//first() 獲取表的一條數(shù)據(jù) 默認正序
? ?//$students= DB::table('student')->orderby('id','desc')->first()
? ?//;
? ?//where() 一個條件
? // $students= DB::table('student')->where('id','>=',15)->get();
? ?//where() 多個個條件
? ?//$students= DB::table('student')->whereRaw('id >=? and age>=?',[13,20])->get();
? ?//pluck()返回指定字段組成數(shù)組
? ?$students= DB::table('student')->pluck('name');
? ?dd($students);
}串
2017-03-29
啥問題?