【发布时间】:2015-05-12 16:06:37
【问题描述】:
我有这个雄辩的模型查询
public function getemployee(){
$id = $_POST['id'];
$employees = mot_users::where("branch_no", $id)->lists('user_no', 'lastname', 'firstname');
return response()->json(['success' => true, 'employees' => $employees]);
}
问题是这个“->lists();”只能处理 2 个作为 json 响应发送的列(通过控制台看到,仅发送 3 个中的 2 个选定的列)。如何在“->list()”中发送 3 列或多于 2 列,或者如果不可能的话,除了使用“->list()”之外还有其他的雄辩模型查询吗?
【问题讨论】: