Skip to content

Aggregate function looses bindings #53

@reneweteling

Description

@reneweteling

Hey there,

Ive just updated to laravel 4.0.9 ( composer update ) and datatables has stopped working.

What i found out is that is looses its bindings

$clients->whereRaw('appointment.statusVisit_id = 1'); // works
$clients->where('appointment.statusVisit_id', '=', 1); // doesnt work
return Datatables::of( $clients )

And the error this:

SQLSTATE[HY000]: General error: 2031 (SQL: select count(*) as aggregate from (select `client`.`id` as `clientid`, `statusOffer`.`name`, `client`.`lastname`, `client`.`city`, `appointment`.`total`, `client`.`telephone`, `client`.`mobilephone`, `client`.`followup_planning`, `client`.`followup_remarks`, `slot`.`datetime`, `user`.`firstname` as `userfirst`, `user`.`lastname` as `userlast` from `address` inner join `client` on `client`.`address_id` = `address`.`id` inner join `appointment` on `appointment`.`client_id` = `client`.`id` inner join `statusOffer` on `appointment`.`statusOffer_id` = `statusOffer`.`id` left join `slot` on `appointment`.`slot_id` = `slot`.`id` left join `user` on `slot`.`user_id` = `user`.`id` where `address`.`region_id` = ? and `appointment`.`statusVisit_id` = ?) AS count_row_table) (Bindings: array ( ))

Bigg ass query, but look at the bindings, they are missing, so i think there's the problem.

Thanks!! ( loving the package by the way!! )

My config:

PHP Version 5.3.27
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"require": {
    "laravel/framework": "4.0.*",       
    "leafo/lessphp": "v0.3.9",          
    "jasonlewis/basset": "4.0.*@dev",   
    "anahkiasen/former": "dev-master",  
    "way/generators": "dev-master",     
    "intervention/image": "dev-master",
    "patricktalmadge/bootstrapper": "dev-develop",
    "jones/web-artisan": "dev-master",
    "bllim/datatables": "*",
    "juy/profiler" : "dev-master",
    "os/php-excel": "dev-master",
    "ensepar/html2pdf": "dev-master"
},
"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "dev"

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions