눈으로 보기엔 별 문제를 못찾겠는데, 엘로퀀트 쿼리 빌더가 빌드한 SQL 문장을 확인해 보시겠어요?
// routes/web.php DB::listen(function (\Illuminate\Database\Events\QueryExecuted $query) { dump($query); }); Route::get('test', function () { return App\User::where('created_at', '>=', '2017-01-01') ->where('created_at', '<=', '2017-12-31') ->get(); }); // Results QueryExecuted {#106 ▼ +sql: "select * from "users" where "created_at" >= ? and "created_at" <= ?" +bindings: array:2 [▶] +time: 0.57 +connection: SQLiteConnection {#107 ▶} +connectionName: "sqlite" } [ { "id":1,"name":"김고객", "email":"user@example.com", "created_at":"2017-01-24 01:33:58", "updated_at":"2017-01-24 01:33:58" } ]
두개의 쿼리의 결과가 같아야 될것 같은데 다릅니다.;;
쿼리 빌더로 조회할때 다른 변수가 들어가나요. ?