【发布时间】:2015-08-10 23:55:34
【问题描述】:
我正在做一些连接并尝试获取数据。我的查询生成器是:
$datasource = DB::table('vehicles')->join('brands', 'vehicles.brand_id', '=', 'brands.id')->join('sections', 'vehicles.section_id', '=', 'sections.id')->select('vehicles.*, vehicles.id AS vid');
但我收到此错误:
SQLSTATE[42S22]:未找到列:1054 未知列 'vehicles.model,' in 'field list' (SQL: select
vehicles.model,asAS来自vehicles内部连接brands上vehicles.brand_id=brands.id内部连接 sectionsvehicles.section_id=sections.id限制 4 偏移量 0) 行 620
我做错了什么?
【问题讨论】:
标签: php sql laravel join query-builder