<?php namespace App\Http\Controllers; use App\Student; use Illuminate\Support\Facades\DB; class StudentController extends Controller { //DB facade原始SQL语句 public function test1() { $students = DB::select('select * from student'); //var_dump($students)
SELECT p.id AS partyId, p.parent_id AS parentId, pul.username AS userName, p.city, p.birth_date AS birthDate, p.phone AS telePhoneNo FROM party p LEFT JOIN party_user_login pul ON pul.party_id = p.id WHERE 1=1 AND p.parent_id = 57 union all SELECT p.