我们可以直接在select字段中重命名字段,如下操作
DB::tables("orders")
->leftJoin('business', 'orders.b_id', '=', 'business.id')
>select("orders.name","business.name as bname")
->get();
我们可以直接在select字段中重命名字段,如下操作
DB::tables("orders")
->leftJoin('business', 'orders.b_id', '=', 'business.id')
>select("orders.name","business.name as bname")
->get();