我有这个查询
DB::table('my_table')->whereIn('column_id', $tagList)->get(array('product_id'));
但结果我得到了一组stdClass对象
array (size=2)
0 =>
object(stdClass)[964]
public 'product_id' => int 19
1 =>
object(stdClass)[961]
public 'product_id' => int 20
有可能将值作为简单数组获得吗?
array (size=2)
0 => 19
1 => 20
答案 0 :(得分:1)
使用lists
DB::table('my_table')->whereIn('column_id', $tagList)->lists('child_id');