<?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 users.sNmame, users.iCreateTime, users_ext.iAge, users_ext.sSex FROM users LEFT JOIN users_ext ON users.iAutoId = users_ext.iUserID WHERE users.iStatus ORDER BY users.iCreateTime LIMIT , 这里是简单的一个查询语句,接下来就以ORM的形式实现: public function get…